Mercurial > libavcodec.hg
comparison raw.c @ 2979:bfabfdf9ce55 libavcodec
COSMETICS: tabs --> spaces, some prettyprinting
| author | diego |
|---|---|
| date | Thu, 22 Dec 2005 01:10:11 +0000 |
| parents | ef2149182f1c |
| children | 0b546eab515d |
comparison
equal
deleted
inserted
replaced
| 2978:403183bbb505 | 2979:bfabfdf9ce55 |
|---|---|
| 68 unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat fmt) | 68 unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat fmt) |
| 69 { | 69 { |
| 70 const PixelFormatTag * tags = pixelFormatTags; | 70 const PixelFormatTag * tags = pixelFormatTags; |
| 71 while (tags->pix_fmt >= 0) { | 71 while (tags->pix_fmt >= 0) { |
| 72 if (tags->pix_fmt == fmt) | 72 if (tags->pix_fmt == fmt) |
| 73 return tags->fourcc; | 73 return tags->fourcc; |
| 74 tags++; | 74 tags++; |
| 75 } | 75 } |
| 76 return 0; | 76 return 0; |
| 77 } | 77 } |
| 78 | 78 |
| 79 /* RAW Decoder Implementation */ | 79 /* RAW Decoder Implementation */ |
| 113 picture->linesize[0] *= -1; | 113 picture->linesize[0] *= -1; |
| 114 } | 114 } |
| 115 } | 115 } |
| 116 | 116 |
| 117 static int raw_decode(AVCodecContext *avctx, | 117 static int raw_decode(AVCodecContext *avctx, |
| 118 void *data, int *data_size, | 118 void *data, int *data_size, |
| 119 uint8_t *buf, int buf_size) | 119 uint8_t *buf, int buf_size) |
| 120 { | 120 { |
| 121 RawVideoContext *context = avctx->priv_data; | 121 RawVideoContext *context = avctx->priv_data; |
| 122 int bytesNeeded; | 122 int bytesNeeded; |
| 123 | 123 |
| 124 AVPicture * picture = (AVPicture *) data; | 124 AVPicture * picture = (AVPicture *) data; |
| 165 avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt); | 165 avctx->codec_tag = avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt); |
| 166 return 0; | 166 return 0; |
| 167 } | 167 } |
| 168 | 168 |
| 169 static int raw_encode(AVCodecContext *avctx, | 169 static int raw_encode(AVCodecContext *avctx, |
| 170 unsigned char *frame, int buf_size, void *data) | 170 unsigned char *frame, int buf_size, void *data) |
| 171 { | 171 { |
| 172 return avpicture_layout((AVPicture *)data, avctx->pix_fmt, avctx->width, | 172 return avpicture_layout((AVPicture *)data, avctx->pix_fmt, avctx->width, |
| 173 avctx->height, frame, buf_size); | 173 avctx->height, frame, buf_size); |
| 174 } | 174 } |
| 175 | 175 |
