[FFmpeg-devel] [PATCH] libavcodec/pgx: Added pgx decoder

Gautam Ramakrishnan gautamramk at gmail.com
Sat Jun 27 15:31:51 EEST 2020


On Sat, Jun 27, 2020 at 5:45 PM Nicolas George <george at nsup.org> wrote:
>
> Gautam Ramakrishnan (12020-06-25):
> > The type conversions confused me a bit. I will remove them.
>
> Please be sure you have the basics about C type promotions right. C will
> automatically convert types whenever necessary and notify when one such
> conversion may cause unexpected results. Adding a cast will force a
> conversion, possibly a wrong conversion followed by the right automatic
> conversion. It will also silence possible warnings.
>
> The rule of thumb is that a C program should contain as little casts as
> possible, usually to silence warnings in tricky pointer arithmetic where
> the developer has checked carefully.
>
> > I guess changing from bytestream2_get_byteu to bytestrea2_get_byte should
> > do the trick here?
>
> What? You use the u variant if you are sure there is enough data
> available, it has nothing to do with a cast.
>
> > So you mean to say no need to store height and width in the
> > PGX context?
>
> Exactly. Just define all the variables decoded from the header in
> decode_frame(). If there are too many, you can group them in another
> structure.
This will require me to remove the decode_header() function and add the
logic directly into the decode_frame function. If that is fine, I shall remove
PGX context structrure.
>
> Regards,
>
> --
>   Nicolas George
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".



-- 
-------------
Gautam |


More information about the ffmpeg-devel mailing list