[vlc-devel] [PATCH] DXVA2: don't use the decoder if the profile is not supported (v3)

Steve Lhomme robux4 at videolabs.io
Thu Apr 23 09:33:17 CEST 2015


On Thu, Apr 23, 2015 at 9:29 AM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> Le 2015-04-23 09:17, Steve Lhomme a écrit :
>>
>> --
>> replaces v2 https://patches.videolan.org/patch/8452/ as some of the
>> added GUID are now back in master oO
>> now with finer check on profile values for each codec using a table
>> of whitelisted profiles
>>
>> the MPEG1 extra mapping is important because other MPEG2 DXAV
>> decoders are not required to decode MPEG1
>> ---
>>  modules/codec/Makefile.am     |   2 +-
>>  modules/codec/avcodec/dxva2.c | 184
>> ++++++++++++++++++++++++++----------------
>>  2 files changed, 116 insertions(+), 70 deletions(-)
>>
>> diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am
>> index 9c31230..e5f7ed8 100644
>> --- a/modules/codec/Makefile.am
>> +++ b/modules/codec/Makefile.am
>> @@ -342,7 +342,7 @@ endif
>>
>>  libdxva2_plugin_la_SOURCES = \
>>         video_chroma/copy.c video_chroma/copy.h \
>> -       codec/avcodec/dxva2.c
>> +       codec/avcodec/dxva2.c codec/h264_nal.c codec/h264_nal.h
>>  libdxva2_plugin_la_LIBADD = -lole32 -lshlwapi -luuid
>>  if HAVE_AVCODEC_DXVA2
>>  codec_LTLIBRARIES += libdxva2_plugin.la
>> diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
>> index 575df04..ee58642 100644
>> --- a/modules/codec/avcodec/dxva2.c
>> +++ b/modules/codec/avcodec/dxva2.c
>> @@ -51,6 +51,7 @@
>>  #include "avcodec.h"
>>  #include "va.h"
>>  #include "../../video_chroma/copy.h"
>> +#include "../h264_nal.h"
>>
>>  static int Open(vlc_va_t *, AVCodecContext *, const es_format_t *);
>>  static void Close(vlc_va_t *, AVCodecContext *);
>> @@ -168,93 +169,103 @@ typedef struct {
>>      const char   *name;
>>      const GUID   *guid;
>>      int          codec;
>> +    const int    *p_profiles; // NULL or ends with 0
>>  } dxva2_mode_t;
>> +
>> +static const int PROF_MPEG2_SIMPLE[] = {FF_PROFILE_MPEG2_SIMPLE, 0};
>> +static const int PROF_MPEG2_MAIN[] = {FF_PROFILE_MPEG2_SIMPLE,
>> FF_PROFILE_MPEG2_MAIN, 0};
>> +static const int PROF_H264_HIGH[] = {FF_PROFILE_H264_BASELINE,
>
>
> No. BP is not included in HiP, only CBP and MP are.

OK.

> I'd still argue for moving all this stuff in lavc.

You mean in as generic reusable code in our avcodec module ? Or in
FFmpeg and libav ?

Steve



More information about the vlc-devel mailing list