vanhofen
4 years ago
13 changed files with 365 additions and 426 deletions
@ -0,0 +1,97 @@ |
|||||
|
From 24a58d70cbb3997e471366bd5afe54be9007bfb1 Mon Sep 17 00:00:00 2001 |
||||
|
From: Alexander Kanavin <alex.kanavin@gmail.com> |
||||
|
Date: Tue, 10 Nov 2020 15:32:14 +0000 |
||||
|
Subject: [PATCH] libavutil: include assembly with full path from source root |
||||
|
|
||||
|
Otherwise nasm writes the full host-specific paths into .o |
||||
|
output, which breaks binary reproducibility. |
||||
|
|
||||
|
Upstream-Status: Pending |
||||
|
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
||||
|
---
|
||||
|
libavutil/x86/cpuid.asm | 2 +- |
||||
|
libavutil/x86/emms.asm | 2 +- |
||||
|
libavutil/x86/fixed_dsp.asm | 2 +- |
||||
|
libavutil/x86/float_dsp.asm | 2 +- |
||||
|
libavutil/x86/lls.asm | 2 +- |
||||
|
libavutil/x86/pixelutils.asm | 2 +- |
||||
|
6 files changed, 6 insertions(+), 6 deletions(-) |
||||
|
|
||||
|
diff --git a/libavutil/x86/cpuid.asm b/libavutil/x86/cpuid.asm
|
||||
|
index c3f7866..766f77f 100644
|
||||
|
--- a/libavutil/x86/cpuid.asm
|
||||
|
+++ b/libavutil/x86/cpuid.asm
|
||||
|
@@ -21,7 +21,7 @@
|
||||
|
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
|
;****************************************************************************** |
||||
|
|
||||
|
-%include "x86util.asm"
|
||||
|
+%include "libavutil/x86/x86util.asm"
|
||||
|
|
||||
|
SECTION .text |
||||
|
|
||||
|
diff --git a/libavutil/x86/emms.asm b/libavutil/x86/emms.asm
|
||||
|
index 8611762..df84f22 100644
|
||||
|
--- a/libavutil/x86/emms.asm
|
||||
|
+++ b/libavutil/x86/emms.asm
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
|
;****************************************************************************** |
||||
|
|
||||
|
-%include "x86util.asm"
|
||||
|
+%include "libavutil/x86/x86util.asm"
|
||||
|
|
||||
|
SECTION .text |
||||
|
|
||||
|
diff --git a/libavutil/x86/fixed_dsp.asm b/libavutil/x86/fixed_dsp.asm
|
||||
|
index 979dd5c..2f41185 100644
|
||||
|
--- a/libavutil/x86/fixed_dsp.asm
|
||||
|
+++ b/libavutil/x86/fixed_dsp.asm
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
|
;****************************************************************************** |
||||
|
|
||||
|
-%include "x86util.asm"
|
||||
|
+%include "libavutil/x86/x86util.asm"
|
||||
|
|
||||
|
SECTION .text |
||||
|
|
||||
|
diff --git a/libavutil/x86/float_dsp.asm b/libavutil/x86/float_dsp.asm
|
||||
|
index 517fd63..b773e61 100644
|
||||
|
--- a/libavutil/x86/float_dsp.asm
|
||||
|
+++ b/libavutil/x86/float_dsp.asm
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
|
;****************************************************************************** |
||||
|
|
||||
|
-%include "x86util.asm"
|
||||
|
+%include "libavutil/x86/x86util.asm"
|
||||
|
|
||||
|
SECTION_RODATA 32 |
||||
|
pd_reverse: dd 7, 6, 5, 4, 3, 2, 1, 0 |
||||
|
diff --git a/libavutil/x86/lls.asm b/libavutil/x86/lls.asm
|
||||
|
index 317fba6..d2526d1 100644
|
||||
|
--- a/libavutil/x86/lls.asm
|
||||
|
+++ b/libavutil/x86/lls.asm
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
|
;****************************************************************************** |
||||
|
|
||||
|
-%include "x86util.asm"
|
||||
|
+%include "libavutil/x86/x86util.asm"
|
||||
|
|
||||
|
SECTION .text |
||||
|
|
||||
|
diff --git a/libavutil/x86/pixelutils.asm b/libavutil/x86/pixelutils.asm
|
||||
|
index 36c57c5..8b45ead 100644
|
||||
|
--- a/libavutil/x86/pixelutils.asm
|
||||
|
+++ b/libavutil/x86/pixelutils.asm
|
||||
|
@@ -21,7 +21,7 @@
|
||||
|
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
|
;****************************************************************************** |
||||
|
|
||||
|
-%include "x86util.asm"
|
||||
|
+%include "libavutil/x86/x86util.asm"
|
||||
|
|
||||
|
SECTION .text |
||||
|
|
@ -1,14 +0,0 @@ |
|||||
--- a/libavcodec/h264_slice.c
|
|
||||
+++ b/libavcodec/h264_slice.c
|
|
||||
@@ -1460,6 +1460,11 @@
|
|
||||
h->avctx->has_b_frames = sps->num_reorder_frames; |
|
||||
} |
|
||||
|
|
||||
+ if (sps && sps->bitstream_restriction_flag &&
|
|
||||
+ h->avctx->has_b_frames < sps->num_reorder_frames) {
|
|
||||
+ h->avctx->has_b_frames = FFMAX(h->avctx->has_b_frames, sps->num_reorder_frames);
|
|
||||
+ }
|
|
||||
+
|
|
||||
last_pic_droppable = h->droppable; |
|
||||
last_pic_structure = h->picture_structure; |
|
||||
h->droppable = (nal->ref_idc == 0); |
|
@ -1,78 +0,0 @@ |
|||||
From patchwork Mon Jan 14 19:02:20 2019 |
|
||||
Content-Type: text/plain; charset="utf-8" |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Transfer-Encoding: 7bit |
|
||||
Subject: [FFmpeg-devel] amfenc: Add support for pict_type field |
|
||||
From: Michael Fabian 'Xaymar' Dirks <info@xaymar.com> |
|
||||
X-Patchwork-Id: 11748 |
|
||||
Message-Id: <20190114190220.16236-1-info@xaymar.com> |
|
||||
To: ffmpeg-devel@ffmpeg.org |
|
||||
Cc: Michael Fabian 'Xaymar' Dirks <info@xaymar.com> |
|
||||
Date: Mon, 14 Jan 2019 20:02:20 +0100 |
|
||||
|
|
||||
Adds support for the pict_type field in AVFrame to amf_h264 and amf_h265 simultaneously. This field is needed in cases where the application wishes to override the frame type with another one, such as forcefully inserting a key frame for chapter markers or similar. |
|
||||
|
|
||||
Additionally this abuses AV_PICTURE_TYPE_S for marking Skip frames, a special type of frame in AVC, SVC and HEVC which is a flag for the decoder to repeat the last frame. |
|
||||
|
|
||||
Signed-off-by: Michael Fabian 'Xaymar' Dirks <info@xaymar.com> |
|
||||
---
|
|
||||
libavcodec/amfenc.c | 46 +++++++++++++++++++++++++++++++++++++++++++++ |
|
||||
1 file changed, 46 insertions(+) |
|
||||
|
|
||||
diff --git a/libavcodec/amfenc.c b/libavcodec/amfenc.c
|
|
||||
index 384d8efc92..eb4b65e4f2 100644
|
|
||||
--- a/libavcodec/amfenc.c
|
|
||||
+++ b/libavcodec/amfenc.c
|
|
||||
@@ -693,6 +693,52 @@ int ff_amf_send_frame(AVCodecContext *avctx, const AVFrame *frame)
|
|
||||
break; |
|
||||
} |
|
||||
|
|
||||
+ // Override Picture Type for Frame
|
|
||||
+ if (avctx->codec->id == AV_CODEC_ID_H264) {
|
|
||||
+ switch (frame->pict_type) {
|
|
||||
+ case AV_PICTURE_TYPE_I:
|
|
||||
+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_PICTURE_TYPE_I);
|
|
||||
+ break;
|
|
||||
+ case AV_PICTURE_TYPE_P:
|
|
||||
+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_PICTURE_TYPE_P);
|
|
||||
+ break;
|
|
||||
+ case AV_PICTURE_TYPE_B:
|
|
||||
+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_PICTURE_TYPE_B);
|
|
||||
+ break;
|
|
||||
+ case AV_PICTURE_TYPE_S:
|
|
||||
+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_PICTURE_TYPE_SKIP);
|
|
||||
+ break;
|
|
||||
+ default:
|
|
||||
+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_PICTURE_TYPE_NONE);
|
|
||||
+ break;
|
|
||||
+ }
|
|
||||
+ // Keyframe overrides previous assignment.
|
|
||||
+ if (frame->key_frame) {
|
|
||||
+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_PICTURE_TYPE_IDR);
|
|
||||
+ }
|
|
||||
+ } else if (avctx->codec->id == AV_CODEC_ID_HEVC) {
|
|
||||
+ switch (frame->pict_type) {
|
|
||||
+ case AV_PICTURE_TYPE_I:
|
|
||||
+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_I);
|
|
||||
+ break;
|
|
||||
+ case AV_PICTURE_TYPE_P:
|
|
||||
+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_P);
|
|
||||
+ break;
|
|
||||
+ case AV_PICTURE_TYPE_B:
|
|
||||
+ av_log(ctx, AV_LOG_WARNING, "Ignoring B-Frame, unsupported by AMD AMF H.265 Encoder.");
|
|
||||
+ break;
|
|
||||
+ case AV_PICTURE_TYPE_S:
|
|
||||
+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_SKIP);
|
|
||||
+ break;
|
|
||||
+ default:
|
|
||||
+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_NONE);
|
|
||||
+ break;
|
|
||||
+ }
|
|
||||
+ // Keyframe overrides previous assignment.
|
|
||||
+ if (frame->key_frame) {
|
|
||||
+ AMF_ASSIGN_PROPERTY_INT64(res, surface, AMF_VIDEO_ENCODER_HEVC_FORCE_PICTURE_TYPE, AMF_VIDEO_ENCODER_HEVC_PICTURE_TYPE_IDR);
|
|
||||
+ }
|
|
||||
+ }
|
|
||||
|
|
||||
// submit surface |
|
||||
res = ctx->encoder->pVtbl->SubmitInput(ctx->encoder, (AMFData*)surface); |
|
Loading…
Reference in new issue