[FFmpeg-devel] [PATCH 1/4] avcodec/proresdec2: change profile only if it is unknown

Michael Niedermayer michael at niedermayer.cc
Fri Dec 7 12:00:57 EET 2018


On Fri, Dec 07, 2018 at 10:28:09AM +0100, Paul B Mahol wrote:
> On 12/7/18, Michael Niedermayer <michael at niedermayer.cc> wrote:
> > On Wed, Dec 05, 2018 at 09:22:48PM +0100, Paul B Mahol wrote:
> >> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> >> ---
> >>  libavcodec/proresdec2.c | 51 ++++++++++++++++++++++-------------------
> >>  1 file changed, 27 insertions(+), 24 deletions(-)
> >>
> >> diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c
> >> index 8581d797fb..80a76bbba1 100644
> >> --- a/libavcodec/proresdec2.c
> >> +++ b/libavcodec/proresdec2.c
> >> @@ -140,32 +140,35 @@ static av_cold int decode_init(AVCodecContext
> >> *avctx)
> >>@@ -140,6 +140,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
> >>
> >>     avctx->bits_per_raw_sample = 10;
> >>
> >>+    if (avctx->profile == FF_PROFILE_UNKNOWN) {
> >>         switch (avctx->codec_tag) {
> >>         case MKTAG('a','p','c','o'):
> >>             avctx->profile = FF_PROFILE_PRORES_PROXY;
> >>@@ -155,16 +156,18 @@ static av_cold int decode_init(AVCodecContext
> >> *avctx)
> >>             break;
> >>         case MKTAG('a','p','4','h'):
> >>             avctx->profile = FF_PROFILE_PRORES_4444;
> >>-        avctx->bits_per_raw_sample = 12;
> >>             break;
> >>         case MKTAG('a','p','4','x'):
> >>             avctx->profile = FF_PROFILE_PRORES_XQ;
> >>-        avctx->bits_per_raw_sample = 12;
> >>             break;
> >>         default:
> >>-        avctx->profile = FF_PROFILE_UNKNOWN;
> >>             av_log(avctx, AV_LOG_WARNING, "Unknown prores profile %d\n",
> >> avctx->codec_tag);
> >>         }
> >>+    }
> >>+
> >>+    if (avctx->profile == FF_PROFILE_PRORES_XQ ||
> >>+        avctx->profile == FF_PROFILE_PRORES_4444)
> >>+        avctx->bits_per_raw_sample = 12;
> >
> > with this it would be possible to have 12bit output while the profile
> > is set to one having 10bits and vice versa ?
> 
> No, and neither with previous code.
> 
> > maybe the profile should only be left if it is compatible with the
> > decoder output
> 
> I do not follow.

I may have misunderstood the intend of the patch
please document what this fixes in the commit message.

AVCodecContext.profile is for decoding set by the decoder. 
(thats how its documented in avcodec.h)

So the obvious thought that this is about not overriding a profile
set by the user(app) or demuxer might have been flawed on my side
as that seems not possible in the API as it is documented

thx

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20181207/7373f059/attachment.sig>


More information about the ffmpeg-devel mailing list