mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
adxenc: cosmetics: pretty-printing
This commit is contained in:
parent
25edfc88e3
commit
a85ab8ad45
@ -50,8 +50,10 @@ static void adx_encode(ADXContext *c, uint8_t *adx, const int16_t *wav,
|
||||
s0 = wav[i];
|
||||
d = ((s0 << COEFF_BITS) - c->coeff[0] * s1 - c->coeff[1] * s2) >> COEFF_BITS;
|
||||
data[i] = d;
|
||||
if (max<d) max=d;
|
||||
if (min>d) min=d;
|
||||
if (max < d)
|
||||
max = d;
|
||||
if (min > d)
|
||||
min = d;
|
||||
s2 = s1;
|
||||
s1 = s0;
|
||||
}
|
||||
@ -63,10 +65,13 @@ static void adx_encode(ADXContext *c, uint8_t *adx, const int16_t *wav,
|
||||
return;
|
||||
}
|
||||
|
||||
if (max/7>-min/8) scale = max/7;
|
||||
else scale = -min/8;
|
||||
if (max / 7 > -min / 8)
|
||||
scale = max / 7;
|
||||
else
|
||||
scale = -min / 8;
|
||||
|
||||
if (scale==0) scale=1;
|
||||
if (scale == 0)
|
||||
scale = 1;
|
||||
|
||||
AV_WB16(adx, scale);
|
||||
|
||||
@ -113,12 +118,11 @@ static av_cold int adx_encode_init(AVCodecContext *avctx)
|
||||
static av_cold int adx_encode_close(AVCodecContext *avctx)
|
||||
{
|
||||
av_freep(&avctx->coded_frame);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int adx_encode_frame(AVCodecContext *avctx,
|
||||
uint8_t *frame, int buf_size, void *data)
|
||||
static int adx_encode_frame(AVCodecContext *avctx, uint8_t *frame,
|
||||
int buf_size, void *data)
|
||||
{
|
||||
ADXContext *c = avctx->priv_data;
|
||||
const int16_t *samples = data;
|
||||
@ -166,6 +170,7 @@ AVCodec ff_adpcm_adx_encoder = {
|
||||
.init = adx_encode_init,
|
||||
.encode = adx_encode_frame,
|
||||
.close = adx_encode_close,
|
||||
.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE},
|
||||
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16,
|
||||
AV_SAMPLE_FMT_NONE },
|
||||
.long_name = NULL_IF_CONFIG_SMALL("SEGA CRI ADX ADPCM"),
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user