History

avcodec/adpcm_{psx,argo}: add missing indent

Zane van Iperen committed 6 years ago

Commit bb021be1 parent 9eabe9c1 file · +43 −43Browse files

Unified · Split

libavcodec/adpcm.c+43−43
@@ -1966,42 +1966,42 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, · 1965 unmodified lines
19661966 case AV_CODEC_ID_ADPCM_PSX:
19671967 for (int block = 0; block < avpkt->size / FFMAX(avctx->block_align, 16 * avctx->channels); block++) {
19681968 int nb_samples_per_block = 28 * FFMAX(avctx->block_align, 16 * avctx->channels) / (16 * avctx->channels);
1969− for (channel = 0; channel < avctx->channels; channel++) {
1970− samples = samples_p[channel] + block * nb_samples_per_block;
1971−
1972− /* Read in every sample for this channel. */
1973− for (i = 0; i < nb_samples_per_block / 28; i++) {
1974− int filter, shift, flag, byte;
1975−
1976− filter = bytestream2_get_byteu(&gb);
1977− shift = filter & 0xf;
1978− filter = filter >> 4;
1979− if (filter >= FF_ARRAY_ELEMS(xa_adpcm_table))
1980− return AVERROR_INVALIDDATA;
1981− flag = bytestream2_get_byteu(&gb);
1982−
1983− /* Decode 28 samples. */
1984− for (n = 0; n < 28; n++) {
1985− int sample = 0, scale;
1986−
1987− if (flag < 0x07) {
1988− if (n & 1) {
1989− scale = sign_extend(byte >> 4, 4);
1990− } else {
1991− byte = bytestream2_get_byteu(&gb);
1992− scale = sign_extend(byte, 4);
1969+ for (channel = 0; channel < avctx->channels; channel++) {
1970+ samples = samples_p[channel] + block * nb_samples_per_block;
1971+
1972+ /* Read in every sample for this channel. */
1973+ for (i = 0; i < nb_samples_per_block / 28; i++) {
1974+ int filter, shift, flag, byte;
1975+
1976+ filter = bytestream2_get_byteu(&gb);
1977+ shift = filter & 0xf;
1978+ filter = filter >> 4;
1979+ if (filter >= FF_ARRAY_ELEMS(xa_adpcm_table))
1980+ return AVERROR_INVALIDDATA;
1981+ flag = bytestream2_get_byteu(&gb);
1982+
1983+ /* Decode 28 samples. */
1984+ for (n = 0; n < 28; n++) {
1985+ int sample = 0, scale;
1986+
1987+ if (flag < 0x07) {
1988+ if (n & 1) {
1989+ scale = sign_extend(byte >> 4, 4);
1990+ } else {
1991+ byte = bytestream2_get_byteu(&gb);
1992+ scale = sign_extend(byte, 4);
1993+ }
1994+
1995+ scale = scale * (1 << 12);
1996+ sample = (int)((scale >> shift) + (c->status[channel].sample1 * xa_adpcm_table[filter][0] + c->status[channel].sample2 * xa_adpcm_table[filter][1]) / 64);
19931997 }
1994−
1995− scale = scale * (1 << 12);
1996− sample = (int)((scale >> shift) + (c->status[channel].sample1 * xa_adpcm_table[filter][0] + c->status[channel].sample2 * xa_adpcm_table[filter][1]) / 64);
1998+ *samples++ = av_clip_int16(sample);
1999+ c->status[channel].sample2 = c->status[channel].sample1;
2000+ c->status[channel].sample1 = sample;
19972001 }
1998− *samples++ = av_clip_int16(sample);
1999− c->status[channel].sample2 = c->status[channel].sample1;
2000− c->status[channel].sample1 = sample;
20012002 }
20022003 }
20032004 }
2004− }
20052005 break;
20062006 case AV_CODEC_ID_ADPCM_ARGO:
20072007 /*
@@ -2022,23 +2022,23 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, · 14 unmodified lines
20222022 * They should be 0 initially.
20232023 */
20242024 for (int block = 0; block < avpkt->size / avctx->block_align; block++) {
2025− for (channel = 0; channel < avctx->channels; channel++) {
2026− int control, shift;
2025+ for (channel = 0; channel < avctx->channels; channel++) {
2026+ int control, shift;
20272027
2028− samples = samples_p[channel] + block * 32;
2029− cs = c->status + channel;
2028+ samples = samples_p[channel] + block * 32;
2029+ cs = c->status + channel;
20302030
2031− /* Get the control byte and decode the samples, 2 at a time. */
2032− control = bytestream2_get_byteu(&gb);
2033− shift = (control >> 4) + 2;
2031+ /* Get the control byte and decode the samples, 2 at a time. */
2032+ control = bytestream2_get_byteu(&gb);
2033+ shift = (control >> 4) + 2;
20342034
2035− for (n = 0; n < 16; n++) {
2036− int sample = bytestream2_get_byteu(&gb);
2037− *samples++ = ff_adpcm_argo_expand_nibble(cs, sample >> 4, shift, control & 0x04);
2038− *samples++ = ff_adpcm_argo_expand_nibble(cs, sample >> 0, shift, control & 0x04);
2035+ for (n = 0; n < 16; n++) {
2036+ int sample = bytestream2_get_byteu(&gb);
2037+ *samples++ = ff_adpcm_argo_expand_nibble(cs, sample >> 4, shift, control & 0x04);
2038+ *samples++ = ff_adpcm_argo_expand_nibble(cs, sample >> 0, shift, control & 0x04);
2039+ }
20392040 }
20402041 }
2041− }
20422042 break;
20432043 case AV_CODEC_ID_ADPCM_ZORK:
20442044 if (!c->has_status) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t