Mercurial > libavcodec.hg
comparison avs.c @ 8298:2dcc437528fa libavcodec
avoid POSIX reserved _t suffix
| author | aurel |
|---|---|
| date | Thu, 11 Dec 2008 22:34:14 +0000 |
| parents | e943e1409077 |
| children | 54bc8a2727b0 |
comparison
equal
deleted
inserted
replaced
| 8297:20e0f0809b27 | 8298:2dcc437528fa |
|---|---|
| 23 #include "bitstream.h" | 23 #include "bitstream.h" |
| 24 | 24 |
| 25 | 25 |
| 26 typedef struct { | 26 typedef struct { |
| 27 AVFrame picture; | 27 AVFrame picture; |
| 28 } avs_context_t; | 28 } AvsContext; |
| 29 | 29 |
| 30 typedef enum { | 30 typedef enum { |
| 31 AVS_VIDEO = 0x01, | 31 AVS_VIDEO = 0x01, |
| 32 AVS_AUDIO = 0x02, | 32 AVS_AUDIO = 0x02, |
| 33 AVS_PALETTE = 0x03, | 33 AVS_PALETTE = 0x03, |
| 34 AVS_GAME_DATA = 0x04, | 34 AVS_GAME_DATA = 0x04, |
| 35 } avs_block_type_t; | 35 } AvsBlockType; |
| 36 | 36 |
| 37 typedef enum { | 37 typedef enum { |
| 38 AVS_I_FRAME = 0x00, | 38 AVS_I_FRAME = 0x00, |
| 39 AVS_P_FRAME_3X3 = 0x01, | 39 AVS_P_FRAME_3X3 = 0x01, |
| 40 AVS_P_FRAME_2X2 = 0x02, | 40 AVS_P_FRAME_2X2 = 0x02, |
| 41 AVS_P_FRAME_2X3 = 0x03, | 41 AVS_P_FRAME_2X3 = 0x03, |
| 42 } avs_video_sub_type_t; | 42 } AvsVideoSubType; |
| 43 | 43 |
| 44 | 44 |
| 45 static int | 45 static int |
| 46 avs_decode_frame(AVCodecContext * avctx, | 46 avs_decode_frame(AVCodecContext * avctx, |
| 47 void *data, int *data_size, const uint8_t * buf, int buf_size) | 47 void *data, int *data_size, const uint8_t * buf, int buf_size) |
| 48 { | 48 { |
| 49 avs_context_t *const avs = avctx->priv_data; | 49 AvsContext *const avs = avctx->priv_data; |
| 50 AVFrame *picture = data; | 50 AVFrame *picture = data; |
| 51 AVFrame *const p = (AVFrame *) & avs->picture; | 51 AVFrame *const p = (AVFrame *) & avs->picture; |
| 52 const uint8_t *table, *vect; | 52 const uint8_t *table, *vect; |
| 53 uint8_t *out; | 53 uint8_t *out; |
| 54 int i, j, x, y, stride, vect_w = 3, vect_h = 3; | 54 int i, j, x, y, stride, vect_w = 3, vect_h = 3; |
| 55 int sub_type; | 55 AvsVideoSubType sub_type; |
| 56 avs_block_type_t type; | 56 AvsBlockType type; |
| 57 GetBitContext change_map; | 57 GetBitContext change_map; |
| 58 | 58 |
| 59 if (avctx->reget_buffer(avctx, p)) { | 59 if (avctx->reget_buffer(avctx, p)) { |
| 60 av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); | 60 av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n"); |
| 61 return -1; | 61 return -1; |
| 150 | 150 |
| 151 AVCodec avs_decoder = { | 151 AVCodec avs_decoder = { |
| 152 "avs", | 152 "avs", |
| 153 CODEC_TYPE_VIDEO, | 153 CODEC_TYPE_VIDEO, |
| 154 CODEC_ID_AVS, | 154 CODEC_ID_AVS, |
| 155 sizeof(avs_context_t), | 155 sizeof(AvsContext), |
| 156 avs_decode_init, | 156 avs_decode_init, |
| 157 NULL, | 157 NULL, |
| 158 NULL, | 158 NULL, |
| 159 avs_decode_frame, | 159 avs_decode_frame, |
| 160 CODEC_CAP_DR1, | 160 CODEC_CAP_DR1, |
