Browse Source

AAC: MIPS: Add missing codebooks in quantize funcs

Add entries on the quantize function tables for the missing
codebooks (which all behave like ZERO)
tags/n2.8
Claudio Freire 10 years ago
parent
commit
5131ba5657
1 changed files with 59 additions and 1 deletions
  1. +59
    -1
      libavcodec/mips/aaccoder_mips.c

+ 59
- 1
libavcodec/mips/aaccoder_mips.c View File

@@ -843,12 +843,38 @@ static void quantize_and_encode_band_cost_ESC_mips(struct AACEncContext *s,
}
}

static void quantize_and_encode_band_cost_NONE_mips(struct AACEncContext *s,
PutBitContext *pb, const float *in, float *out,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits, const float ROUNDING) {
av_assert0(0);
}

static void quantize_and_encode_band_cost_ZERO_mips(struct AACEncContext *s,
PutBitContext *pb, const float *in, float *out,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits, const float ROUNDING) {
int i;
if (bits)
*bits = 0;
if (out) {
for (i = 0; i < size; i += 4) {
out[i ] = 0.0f;
out[i+1] = 0.0f;
out[i+2] = 0.0f;
out[i+3] = 0.0f;
}
}
}

static void (*const quantize_and_encode_band_cost_arr[])(struct AACEncContext *s,
PutBitContext *pb, const float *in, float *out,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits, const float ROUNDING) = {
NULL,
quantize_and_encode_band_cost_ZERO_mips,
quantize_and_encode_band_cost_SQUAD_mips,
quantize_and_encode_band_cost_SQUAD_mips,
quantize_and_encode_band_cost_UQUAD_mips,
@@ -860,6 +886,10 @@ static void (*const quantize_and_encode_band_cost_arr[])(struct AACEncContext *s
quantize_and_encode_band_cost_UPAIR12_mips,
quantize_and_encode_band_cost_UPAIR12_mips,
quantize_and_encode_band_cost_ESC_mips,
quantize_and_encode_band_cost_NONE_mips, /* cb 12 doesn't exist */
quantize_and_encode_band_cost_ZERO_mips,
quantize_and_encode_band_cost_ZERO_mips,
quantize_and_encode_band_cost_ZERO_mips,
};

#define quantize_and_encode_band_cost( \
@@ -889,6 +919,16 @@ static float get_band_numbits_ZERO_mips(struct AACEncContext *s,
return 0;
}

static float get_band_numbits_NONE_mips(struct AACEncContext *s,
PutBitContext *pb, const float *in,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits)
{
av_assert0(0);
return 0;
}

static float get_band_numbits_SQUAD_mips(struct AACEncContext *s,
PutBitContext *pb, const float *in,
const float *scaled, int size, int scale_idx,
@@ -1328,6 +1368,10 @@ static float (*const get_band_numbits_arr[])(struct AACEncContext *s,
get_band_numbits_UPAIR12_mips,
get_band_numbits_UPAIR12_mips,
get_band_numbits_ESC_mips,
get_band_numbits_NONE_mips, /* cb 12 doesn't exist */
get_band_numbits_ZERO_mips,
get_band_numbits_ZERO_mips,
get_band_numbits_ZERO_mips,
};

#define get_band_numbits( \
@@ -1369,6 +1413,16 @@ static float get_band_cost_ZERO_mips(struct AACEncContext *s,
return cost * lambda;
}

static float get_band_cost_NONE_mips(struct AACEncContext *s,
PutBitContext *pb, const float *in,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits)
{
av_assert0(0);
return 0;
}

static float get_band_cost_SQUAD_mips(struct AACEncContext *s,
PutBitContext *pb, const float *in,
const float *scaled, int size, int scale_idx,
@@ -2119,6 +2173,10 @@ static float (*const get_band_cost_arr[])(struct AACEncContext *s,
get_band_cost_UPAIR12_mips,
get_band_cost_UPAIR12_mips,
get_band_cost_ESC_mips,
get_band_cost_NONE_mips, /* cb 12 doesn't exist */
get_band_cost_ZERO_mips,
get_band_cost_ZERO_mips,
get_band_cost_ZERO_mips,
};

#define get_band_cost( \


Loading…
Cancel
Save