[FFmpeg-devel] [PATCH] y41p encoder and decoder

Paul B Mahol onemda at gmail.com
Sun Jan 1 17:22:37 CET 2012


On 1/1/12, Nicolas George <nicolas.george at normalesup.org> wrote:
> Le duodi 12 nivose, an CCXX, Paul B Mahol a ecrit :
>> y41p is a packed 12-bit 4:1:1 YUV format used by Brooktree.
>
> Sorry, stupid question: how is it different from a rawvideo codec? A few
> words in decoders.texi may be welcome.

http://v4l2spec.bytesex.org/spec/r4629.htm
>
>> +    if (avpkt->size < 1.5 * avctx->height * avctx->width) {
>
> I am a little uncomfortable with the float for that kind of thing. Using
> "*3/2" is IMHO better. Maybe "pix = w*h; size = pix+pix/2" if you want to
> avoid overflow while allowing huge frame sizes.
>
> By the way, if the frame size is likely to come from untrusted sources
> (including the demuxer), then you must check for overflow in the
> multiplication.
>
>> +    if (avctx->width & 7) {
>> +        av_log(avctx, AV_LOG_ERROR, "y41p requires width to be
>> divisible by 8.\n");
>> +        return AVERROR_INVALIDDATA;
>
> AVERROR(EINVAL) seems more appropriate.
>
>> +    if (buf_size < avctx->width * avctx->height * 1.5) {
>
> Ditto about the float and the check for overflow.
>
> No other remarks from me, it looks fine, but I do not know that codec.
>
> Regards,
>
> --
>   Nicolas George
>


More information about the ffmpeg-devel mailing list