#include "flv.h"
#include "h263.h"
#include "h263_parser.h"
+#include "hwaccel.h"
#include "internal.h"
#include "mpeg_er.h"
#include "mpeg4video.h"
static enum AVPixelFormat h263_get_format(AVCodecContext *avctx)
{
+ /* MPEG-4 Studio Profile only, not supported by hardware */
+ if (avctx->bits_per_raw_sample > 8) {
+ av_assert1(avctx->profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO);
+ return avctx->pix_fmt;
+ }
+
if (avctx->codec->id == AV_CODEC_ID_MSS2)
return AV_PIX_FMT_YUV420P;
ff_set_qscale(s, s->qscale);
+ if (s->studio_profile) {
+ if ((ret = ff_mpeg4_decode_studio_slice_header(s->avctx->priv_data)) < 0)
+ return ret;
+ }
+
if (s->avctx->hwaccel) {
const uint8_t *start = s->gb.buffer + get_bits_count(&s->gb) / 8;
ret = s->avctx->hwaccel->decode_slice(s->avctx, start, s->gb.buffer_end - start);
#if CONFIG_H263_VAAPI_HWACCEL || CONFIG_MPEG4_VAAPI_HWACCEL
AV_PIX_FMT_VAAPI,
#endif
+#if CONFIG_MPEG4_NVDEC_HWACCEL
+ AV_PIX_FMT_CUDA,
+#endif
#if CONFIG_MPEG4_VDPAU_HWACCEL
AV_PIX_FMT_VDPAU,
#endif
.flush = ff_mpeg_flush,
.max_lowres = 3,
.pix_fmts = ff_h263_hwaccel_pixfmt_list_420,
+ .hw_configs = (const AVCodecHWConfigInternal*[]) {
+#if CONFIG_H263_VAAPI_HWACCEL
+ HWACCEL_VAAPI(h263),
+#endif
+#if CONFIG_MPEG4_VDPAU_HWACCEL
+ HWACCEL_VDPAU(mpeg4),
+#endif
+#if CONFIG_H263_VIDEOTOOLBOX_HWACCEL
+ HWACCEL_VIDEOTOOLBOX(h263),
+#endif
+ NULL
+ },
};