[FFmpeg-devel] [PATCH]Fix r10kdec output
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Sat Dec 27 23:09:26 CET 2014
On Sat, Dec 27, 2014 at 10:39:39PM +0100, Carl Eugen Hoyos wrote:
> Hi!
>
> Attached patch allows to use -f framecrc to check r10k -> gbrp10 ffv1 ->
> r10k roundtrips: The decoder currently writes incorrect lsb for blue that
> are different for the input and output files. This does not affect the 10
> significant bits and therefore the ffv1 files are not affected, only the
> rgb48 framechecks are wrong.
>
> Please comment, Carl Eugen
> diff --git a/libavcodec/r210dec.c b/libavcodec/r210dec.c
> index cbebf7c..130ff8c 100644
> --- a/libavcodec/r210dec.c
> +++ b/libavcodec/r210dec.c
> @@ -70,7 +70,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
> g = (pixel >> 4) & 0xffc0;
> r = (pixel >> 14) & 0xffc0;
> } else {
> - b = pixel << 4;
> + b = pixel << 4 & 0xffc0;
Never remember the order so it might not be required, but for
consistency at least I think you should add ().
But otherwise I think it makes sense.
Even though the previous comment applies: I think it was done this way on purpose originally.
More information about the ffmpeg-devel
mailing list