mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/ffv1: Fix rgb plane ordering in experimental planar RGB
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
87da118898
commit
b1d1250938
@ -150,7 +150,11 @@ static void RENAME(decode_rgb_frame)(FFV1Context *s, uint8_t *src[3], int w, int
|
|||||||
|
|
||||||
if (lbd)
|
if (lbd)
|
||||||
*((uint32_t*)(src[0] + x*4 + stride[0]*y)) = b + (g<<8) + (r<<16) + (a<<24);
|
*((uint32_t*)(src[0] + x*4 + stride[0]*y)) = b + (g<<8) + (r<<16) + (a<<24);
|
||||||
else {
|
else if (sizeof(TYPE) == 4) {
|
||||||
|
*((uint16_t*)(src[0] + x*2 + stride[0]*y)) = g;
|
||||||
|
*((uint16_t*)(src[1] + x*2 + stride[1]*y)) = b;
|
||||||
|
*((uint16_t*)(src[2] + x*2 + stride[2]*y)) = r;
|
||||||
|
} else {
|
||||||
*((uint16_t*)(src[0] + x*2 + stride[0]*y)) = b;
|
*((uint16_t*)(src[0] + x*2 + stride[0]*y)) = b;
|
||||||
*((uint16_t*)(src[1] + x*2 + stride[1]*y)) = g;
|
*((uint16_t*)(src[1] + x*2 + stride[1]*y)) = g;
|
||||||
*((uint16_t*)(src[2] + x*2 + stride[2]*y)) = r;
|
*((uint16_t*)(src[2] + x*2 + stride[2]*y)) = r;
|
||||||
|
@ -150,6 +150,10 @@ static int RENAME(encode_rgb_frame)(FFV1Context *s, const uint8_t *src[3],
|
|||||||
g = (v >> 8) & 0xFF;
|
g = (v >> 8) & 0xFF;
|
||||||
r = (v >> 16) & 0xFF;
|
r = (v >> 16) & 0xFF;
|
||||||
a = v >> 24;
|
a = v >> 24;
|
||||||
|
} else if (sizeof(TYPE) == 4) {
|
||||||
|
g = *((const uint16_t *)(src[0] + x*2 + stride[0]*y));
|
||||||
|
b = *((const uint16_t *)(src[1] + x*2 + stride[1]*y));
|
||||||
|
r = *((const uint16_t *)(src[2] + x*2 + stride[2]*y));
|
||||||
} else {
|
} else {
|
||||||
b = *((const uint16_t *)(src[0] + x*2 + stride[0]*y));
|
b = *((const uint16_t *)(src[0] + x*2 + stride[0]*y));
|
||||||
g = *((const uint16_t *)(src[1] + x*2 + stride[1]*y));
|
g = *((const uint16_t *)(src[1] + x*2 + stride[1]*y));
|
||||||
|
Loading…
Reference in New Issue
Block a user