[FFmpeg-devel] [GSoC] Patch which adds support for gamma correct scaling

nand nand at nand.wakku.to
Wed Apr 22 08:06:10 CEST 2015

> I intended to fetch the correct gamma value from the video/image metada
> or pass it by flag (like gamma=x) but yet I don't know how to get the
> correct gamma based on the input, thus for now it is hardcode.

This is how we do it in mpv:

1. If the source has enum AVColorTransferCharacteristic set, use that.
2. Otherwise, apply this heuristic:
     If YCbCr, assume BT.1886
     If RGB, assume sRGB

Also, you should note that scaling in linear light is only desirable for
downscaling. For upscaling it tends to produce rather ugly ringing

So I would advise adding a check to see if (newRes < oldRes) before
applying the gamma transformation.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150422/52e363d3/attachment.asc>

More information about the ffmpeg-devel mailing list