[FFmpeg-devel] [PATCH 2/2] fic: Support rendering cursors

Derek Buitenhuis derek.buitenhuis at gmail.com
Tue Apr 22 22:30:13 CEST 2014


On 4/21/2014 9:48 PM, Michael Niedermayer wrote:
>> +    for (i = 0; i < size; i++)
>> +        dst[i] = (dst[i] * (256 - alpha[i]) + src[i] * alpha[i]) >> 8;
> 
> this would be simpler:
> dst[i] +=  ((src[i] - dst[i]) * alpha[i]) >> 8;

Done.

>> +        planes[0][i] = av_clip_uint8((( 25 * ptr[0] + 129 * ptr[1] +  66 * ptr[2]) / 255) + 16);
>> +        planes[1][i] = av_clip_uint8(((-38 * ptr[0] + 112 * ptr[1] + -74 * ptr[2]) / 255) + 128);
>> +        planes[2][i] = av_clip_uint8(((-18 * ptr[0] + 112 * ptr[1] + -94 * ptr[2]) / 255) + 128);
> 
> the clipping seems redundant

I'm not entirely sure if it can over/underflow with these equations (I got them from the binary decoder).

>> +    if (tsize < 32) {
>> +        av_log(avctx, AV_LOG_WARNING,
>> +               "Cursor data too small. Skipping cursor.\n");
> 
> this could print the value that is too small

Done.

- Derek


More information about the ffmpeg-devel mailing list