Revision 3dd2f87e

View differences:

libavcodec/raw.c
51 51
    /* quicktime */
52 52
    { PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') },
53 53
    { PIX_FMT_UYVY422, MKTAG('A', 'V', 'U', 'I') }, /* FIXME merge both fields */
54
    { PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', '2') },
54 55
    { PIX_FMT_PAL8,    MKTAG('W', 'R', 'A', 'W') },
55 56

  
56 57
    { PIX_FMT_NONE, 0 },
libavcodec/rawdec.c
26 26

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

  
30 31
typedef struct RawVideoContext {
31 32
    unsigned char * buffer;  /* block of memory for holding one frame */
......
144 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 159
    *data_size = sizeof(AVPicture);
148 160
    return buf_size;
149 161
}
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 = {
libavformat/isom.c
61 61
/*  { CODEC_ID_, MKTAG('I', 'V', '5', '0') }, *//* Indeo 5.0 */
62 62

  
63 63
    { CODEC_ID_RAWVIDEO, MKTAG('r', 'a', 'w', ' ') }, /* Uncompressed RGB */
64
/*  { CODEC_ID_RAWVIDEO, MKTAG('Y', 'u', 'v', '2') }, *//* Uncompressed YUV422 */
64
    { CODEC_ID_RAWVIDEO, MKTAG('y', 'u', 'v', '2') }, /* Uncompressed YUV422 */
65 65
    { CODEC_ID_RAWVIDEO, MKTAG('A', 'V', 'U', 'I') }, /* YUV with alpha-channel (AVID Uncompressed) */
66 66
    { CODEC_ID_RAWVIDEO, MKTAG('2', 'v', 'u', 'y') }, /* UNCOMPRESSED 8BIT 4:2:2 */
67 67

  

Also available in: Unified diff