Revision 3dd2f87e libavcodec/rawenc.c

View differences:

libavcodec/rawenc.c
26 26

  
27 27
#include "avcodec.h"
28 28
#include "raw.h"
29
#include "libavutil/intreadwrite.h"
29 30

  
30 31
static av_cold int raw_init_encoder(AVCodecContext *avctx)
31 32
{
......
40 41
static int raw_encode(AVCodecContext *avctx,
41 42
                            unsigned char *frame, int buf_size, void *data)
42 43
{
43
    return avpicture_layout((AVPicture *)data, avctx->pix_fmt, avctx->width,
44
    int ret = avpicture_layout((AVPicture *)data, avctx->pix_fmt, avctx->width,
44 45
                                               avctx->height, frame, buf_size);
46

  
47
    if(avctx->codec_tag == AV_RL32("yuv2") && ret > 0 &&
48
       avctx->pix_fmt   == PIX_FMT_YUYV422) {
49
        int x;
50
        for(x = 1; x < avctx->height*avctx->width*2; x += 2)
51
            frame[x] ^= 0x80;
52
    }
53
    return ret;
45 54
}
46 55

  
47 56
AVCodec rawvideo_encoder = {

Also available in: Unified diff