summaryrefslogtreecommitdiff
path: root/libavcodec/r210enc.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2014-12-27 22:49:39 +0100
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2014-12-27 22:57:53 +0100
commit035180901de9bbea873001b82d96dd2b7a45d76a (patch)
tree936f37cdc0e2c6710d4263d06c9f4e7b4710f64c /libavcodec/r210enc.c
parent56e432b27b8f65872a8b1381bde86b7e54f6a7c7 (diff)
downloadffmpeg-035180901de9bbea873001b82d96dd2b7a45d76a.tar.gz
r210enc.c: Simplify and never store more than 10 bits.
The r10k and avrp decoders would previously store 12 bit precision for the blue channel, which is inconsistent and probably not a desirable behaviour. Now the 2 unused extra bits are set to 0. This is possibly not ideal either as RGBA1010102 format has the same layout but stores alpha in these bits, thus explicitly setting them to 1 might be preferable. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavcodec/r210enc.c')
-rw-r--r--libavcodec/r210enc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/r210enc.c b/libavcodec/r210enc.c
index d61cd757e8..07dfc50bf0 100644
--- a/libavcodec/r210enc.c
+++ b/libavcodec/r210enc.c
@@ -58,11 +58,11 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
uint32_t pixel;
uint16_t r = *src++ >> 6;
uint16_t g = *src++ >> 6;
- uint16_t b = *src++ >> 4;
+ uint16_t b = *src++ >> 6;
if (avctx->codec_id == AV_CODEC_ID_R210)
- pixel = (r << 20) | (g << 10) | b >> 2;
+ pixel = (r << 20) | (g << 10) | b;
else
- pixel = (r << 22) | (g << 12) | b;
+ pixel = (r << 22) | (g << 12) | (b << 2);
if (avctx->codec_id == AV_CODEC_ID_AVRP)
bytestream_put_le32(&dst, pixel);
else