You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/amfdec: Add VP9 AMF decoder
This commit is contained in:
committed by
Dmitrii Ovchinnikov
parent
09cd38e9d5
commit
b2c0d37be5
1
configure
vendored
1
configure
vendored
@ -3477,6 +3477,7 @@ vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8"
|
||||
vp8_vaapi_encoder_select="vaapi_encode"
|
||||
vp8_v4l2m2m_decoder_deps="v4l2_m2m vp8_v4l2_m2m"
|
||||
vp8_v4l2m2m_encoder_deps="v4l2_m2m vp8_v4l2_m2m"
|
||||
vp9_amf_decoder_deps="amf"
|
||||
vp9_cuvid_decoder_deps="cuvid"
|
||||
vp9_mediacodec_decoder_deps="mediacodec"
|
||||
vp9_mediacodec_encoder_deps="mediacodec"
|
||||
|
@ -802,6 +802,7 @@ OBJS-$(CONFIG_VP8_V4L2M2M_ENCODER) += v4l2_m2m_enc.o
|
||||
OBJS-$(CONFIG_VP9_DECODER) += vp9.o vp9data.o vp9dsp.o vp9lpf.o vp9recon.o \
|
||||
vp9block.o vp9prob.o vp9mvs.o vpx_rac.o \
|
||||
vp9dsp_8bpp.o vp9dsp_10bpp.o vp9dsp_12bpp.o
|
||||
OBJS-$(CONFIG_VP9_AMF_DECODER) += amfdec.o
|
||||
OBJS-$(CONFIG_VP9_CUVID_DECODER) += cuviddec.o
|
||||
OBJS-$(CONFIG_VP9_MEDIACODEC_DECODER) += mediacodecdec.o
|
||||
OBJS-$(CONFIG_VP9_MEDIACODEC_ENCODER) += mediacodecenc.o
|
||||
|
@ -902,6 +902,7 @@ extern const FFCodec ff_vp8_mediacodec_encoder;
|
||||
extern const FFCodec ff_vp8_qsv_decoder;
|
||||
extern const FFCodec ff_vp8_v4l2m2m_encoder;
|
||||
extern const FFCodec ff_vp8_vaapi_encoder;
|
||||
extern const FFCodec ff_vp9_amf_decoder;
|
||||
extern const FFCodec ff_vp9_cuvid_decoder;
|
||||
extern const FFCodec ff_vp9_mediacodec_decoder;
|
||||
extern const FFCodec ff_vp9_mediacodec_encoder;
|
||||
|
@ -90,6 +90,9 @@ static int amf_init_decoder(AVCodecContext *avctx)
|
||||
AMFBuffer *buffer;
|
||||
amf_int64 color_profile;
|
||||
int pool_size = 36;
|
||||
// way-around for older drivers that don't support dynamic bitness detection -
|
||||
// define HEVC and VP9 10-bit based on container info
|
||||
int no_bitness_detect = amf_legacy_driver_no_bitness_detect(amf_device_ctx);
|
||||
|
||||
ctx->drain = 0;
|
||||
ctx->resolution_changed = 0;
|
||||
@ -100,13 +103,17 @@ static int amf_init_decoder(AVCodecContext *avctx)
|
||||
break;
|
||||
case AV_CODEC_ID_HEVC: {
|
||||
codec_id = AMFVideoDecoderHW_H265_HEVC;
|
||||
// way-around for older drivers that don't support dynamic butness detection -
|
||||
// define HEVC 10-bit based on container info
|
||||
if(amf_legacy_driver_no_bitness_detect(amf_device_ctx)){
|
||||
if(no_bitness_detect){
|
||||
if(avctx->pix_fmt == AV_PIX_FMT_YUV420P10)
|
||||
codec_id = AMFVideoDecoderHW_H265_MAIN10;
|
||||
}
|
||||
|
||||
} break;
|
||||
case AV_CODEC_ID_VP9: {
|
||||
codec_id = AMFVideoDecoderHW_VP9;
|
||||
if(no_bitness_detect){
|
||||
if(avctx->pix_fmt == AV_PIX_FMT_YUV420P10)
|
||||
codec_id = AMFVideoDecoderHW_VP9_10BIT;
|
||||
}
|
||||
} break;
|
||||
case AV_CODEC_ID_AV1:
|
||||
codec_id = AMFVideoDecoderHW_AV1;
|
||||
@ -717,4 +724,5 @@ const FFCodec ff_##x##_amf_decoder = { \
|
||||
|
||||
DEFINE_AMF_DECODER(h264, H264, "h264_mp4toannexb")
|
||||
DEFINE_AMF_DECODER(hevc, HEVC, NULL)
|
||||
DEFINE_AMF_DECODER(vp9, VP9, NULL)
|
||||
DEFINE_AMF_DECODER(av1, AV1, NULL)
|
||||
|
Reference in New Issue
Block a user