comparison rawdec.c @ 9335:c7396480f8e3 libavcodec

Map MOV fourcc YUV2 correctly to PIX_FMT_YUYV422. Patch by Jai Menon
author cehoyos
date Thu, 02 Apr 2009 12:15:04 +0000
parents 231e8535e00e
children 54bc8a2727b0
comparison
equal deleted inserted replaced
9334:44f117042212 9335:c7396480f8e3
24 * Raw Video Decoder 24 * Raw Video Decoder
25 */ 25 */
26 26
27 #include "avcodec.h" 27 #include "avcodec.h"
28 #include "raw.h" 28 #include "raw.h"
29 #include "libavutil/intreadwrite.h"
29 30
30 typedef struct RawVideoContext { 31 typedef struct RawVideoContext {
31 unsigned char * buffer; /* block of memory for holding one frame */ 32 unsigned char * buffer; /* block of memory for holding one frame */
32 int length; /* number of bytes in buffer */ 33 int length; /* number of bytes in buffer */
33 int flip; 34 int flip;
142 unsigned char *tmp = picture->data[1]; 143 unsigned char *tmp = picture->data[1];
143 picture->data[1] = picture->data[2]; 144 picture->data[1] = picture->data[2];
144 picture->data[2] = tmp; 145 picture->data[2] = tmp;
145 } 146 }
146 147
148 if(avctx->codec_tag == AV_RL32("yuv2") &&
149 avctx->pix_fmt == PIX_FMT_YUYV422) {
150 int x, y;
151 uint8_t *line = picture->data[0];
152 for(y = 0; y < avctx->height; y++) {
153 for(x = 0; x < avctx->width; x++)
154 line[2*x + 1] ^= 0x80;
155 line += picture->linesize[0];
156 }
157 }
158
147 *data_size = sizeof(AVPicture); 159 *data_size = sizeof(AVPicture);
148 return buf_size; 160 return buf_size;
149 } 161 }
150 162
151 static av_cold int raw_close_decoder(AVCodecContext *avctx) 163 static av_cold int raw_close_decoder(AVCodecContext *avctx)