Mercurial > libavcodec.hg
annotate adxdec.c @ 7354:456957d86106 libavcodec
My commit at r14340 was not the right solution. For a monochromatic
frame, there will be only one centroid and it will be impossible to
find three distinct ones. It is better to just avoid shifting if
there are not three different centroids.
author | vitor |
---|---|
date | Wed, 23 Jul 2008 05:54:34 +0000 |
parents | e943e1409077 |
children | 85ab7655ad4d |
rev | line source |
---|---|
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
1 /* |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
2 * ADX ADPCM codecs |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
3 * Copyright (c) 2001,2003 BERO |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
4 * |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3445
diff
changeset
|
5 * This file is part of FFmpeg. |
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3445
diff
changeset
|
6 * |
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3445
diff
changeset
|
7 * FFmpeg is free software; you can redistribute it and/or |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
8 * modify it under the terms of the GNU Lesser General Public |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
9 * License as published by the Free Software Foundation; either |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3445
diff
changeset
|
10 * version 2.1 of the License, or (at your option) any later version. |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
11 * |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3445
diff
changeset
|
12 * FFmpeg is distributed in the hope that it will be useful, |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
15 * Lesser General Public License for more details. |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
16 * |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
17 * You should have received a copy of the GNU Lesser General Public |
3947
c8c591fe26f8
Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents:
3445
diff
changeset
|
18 * License along with FFmpeg; if not, write to the Free Software |
3036
0b546eab515d
Update licensing information: The FSF changed postal address.
diego
parents:
2967
diff
changeset
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
20 */ |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
21 #include "avcodec.h" |
5866 | 22 #include "adx.h" |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
23 |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
24 /** |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
25 * @file adx.c |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
26 * SEGA CRI adx codecs. |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
27 * |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
28 * Reference documents: |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
29 * http://ku-www.ss.titech.ac.jp/~yatsushi/adx.html |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
30 * adx2wav & wav2adx http://www.geocities.co.jp/Playtown/2004/ |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
31 */ |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
32 |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
33 /* 18 bytes <-> 32 samples */ |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
34 |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
35 static void adx_decode(short *out,const unsigned char *in,PREV *prev) |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
36 { |
5067 | 37 int scale = AV_RB16(in); |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
38 int i; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
39 int s0,s1,s2,d; |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
40 |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
41 // printf("%x ",scale); |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
42 |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
43 in+=2; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
44 s1 = prev->s1; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
45 s2 = prev->s2; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
46 for(i=0;i<16;i++) { |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
47 d = in[i]; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
48 // d>>=4; if (d&8) d-=16; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
49 d = ((signed char)d >> 4); |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
50 s0 = (BASEVOL*d*scale + SCALE1*s1 - SCALE2*s2)>>14; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
51 s2 = s1; |
5525
bc4791868c52
various simplifications around recent av_clip_int16() usage
aurel
parents:
5523
diff
changeset
|
52 s1 = av_clip_int16(s0); |
bc4791868c52
various simplifications around recent av_clip_int16() usage
aurel
parents:
5523
diff
changeset
|
53 *out++=s1; |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
54 |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
55 d = in[i]; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
56 //d&=15; if (d&8) d-=16; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
57 d = ((signed char)(d<<4) >> 4); |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
58 s0 = (BASEVOL*d*scale + SCALE1*s1 - SCALE2*s2)>>14; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
59 s2 = s1; |
5525
bc4791868c52
various simplifications around recent av_clip_int16() usage
aurel
parents:
5523
diff
changeset
|
60 s1 = av_clip_int16(s0); |
bc4791868c52
various simplifications around recent av_clip_int16() usage
aurel
parents:
5523
diff
changeset
|
61 *out++=s1; |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
62 } |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
63 prev->s1 = s1; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
64 prev->s2 = s2; |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
65 |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
66 } |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
67 |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
68 static void adx_decode_stereo(short *out,const unsigned char *in,PREV *prev) |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
69 { |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
70 short tmp[32*2]; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
71 int i; |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
72 |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
73 adx_decode(tmp ,in ,prev); |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
74 adx_decode(tmp+32,in+18,prev+1); |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
75 for(i=0;i<32;i++) { |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
76 out[i*2] = tmp[i]; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
77 out[i*2+1] = tmp[i+32]; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
78 } |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
79 } |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
80 |
5864 | 81 /* return data offset or 0 */ |
82 static int adx_decode_header(AVCodecContext *avctx,const unsigned char *buf,size_t bufsize) | |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
83 { |
5864 | 84 int offset; |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
85 |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
86 if (buf[0]!=0x80) return 0; |
5067 | 87 offset = (AV_RB32(buf)^0x80000000)+4; |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
88 if (bufsize<offset || memcmp(buf+offset-6,"(c)CRI",6)) return 0; |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
89 |
5864 | 90 avctx->channels = buf[7]; |
91 avctx->sample_rate = AV_RB32(buf+8); | |
92 avctx->bit_rate = avctx->sample_rate*avctx->channels*18*8/32; | |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
93 |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
94 return offset; |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
95 } |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
96 |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
97 static int adx_decode_frame(AVCodecContext *avctx, |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
98 void *data, int *data_size, |
6261 | 99 const uint8_t *buf0, int buf_size) |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
100 { |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
101 ADXContext *c = avctx->priv_data; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
102 short *samples = data; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
103 const uint8_t *buf = buf0; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
104 int rest = buf_size; |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
105 |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
106 if (!c->header_parsed) { |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
107 int hdrsize = adx_decode_header(avctx,buf,rest); |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
108 if (hdrsize==0) return -1; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
109 c->header_parsed = 1; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
110 buf += hdrsize; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
111 rest -= hdrsize; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
112 } |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
113 |
5704
cf77b8588f15
Do not try to decode more data than output buffer may hold
kostya
parents:
5525
diff
changeset
|
114 /* 18 bytes of data are expanded into 32*2 bytes of audio, |
cf77b8588f15
Do not try to decode more data than output buffer may hold
kostya
parents:
5525
diff
changeset
|
115 so guard against buffer overflows */ |
cf77b8588f15
Do not try to decode more data than output buffer may hold
kostya
parents:
5525
diff
changeset
|
116 if(rest/18 > *data_size/64) |
cf77b8588f15
Do not try to decode more data than output buffer may hold
kostya
parents:
5525
diff
changeset
|
117 rest = (*data_size/64) * 18; |
cf77b8588f15
Do not try to decode more data than output buffer may hold
kostya
parents:
5525
diff
changeset
|
118 |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
119 if (c->in_temp) { |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
120 int copysize = 18*avctx->channels - c->in_temp; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
121 memcpy(c->dec_temp+c->in_temp,buf,copysize); |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
122 rest -= copysize; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
123 buf += copysize; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
124 if (avctx->channels==1) { |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
125 adx_decode(samples,c->dec_temp,c->prev); |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
126 samples += 32; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
127 } else { |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
128 adx_decode_stereo(samples,c->dec_temp,c->prev); |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
129 samples += 32*2; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
130 } |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
131 } |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
132 // |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
133 if (avctx->channels==1) { |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
134 while(rest>=18) { |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
135 adx_decode(samples,buf,c->prev); |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
136 rest-=18; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
137 buf+=18; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
138 samples+=32; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
139 } |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
140 } else { |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
141 while(rest>=18*2) { |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
142 adx_decode_stereo(samples,buf,c->prev); |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
143 rest-=18*2; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
144 buf+=18*2; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
145 samples+=32*2; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
146 } |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
147 } |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
148 // |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
149 c->in_temp = rest; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
150 if (rest) { |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
151 memcpy(c->dec_temp,buf,rest); |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
152 buf+=rest; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
153 } |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
154 *data_size = (uint8_t*)samples - (uint8_t*)data; |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
155 // printf("%d:%d ",buf-buf0,*data_size); fflush(stdout); |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
156 return buf-buf0; |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
157 } |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
158 |
3445 | 159 AVCodec adpcm_adx_decoder = { |
160 "adpcm_adx", | |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
161 CODEC_TYPE_AUDIO, |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
162 CODEC_ID_ADPCM_ADX, |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
163 sizeof(ADXContext), |
5863 | 164 NULL, |
1534
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
165 NULL, |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
166 NULL, |
5bdf2017d854
replace file to remove nasty DOS CRs and hard tabs
melanson
parents:
1531
diff
changeset
|
167 adx_decode_frame, |
7040
e943e1409077
Make AVCodec long_names definition conditional depending on CONFIG_SMALL.
stefano
parents:
6710
diff
changeset
|
168 .long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX"), |
1531
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
169 }; |
a78de892cefd
added CRI ADX and XA ADPCM audio modules, courtesy of BERO
melanson
parents:
diff
changeset
|
170 |