Mercurial > libavcodec.hg
comparison roqaudioenc.c @ 8295:d4f9b58f6425 libavcodec
Rename ROQDPCMContext_t to ROQDPCMContext to avoid _t reserved prefix.
author | vitor |
---|---|
date | Thu, 11 Dec 2008 19:27:53 +0000 |
parents | 85ab7655ad4d |
children | 043574c5c153 |
comparison
equal
deleted
inserted
replaced
8294:f92b595af7eb | 8295:d4f9b58f6425 |
---|---|
33 | 33 |
34 | 34 |
35 typedef struct | 35 typedef struct |
36 { | 36 { |
37 short lastSample[2]; | 37 short lastSample[2]; |
38 } ROQDPCMContext_t; | 38 } ROQDPCMContext; |
39 | 39 |
40 static av_cold void roq_dpcm_table_init(void) | 40 static av_cold void roq_dpcm_table_init(void) |
41 { | 41 { |
42 int i; | 42 int i; |
43 | 43 |
49 } | 49 } |
50 } | 50 } |
51 | 51 |
52 static int roq_dpcm_encode_init(AVCodecContext *avctx) | 52 static int roq_dpcm_encode_init(AVCodecContext *avctx) |
53 { | 53 { |
54 ROQDPCMContext_t *context = avctx->priv_data; | 54 ROQDPCMContext *context = avctx->priv_data; |
55 | 55 |
56 if (avctx->channels > 2) { | 56 if (avctx->channels > 2) { |
57 av_log(avctx, AV_LOG_ERROR, "Audio must be mono or stereo\n"); | 57 av_log(avctx, AV_LOG_ERROR, "Audio must be mono or stereo\n"); |
58 return -1; | 58 return -1; |
59 } | 59 } |
121 { | 121 { |
122 int i, samples, stereo, ch; | 122 int i, samples, stereo, ch; |
123 short *in; | 123 short *in; |
124 unsigned char *out; | 124 unsigned char *out; |
125 | 125 |
126 ROQDPCMContext_t *context = avctx->priv_data; | 126 ROQDPCMContext *context = avctx->priv_data; |
127 | 127 |
128 stereo = (avctx->channels == 2); | 128 stereo = (avctx->channels == 2); |
129 | 129 |
130 if (stereo) { | 130 if (stereo) { |
131 context->lastSample[0] &= 0xFF00; | 131 context->lastSample[0] &= 0xFF00; |
167 | 167 |
168 AVCodec roq_dpcm_encoder = { | 168 AVCodec roq_dpcm_encoder = { |
169 "roq_dpcm", | 169 "roq_dpcm", |
170 CODEC_TYPE_AUDIO, | 170 CODEC_TYPE_AUDIO, |
171 CODEC_ID_ROQ_DPCM, | 171 CODEC_ID_ROQ_DPCM, |
172 sizeof(ROQDPCMContext_t), | 172 sizeof(ROQDPCMContext), |
173 roq_dpcm_encode_init, | 173 roq_dpcm_encode_init, |
174 roq_dpcm_encode_frame, | 174 roq_dpcm_encode_frame, |
175 roq_dpcm_encode_close, | 175 roq_dpcm_encode_close, |
176 NULL, | 176 NULL, |
177 .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, | 177 .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE}, |