#include "h264_mvpred.h"
#include "h264_ps.h"
#include "golomb.h"
+#include "hwaccel.h"
#include "mathops.h"
#include "me_cmp.h"
#include "mpegutils.h"
-#include "mpeg4video.h"
#include "profiles.h"
#include "rectangle.h"
#include "thread.h"
h->flags = avctx->flags;
h->poc.prev_poc_msb = 1 << 16;
h->recovery_frame = -1;
- h->x264_build = -1;
h->frame_recovered = 0;
h->poc.prev_frame_num = -1;
- h->sei.frame_packing.frame_packing_arrangement_cancel_flag = -1;
+ h->sei.frame_packing.arrangement_cancel_flag = -1;
h->sei.unregistered.x264_build = -1;
h->next_outputed_poc = INT_MIN;
break;
case H264_NAL_SPS: {
GetBitContext tmp_gb = nal->gb;
+ if (avctx->hwaccel && avctx->hwaccel->decode_params) {
+ ret = avctx->hwaccel->decode_params(avctx,
+ nal->type,
+ nal->raw_data,
+ nal->raw_size);
+ if (ret < 0)
+ goto end;
+ }
if (ff_h264_decode_seq_parameter_set(&tmp_gb, avctx, &h->ps, 0) >= 0)
break;
av_log(h->avctx, AV_LOG_DEBUG,
break;
}
case H264_NAL_PPS:
+ if (avctx->hwaccel && avctx->hwaccel->decode_params) {
+ ret = avctx->hwaccel->decode_params(avctx,
+ nal->type,
+ nal->raw_data,
+ nal->raw_size);
+ if (ret < 0)
+ goto end;
+ }
ret = ff_h264_decode_picture_parameter_set(&nal->gb, avctx, &h->ps,
nal->size_bits);
if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
int ret;
if (src->format == AV_PIX_FMT_VIDEOTOOLBOX && src->buf[0]->size == 1)
- return AVERROR_EXTERNAL;
+ return AVERROR_INVALIDDATA;
ret = av_frame_ref(dst, src);
if (ret < 0)
{ "is_avc", "is avc", OFFSET(is_avc), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, 0 },
{ "nal_length_size", "nal_length_size", OFFSET(nal_length_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 4, 0 },
{ "enable_er", "Enable error resilience on damaged frames (unsafe)", OFFSET(enable_er), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VD },
+ { "x264_build", "Assume this x264 version if no x264 version found in any SEI", OFFSET(x264_build), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, VD },
{ NULL },
};
.capabilities = /*AV_CODEC_CAP_DRAW_HORIZ_BAND |*/ AV_CODEC_CAP_DR1 |
AV_CODEC_CAP_DELAY | AV_CODEC_CAP_SLICE_THREADS |
AV_CODEC_CAP_FRAME_THREADS,
+ .hw_configs = (const AVCodecHWConfigInternal*[]) {
+#if CONFIG_H264_DXVA2_HWACCEL
+ HWACCEL_DXVA2(h264),
+#endif
+#if CONFIG_H264_D3D11VA_HWACCEL
+ HWACCEL_D3D11VA(h264),
+#endif
+#if CONFIG_H264_D3D11VA2_HWACCEL
+ HWACCEL_D3D11VA2(h264),
+#endif
+#if CONFIG_H264_NVDEC_HWACCEL
+ HWACCEL_NVDEC(h264),
+#endif
+#if CONFIG_H264_VAAPI_HWACCEL
+ HWACCEL_VAAPI(h264),
+#endif
+#if CONFIG_H264_VDPAU_HWACCEL
+ HWACCEL_VDPAU(h264),
+#endif
+#if CONFIG_H264_VIDEOTOOLBOX_HWACCEL
+ HWACCEL_VIDEOTOOLBOX(h264),
+#endif
+ NULL
+ },
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_EXPORTS_CROPPING,
.flush = flush_dpb,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),