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

Nicolas George george at nsup.org
Sat Jun 27 15:14:46 EEST 2020


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.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200627/19e88d6b/attachment.sig>


More information about the ffmpeg-devel mailing list