00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <stdint.h>
00023 #include "libavutil/common.h"
00024 #include "libavutil/mathematics.h"
00025 #include "avcodec.h"
00026 #include "get_bits.h"
00027 #include "aacps.h"
00028 #include "aacps_tablegen.h"
00029 #include "aacpsdata.c"
00030
00031 #define PS_BASELINE 0
00032
00033
00034
00035 #define numQMFSlots 32 //numTimeSlots * RATE
00036
00037 static const int8_t num_env_tab[2][4] = {
00038 { 0, 1, 2, 4, },
00039 { 1, 2, 3, 4, },
00040 };
00041
00042 static const int8_t nr_iidicc_par_tab[] = {
00043 10, 20, 34, 10, 20, 34,
00044 };
00045
00046 static const int8_t nr_iidopd_par_tab[] = {
00047 5, 11, 17, 5, 11, 17,
00048 };
00049
00050 enum {
00051 huff_iid_df1,
00052 huff_iid_dt1,
00053 huff_iid_df0,
00054 huff_iid_dt0,
00055 huff_icc_df,
00056 huff_icc_dt,
00057 huff_ipd_df,
00058 huff_ipd_dt,
00059 huff_opd_df,
00060 huff_opd_dt,
00061 };
00062
00063 static const int huff_iid[] = {
00064 huff_iid_df0,
00065 huff_iid_df1,
00066 huff_iid_dt0,
00067 huff_iid_dt1,
00068 };
00069
00070 static VLC vlc_ps[10];
00071
00072 #define READ_PAR_DATA(PAR, OFFSET, MASK, ERR_CONDITION) \
00073 \
00085 static int read_ ## PAR ## _data(AVCodecContext *avctx, GetBitContext *gb, PSContext *ps, \
00086 int8_t (*PAR)[PS_MAX_NR_IIDICC], int table_idx, int e, int dt) \
00087 { \
00088 int b, num = ps->nr_ ## PAR ## _par; \
00089 VLC_TYPE (*vlc_table)[2] = vlc_ps[table_idx].table; \
00090 if (dt) { \
00091 int e_prev = e ? e - 1 : ps->num_env_old - 1; \
00092 e_prev = FFMAX(e_prev, 0); \
00093 for (b = 0; b < num; b++) { \
00094 int val = PAR[e_prev][b] + get_vlc2(gb, vlc_table, 9, 3) - OFFSET; \
00095 if (MASK) val &= MASK; \
00096 PAR[e][b] = val; \
00097 if (ERR_CONDITION) \
00098 goto err; \
00099 } \
00100 } else { \
00101 int val = 0; \
00102 for (b = 0; b < num; b++) { \
00103 val += get_vlc2(gb, vlc_table, 9, 3) - OFFSET; \
00104 if (MASK) val &= MASK; \
00105 PAR[e][b] = val; \
00106 if (ERR_CONDITION) \
00107 goto err; \
00108 } \
00109 } \
00110 return 0; \
00111 err: \
00112 av_log(avctx, AV_LOG_ERROR, "illegal "#PAR"\n"); \
00113 return -1; \
00114 }
00115
00116 READ_PAR_DATA(iid, huff_offset[table_idx], 0, FFABS(ps->iid_par[e][b]) > 7 + 8 * ps->iid_quant)
00117 READ_PAR_DATA(icc, huff_offset[table_idx], 0, ps->icc_par[e][b] > 7U)
00118 READ_PAR_DATA(ipdopd, 0, 0x07, 0)
00119
00120 static int ps_read_extension_data(GetBitContext *gb, PSContext *ps, int ps_extension_id)
00121 {
00122 int e;
00123 int count = get_bits_count(gb);
00124
00125 if (ps_extension_id)
00126 return 0;
00127
00128 ps->enable_ipdopd = get_bits1(gb);
00129 if (ps->enable_ipdopd) {
00130 for (e = 0; e < ps->num_env; e++) {
00131 int dt = get_bits1(gb);
00132 read_ipdopd_data(NULL, gb, ps, ps->ipd_par, dt ? huff_ipd_dt : huff_ipd_df, e, dt);
00133 dt = get_bits1(gb);
00134 read_ipdopd_data(NULL, gb, ps, ps->opd_par, dt ? huff_opd_dt : huff_opd_df, e, dt);
00135 }
00136 }
00137 skip_bits1(gb);
00138 return get_bits_count(gb) - count;
00139 }
00140
00141 static void ipdopd_reset(int8_t *opd_hist, int8_t *ipd_hist)
00142 {
00143 int i;
00144 for (i = 0; i < PS_MAX_NR_IPDOPD; i++) {
00145 opd_hist[i] = 0;
00146 ipd_hist[i] = 0;
00147 }
00148 }
00149
00150 int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host, PSContext *ps, int bits_left)
00151 {
00152 int e;
00153 int bit_count_start = get_bits_count(gb_host);
00154 int header;
00155 int bits_consumed;
00156 GetBitContext gbc = *gb_host, *gb = &gbc;
00157
00158 header = get_bits1(gb);
00159 if (header) {
00160 ps->enable_iid = get_bits1(gb);
00161 if (ps->enable_iid) {
00162 int iid_mode = get_bits(gb, 3);
00163 if (iid_mode > 5) {
00164 av_log(avctx, AV_LOG_ERROR, "iid_mode %d is reserved.\n",
00165 iid_mode);
00166 goto err;
00167 }
00168 ps->nr_iid_par = nr_iidicc_par_tab[iid_mode];
00169 ps->iid_quant = iid_mode > 2;
00170 ps->nr_ipdopd_par = nr_iidopd_par_tab[iid_mode];
00171 }
00172 ps->enable_icc = get_bits1(gb);
00173 if (ps->enable_icc) {
00174 ps->icc_mode = get_bits(gb, 3);
00175 if (ps->icc_mode > 5) {
00176 av_log(avctx, AV_LOG_ERROR, "icc_mode %d is reserved.\n",
00177 ps->icc_mode);
00178 goto err;
00179 }
00180 ps->nr_icc_par = nr_iidicc_par_tab[ps->icc_mode];
00181 }
00182 ps->enable_ext = get_bits1(gb);
00183 }
00184
00185 ps->frame_class = get_bits1(gb);
00186 ps->num_env_old = ps->num_env;
00187 ps->num_env = num_env_tab[ps->frame_class][get_bits(gb, 2)];
00188
00189 ps->border_position[0] = -1;
00190 if (ps->frame_class) {
00191 for (e = 1; e <= ps->num_env; e++)
00192 ps->border_position[e] = get_bits(gb, 5);
00193 } else
00194 for (e = 1; e <= ps->num_env; e++)
00195 ps->border_position[e] = (e * numQMFSlots >> ff_log2_tab[ps->num_env]) - 1;
00196
00197 if (ps->enable_iid) {
00198 for (e = 0; e < ps->num_env; e++) {
00199 int dt = get_bits1(gb);
00200 if (read_iid_data(avctx, gb, ps, ps->iid_par, huff_iid[2*dt+ps->iid_quant], e, dt))
00201 goto err;
00202 }
00203 } else
00204 memset(ps->iid_par, 0, sizeof(ps->iid_par));
00205
00206 if (ps->enable_icc)
00207 for (e = 0; e < ps->num_env; e++) {
00208 int dt = get_bits1(gb);
00209 if (read_icc_data(avctx, gb, ps, ps->icc_par, dt ? huff_icc_dt : huff_icc_df, e, dt))
00210 goto err;
00211 }
00212 else
00213 memset(ps->icc_par, 0, sizeof(ps->icc_par));
00214
00215 if (ps->enable_ext) {
00216 int cnt = get_bits(gb, 4);
00217 if (cnt == 15) {
00218 cnt += get_bits(gb, 8);
00219 }
00220 cnt *= 8;
00221 while (cnt > 7) {
00222 int ps_extension_id = get_bits(gb, 2);
00223 cnt -= 2 + ps_read_extension_data(gb, ps, ps_extension_id);
00224 }
00225 if (cnt < 0) {
00226 av_log(avctx, AV_LOG_ERROR, "ps extension overflow %d\n", cnt);
00227 goto err;
00228 }
00229 skip_bits(gb, cnt);
00230 }
00231
00232 ps->enable_ipdopd &= !PS_BASELINE;
00233
00234
00235 if (!ps->num_env || ps->border_position[ps->num_env] < numQMFSlots - 1) {
00236
00237 int source = ps->num_env ? ps->num_env - 1 : ps->num_env_old - 1;
00238 if (source >= 0 && source != ps->num_env) {
00239 if (ps->enable_iid) {
00240 memcpy(ps->iid_par+ps->num_env, ps->iid_par+source, sizeof(ps->iid_par[0]));
00241 }
00242 if (ps->enable_icc) {
00243 memcpy(ps->icc_par+ps->num_env, ps->icc_par+source, sizeof(ps->icc_par[0]));
00244 }
00245 if (ps->enable_ipdopd) {
00246 memcpy(ps->ipd_par+ps->num_env, ps->ipd_par+source, sizeof(ps->ipd_par[0]));
00247 memcpy(ps->opd_par+ps->num_env, ps->opd_par+source, sizeof(ps->opd_par[0]));
00248 }
00249 }
00250 ps->num_env++;
00251 ps->border_position[ps->num_env] = numQMFSlots - 1;
00252 }
00253
00254
00255 ps->is34bands_old = ps->is34bands;
00256 if (!PS_BASELINE && (ps->enable_iid || ps->enable_icc))
00257 ps->is34bands = (ps->enable_iid && ps->nr_iid_par == 34) ||
00258 (ps->enable_icc && ps->nr_icc_par == 34);
00259
00260
00261 if (!ps->enable_ipdopd) {
00262 memset(ps->ipd_par, 0, sizeof(ps->ipd_par));
00263 memset(ps->opd_par, 0, sizeof(ps->opd_par));
00264 }
00265
00266 if (header)
00267 ps->start = 1;
00268
00269 bits_consumed = get_bits_count(gb) - bit_count_start;
00270 if (bits_consumed <= bits_left) {
00271 skip_bits_long(gb_host, bits_consumed);
00272 return bits_consumed;
00273 }
00274 av_log(avctx, AV_LOG_ERROR, "Expected to read %d PS bits actually read %d.\n", bits_left, bits_consumed);
00275 err:
00276 ps->start = 0;
00277 skip_bits_long(gb_host, bits_left);
00278 memset(ps->iid_par, 0, sizeof(ps->iid_par));
00279 memset(ps->icc_par, 0, sizeof(ps->icc_par));
00280 memset(ps->ipd_par, 0, sizeof(ps->ipd_par));
00281 memset(ps->opd_par, 0, sizeof(ps->opd_par));
00282 return bits_left;
00283 }
00284
00287 static void hybrid2_re(float (*in)[2], float (*out)[32][2], const float filter[7], int len, int reverse)
00288 {
00289 int i, j;
00290 for (i = 0; i < len; i++, in++) {
00291 float re_in = filter[6] * in[6][0];
00292 float re_op = 0.0f;
00293 float im_in = filter[6] * in[6][1];
00294 float im_op = 0.0f;
00295 for (j = 0; j < 6; j += 2) {
00296 re_op += filter[j+1] * (in[j+1][0] + in[12-j-1][0]);
00297 im_op += filter[j+1] * (in[j+1][1] + in[12-j-1][1]);
00298 }
00299 out[ reverse][i][0] = re_in + re_op;
00300 out[ reverse][i][1] = im_in + im_op;
00301 out[!reverse][i][0] = re_in - re_op;
00302 out[!reverse][i][1] = im_in - im_op;
00303 }
00304 }
00305
00307 static void hybrid6_cx(float (*in)[2], float (*out)[32][2], const float (*filter)[7][2], int len)
00308 {
00309 int i, j, ssb;
00310 int N = 8;
00311 float temp[8][2];
00312
00313 for (i = 0; i < len; i++, in++) {
00314 for (ssb = 0; ssb < N; ssb++) {
00315 float sum_re = filter[ssb][6][0] * in[6][0], sum_im = filter[ssb][6][0] * in[6][1];
00316 for (j = 0; j < 6; j++) {
00317 float in0_re = in[j][0];
00318 float in0_im = in[j][1];
00319 float in1_re = in[12-j][0];
00320 float in1_im = in[12-j][1];
00321 sum_re += filter[ssb][j][0] * (in0_re + in1_re) - filter[ssb][j][1] * (in0_im - in1_im);
00322 sum_im += filter[ssb][j][0] * (in0_im + in1_im) + filter[ssb][j][1] * (in0_re - in1_re);
00323 }
00324 temp[ssb][0] = sum_re;
00325 temp[ssb][1] = sum_im;
00326 }
00327 out[0][i][0] = temp[6][0];
00328 out[0][i][1] = temp[6][1];
00329 out[1][i][0] = temp[7][0];
00330 out[1][i][1] = temp[7][1];
00331 out[2][i][0] = temp[0][0];
00332 out[2][i][1] = temp[0][1];
00333 out[3][i][0] = temp[1][0];
00334 out[3][i][1] = temp[1][1];
00335 out[4][i][0] = temp[2][0] + temp[5][0];
00336 out[4][i][1] = temp[2][1] + temp[5][1];
00337 out[5][i][0] = temp[3][0] + temp[4][0];
00338 out[5][i][1] = temp[3][1] + temp[4][1];
00339 }
00340 }
00341
00342 static void hybrid4_8_12_cx(float (*in)[2], float (*out)[32][2], const float (*filter)[7][2], int N, int len)
00343 {
00344 int i, j, ssb;
00345
00346 for (i = 0; i < len; i++, in++) {
00347 for (ssb = 0; ssb < N; ssb++) {
00348 float sum_re = filter[ssb][6][0] * in[6][0], sum_im = filter[ssb][6][0] * in[6][1];
00349 for (j = 0; j < 6; j++) {
00350 float in0_re = in[j][0];
00351 float in0_im = in[j][1];
00352 float in1_re = in[12-j][0];
00353 float in1_im = in[12-j][1];
00354 sum_re += filter[ssb][j][0] * (in0_re + in1_re) - filter[ssb][j][1] * (in0_im - in1_im);
00355 sum_im += filter[ssb][j][0] * (in0_im + in1_im) + filter[ssb][j][1] * (in0_re - in1_re);
00356 }
00357 out[ssb][i][0] = sum_re;
00358 out[ssb][i][1] = sum_im;
00359 }
00360 }
00361 }
00362
00363 static void hybrid_analysis(float out[91][32][2], float in[5][44][2], float L[2][38][64], int is34, int len)
00364 {
00365 int i, j;
00366 for (i = 0; i < 5; i++) {
00367 for (j = 0; j < 38; j++) {
00368 in[i][j+6][0] = L[0][j][i];
00369 in[i][j+6][1] = L[1][j][i];
00370 }
00371 }
00372 if (is34) {
00373 hybrid4_8_12_cx(in[0], out, f34_0_12, 12, len);
00374 hybrid4_8_12_cx(in[1], out+12, f34_1_8, 8, len);
00375 hybrid4_8_12_cx(in[2], out+20, f34_2_4, 4, len);
00376 hybrid4_8_12_cx(in[3], out+24, f34_2_4, 4, len);
00377 hybrid4_8_12_cx(in[4], out+28, f34_2_4, 4, len);
00378 for (i = 0; i < 59; i++) {
00379 for (j = 0; j < len; j++) {
00380 out[i+32][j][0] = L[0][j][i+5];
00381 out[i+32][j][1] = L[1][j][i+5];
00382 }
00383 }
00384 } else {
00385 hybrid6_cx(in[0], out, f20_0_8, len);
00386 hybrid2_re(in[1], out+6, g1_Q2, len, 1);
00387 hybrid2_re(in[2], out+8, g1_Q2, len, 0);
00388 for (i = 0; i < 61; i++) {
00389 for (j = 0; j < len; j++) {
00390 out[i+10][j][0] = L[0][j][i+3];
00391 out[i+10][j][1] = L[1][j][i+3];
00392 }
00393 }
00394 }
00395
00396 for (i = 0; i < 5; i++) {
00397 memcpy(in[i], in[i]+32, 6 * sizeof(in[i][0]));
00398 }
00399 }
00400
00401 static void hybrid_synthesis(float out[2][38][64], float in[91][32][2], int is34, int len)
00402 {
00403 int i, n;
00404 if (is34) {
00405 for (n = 0; n < len; n++) {
00406 memset(out[0][n], 0, 5*sizeof(out[0][n][0]));
00407 memset(out[1][n], 0, 5*sizeof(out[1][n][0]));
00408 for (i = 0; i < 12; i++) {
00409 out[0][n][0] += in[ i][n][0];
00410 out[1][n][0] += in[ i][n][1];
00411 }
00412 for (i = 0; i < 8; i++) {
00413 out[0][n][1] += in[12+i][n][0];
00414 out[1][n][1] += in[12+i][n][1];
00415 }
00416 for (i = 0; i < 4; i++) {
00417 out[0][n][2] += in[20+i][n][0];
00418 out[1][n][2] += in[20+i][n][1];
00419 out[0][n][3] += in[24+i][n][0];
00420 out[1][n][3] += in[24+i][n][1];
00421 out[0][n][4] += in[28+i][n][0];
00422 out[1][n][4] += in[28+i][n][1];
00423 }
00424 }
00425 for (i = 0; i < 59; i++) {
00426 for (n = 0; n < len; n++) {
00427 out[0][n][i+5] = in[i+32][n][0];
00428 out[1][n][i+5] = in[i+32][n][1];
00429 }
00430 }
00431 } else {
00432 for (n = 0; n < len; n++) {
00433 out[0][n][0] = in[0][n][0] + in[1][n][0] + in[2][n][0] +
00434 in[3][n][0] + in[4][n][0] + in[5][n][0];
00435 out[1][n][0] = in[0][n][1] + in[1][n][1] + in[2][n][1] +
00436 in[3][n][1] + in[4][n][1] + in[5][n][1];
00437 out[0][n][1] = in[6][n][0] + in[7][n][0];
00438 out[1][n][1] = in[6][n][1] + in[7][n][1];
00439 out[0][n][2] = in[8][n][0] + in[9][n][0];
00440 out[1][n][2] = in[8][n][1] + in[9][n][1];
00441 }
00442 for (i = 0; i < 61; i++) {
00443 for (n = 0; n < len; n++) {
00444 out[0][n][i+3] = in[i+10][n][0];
00445 out[1][n][i+3] = in[i+10][n][1];
00446 }
00447 }
00448 }
00449 }
00450
00452 #define DECAY_SLOPE 0.05f
00454 static const int NR_PAR_BANDS[] = { 20, 34 };
00456 static const int NR_BANDS[] = { 71, 91 };
00458 static const int DECAY_CUTOFF[] = { 10, 32 };
00460 static const int NR_ALLPASS_BANDS[] = { 30, 50 };
00462 static const int SHORT_DELAY_BAND[] = { 42, 62 };
00463
00465 static void map_idx_10_to_20(int8_t *par_mapped, const int8_t *par, int full)
00466 {
00467 int b;
00468 if (full)
00469 b = 9;
00470 else {
00471 b = 4;
00472 par_mapped[10] = 0;
00473 }
00474 for (; b >= 0; b--) {
00475 par_mapped[2*b+1] = par_mapped[2*b] = par[b];
00476 }
00477 }
00478
00479 static void map_idx_34_to_20(int8_t *par_mapped, const int8_t *par, int full)
00480 {
00481 par_mapped[ 0] = (2*par[ 0] + par[ 1]) / 3;
00482 par_mapped[ 1] = ( par[ 1] + 2*par[ 2]) / 3;
00483 par_mapped[ 2] = (2*par[ 3] + par[ 4]) / 3;
00484 par_mapped[ 3] = ( par[ 4] + 2*par[ 5]) / 3;
00485 par_mapped[ 4] = ( par[ 6] + par[ 7]) / 2;
00486 par_mapped[ 5] = ( par[ 8] + par[ 9]) / 2;
00487 par_mapped[ 6] = par[10];
00488 par_mapped[ 7] = par[11];
00489 par_mapped[ 8] = ( par[12] + par[13]) / 2;
00490 par_mapped[ 9] = ( par[14] + par[15]) / 2;
00491 par_mapped[10] = par[16];
00492 if (full) {
00493 par_mapped[11] = par[17];
00494 par_mapped[12] = par[18];
00495 par_mapped[13] = par[19];
00496 par_mapped[14] = ( par[20] + par[21]) / 2;
00497 par_mapped[15] = ( par[22] + par[23]) / 2;
00498 par_mapped[16] = ( par[24] + par[25]) / 2;
00499 par_mapped[17] = ( par[26] + par[27]) / 2;
00500 par_mapped[18] = ( par[28] + par[29] + par[30] + par[31]) / 4;
00501 par_mapped[19] = ( par[32] + par[33]) / 2;
00502 }
00503 }
00504
00505 static void map_val_34_to_20(float par[PS_MAX_NR_IIDICC])
00506 {
00507 par[ 0] = (2*par[ 0] + par[ 1]) * 0.33333333f;
00508 par[ 1] = ( par[ 1] + 2*par[ 2]) * 0.33333333f;
00509 par[ 2] = (2*par[ 3] + par[ 4]) * 0.33333333f;
00510 par[ 3] = ( par[ 4] + 2*par[ 5]) * 0.33333333f;
00511 par[ 4] = ( par[ 6] + par[ 7]) * 0.5f;
00512 par[ 5] = ( par[ 8] + par[ 9]) * 0.5f;
00513 par[ 6] = par[10];
00514 par[ 7] = par[11];
00515 par[ 8] = ( par[12] + par[13]) * 0.5f;
00516 par[ 9] = ( par[14] + par[15]) * 0.5f;
00517 par[10] = par[16];
00518 par[11] = par[17];
00519 par[12] = par[18];
00520 par[13] = par[19];
00521 par[14] = ( par[20] + par[21]) * 0.5f;
00522 par[15] = ( par[22] + par[23]) * 0.5f;
00523 par[16] = ( par[24] + par[25]) * 0.5f;
00524 par[17] = ( par[26] + par[27]) * 0.5f;
00525 par[18] = ( par[28] + par[29] + par[30] + par[31]) * 0.25f;
00526 par[19] = ( par[32] + par[33]) * 0.5f;
00527 }
00528
00529 static void map_idx_10_to_34(int8_t *par_mapped, const int8_t *par, int full)
00530 {
00531 if (full) {
00532 par_mapped[33] = par[9];
00533 par_mapped[32] = par[9];
00534 par_mapped[31] = par[9];
00535 par_mapped[30] = par[9];
00536 par_mapped[29] = par[9];
00537 par_mapped[28] = par[9];
00538 par_mapped[27] = par[8];
00539 par_mapped[26] = par[8];
00540 par_mapped[25] = par[8];
00541 par_mapped[24] = par[8];
00542 par_mapped[23] = par[7];
00543 par_mapped[22] = par[7];
00544 par_mapped[21] = par[7];
00545 par_mapped[20] = par[7];
00546 par_mapped[19] = par[6];
00547 par_mapped[18] = par[6];
00548 par_mapped[17] = par[5];
00549 par_mapped[16] = par[5];
00550 } else {
00551 par_mapped[16] = 0;
00552 }
00553 par_mapped[15] = par[4];
00554 par_mapped[14] = par[4];
00555 par_mapped[13] = par[4];
00556 par_mapped[12] = par[4];
00557 par_mapped[11] = par[3];
00558 par_mapped[10] = par[3];
00559 par_mapped[ 9] = par[2];
00560 par_mapped[ 8] = par[2];
00561 par_mapped[ 7] = par[2];
00562 par_mapped[ 6] = par[2];
00563 par_mapped[ 5] = par[1];
00564 par_mapped[ 4] = par[1];
00565 par_mapped[ 3] = par[1];
00566 par_mapped[ 2] = par[0];
00567 par_mapped[ 1] = par[0];
00568 par_mapped[ 0] = par[0];
00569 }
00570
00571 static void map_idx_20_to_34(int8_t *par_mapped, const int8_t *par, int full)
00572 {
00573 if (full) {
00574 par_mapped[33] = par[19];
00575 par_mapped[32] = par[19];
00576 par_mapped[31] = par[18];
00577 par_mapped[30] = par[18];
00578 par_mapped[29] = par[18];
00579 par_mapped[28] = par[18];
00580 par_mapped[27] = par[17];
00581 par_mapped[26] = par[17];
00582 par_mapped[25] = par[16];
00583 par_mapped[24] = par[16];
00584 par_mapped[23] = par[15];
00585 par_mapped[22] = par[15];
00586 par_mapped[21] = par[14];
00587 par_mapped[20] = par[14];
00588 par_mapped[19] = par[13];
00589 par_mapped[18] = par[12];
00590 par_mapped[17] = par[11];
00591 }
00592 par_mapped[16] = par[10];
00593 par_mapped[15] = par[ 9];
00594 par_mapped[14] = par[ 9];
00595 par_mapped[13] = par[ 8];
00596 par_mapped[12] = par[ 8];
00597 par_mapped[11] = par[ 7];
00598 par_mapped[10] = par[ 6];
00599 par_mapped[ 9] = par[ 5];
00600 par_mapped[ 8] = par[ 5];
00601 par_mapped[ 7] = par[ 4];
00602 par_mapped[ 6] = par[ 4];
00603 par_mapped[ 5] = par[ 3];
00604 par_mapped[ 4] = (par[ 2] + par[ 3]) / 2;
00605 par_mapped[ 3] = par[ 2];
00606 par_mapped[ 2] = par[ 1];
00607 par_mapped[ 1] = (par[ 0] + par[ 1]) / 2;
00608 par_mapped[ 0] = par[ 0];
00609 }
00610
00611 static void map_val_20_to_34(float par[PS_MAX_NR_IIDICC])
00612 {
00613 par[33] = par[19];
00614 par[32] = par[19];
00615 par[31] = par[18];
00616 par[30] = par[18];
00617 par[29] = par[18];
00618 par[28] = par[18];
00619 par[27] = par[17];
00620 par[26] = par[17];
00621 par[25] = par[16];
00622 par[24] = par[16];
00623 par[23] = par[15];
00624 par[22] = par[15];
00625 par[21] = par[14];
00626 par[20] = par[14];
00627 par[19] = par[13];
00628 par[18] = par[12];
00629 par[17] = par[11];
00630 par[16] = par[10];
00631 par[15] = par[ 9];
00632 par[14] = par[ 9];
00633 par[13] = par[ 8];
00634 par[12] = par[ 8];
00635 par[11] = par[ 7];
00636 par[10] = par[ 6];
00637 par[ 9] = par[ 5];
00638 par[ 8] = par[ 5];
00639 par[ 7] = par[ 4];
00640 par[ 6] = par[ 4];
00641 par[ 5] = par[ 3];
00642 par[ 4] = (par[ 2] + par[ 3]) * 0.5f;
00643 par[ 3] = par[ 2];
00644 par[ 2] = par[ 1];
00645 par[ 1] = (par[ 0] + par[ 1]) * 0.5f;
00646 par[ 0] = par[ 0];
00647 }
00648
00649 static void decorrelation(PSContext *ps, float (*out)[32][2], const float (*s)[32][2], int is34)
00650 {
00651 float power[34][PS_QMF_TIME_SLOTS] = {{0}};
00652 float transient_gain[34][PS_QMF_TIME_SLOTS];
00653 float *peak_decay_nrg = ps->peak_decay_nrg;
00654 float *power_smooth = ps->power_smooth;
00655 float *peak_decay_diff_smooth = ps->peak_decay_diff_smooth;
00656 float (*delay)[PS_QMF_TIME_SLOTS + PS_MAX_DELAY][2] = ps->delay;
00657 float (*ap_delay)[PS_AP_LINKS][PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2] = ps->ap_delay;
00658 const int8_t *k_to_i = is34 ? k_to_i_34 : k_to_i_20;
00659 const float peak_decay_factor = 0.76592833836465f;
00660 const float transient_impact = 1.5f;
00661 const float a_smooth = 0.25f;
00662 int i, k, m, n;
00663 int n0 = 0, nL = 32;
00664 static const int link_delay[] = { 3, 4, 5 };
00665 static const float a[] = { 0.65143905753106f,
00666 0.56471812200776f,
00667 0.48954165955695f };
00668
00669 if (is34 != ps->is34bands_old) {
00670 memset(ps->peak_decay_nrg, 0, sizeof(ps->peak_decay_nrg));
00671 memset(ps->power_smooth, 0, sizeof(ps->power_smooth));
00672 memset(ps->peak_decay_diff_smooth, 0, sizeof(ps->peak_decay_diff_smooth));
00673 memset(ps->delay, 0, sizeof(ps->delay));
00674 memset(ps->ap_delay, 0, sizeof(ps->ap_delay));
00675 }
00676
00677 for (n = n0; n < nL; n++) {
00678 for (k = 0; k < NR_BANDS[is34]; k++) {
00679 int i = k_to_i[k];
00680 power[i][n] += s[k][n][0] * s[k][n][0] + s[k][n][1] * s[k][n][1];
00681 }
00682 }
00683
00684
00685 for (i = 0; i < NR_PAR_BANDS[is34]; i++) {
00686 for (n = n0; n < nL; n++) {
00687 float decayed_peak = peak_decay_factor * peak_decay_nrg[i];
00688 float denom;
00689 peak_decay_nrg[i] = FFMAX(decayed_peak, power[i][n]);
00690 power_smooth[i] += a_smooth * (power[i][n] - power_smooth[i]);
00691 peak_decay_diff_smooth[i] += a_smooth * (peak_decay_nrg[i] - power[i][n] - peak_decay_diff_smooth[i]);
00692 denom = transient_impact * peak_decay_diff_smooth[i];
00693 transient_gain[i][n] = (denom > power_smooth[i]) ?
00694 power_smooth[i] / denom : 1.0f;
00695 }
00696 }
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706 for (k = 0; k < NR_ALLPASS_BANDS[is34]; k++) {
00707 int b = k_to_i[k];
00708 float g_decay_slope = 1.f - DECAY_SLOPE * (k - DECAY_CUTOFF[is34]);
00709 float ag[PS_AP_LINKS];
00710 g_decay_slope = av_clipf(g_decay_slope, 0.f, 1.f);
00711 memcpy(delay[k], delay[k]+nL, PS_MAX_DELAY*sizeof(delay[k][0]));
00712 memcpy(delay[k]+PS_MAX_DELAY, s[k], numQMFSlots*sizeof(delay[k][0]));
00713 for (m = 0; m < PS_AP_LINKS; m++) {
00714 memcpy(ap_delay[k][m], ap_delay[k][m]+numQMFSlots, 5*sizeof(ap_delay[k][m][0]));
00715 ag[m] = a[m] * g_decay_slope;
00716 }
00717 for (n = n0; n < nL; n++) {
00718 float in_re = delay[k][n+PS_MAX_DELAY-2][0] * phi_fract[is34][k][0] -
00719 delay[k][n+PS_MAX_DELAY-2][1] * phi_fract[is34][k][1];
00720 float in_im = delay[k][n+PS_MAX_DELAY-2][0] * phi_fract[is34][k][1] +
00721 delay[k][n+PS_MAX_DELAY-2][1] * phi_fract[is34][k][0];
00722 for (m = 0; m < PS_AP_LINKS; m++) {
00723 float a_re = ag[m] * in_re;
00724 float a_im = ag[m] * in_im;
00725 float link_delay_re = ap_delay[k][m][n+5-link_delay[m]][0];
00726 float link_delay_im = ap_delay[k][m][n+5-link_delay[m]][1];
00727 float fractional_delay_re = Q_fract_allpass[is34][k][m][0];
00728 float fractional_delay_im = Q_fract_allpass[is34][k][m][1];
00729 ap_delay[k][m][n+5][0] = in_re;
00730 ap_delay[k][m][n+5][1] = in_im;
00731 in_re = link_delay_re * fractional_delay_re - link_delay_im * fractional_delay_im - a_re;
00732 in_im = link_delay_re * fractional_delay_im + link_delay_im * fractional_delay_re - a_im;
00733 ap_delay[k][m][n+5][0] += ag[m] * in_re;
00734 ap_delay[k][m][n+5][1] += ag[m] * in_im;
00735 }
00736 out[k][n][0] = transient_gain[b][n] * in_re;
00737 out[k][n][1] = transient_gain[b][n] * in_im;
00738 }
00739 }
00740 for (; k < SHORT_DELAY_BAND[is34]; k++) {
00741 memcpy(delay[k], delay[k]+nL, PS_MAX_DELAY*sizeof(delay[k][0]));
00742 memcpy(delay[k]+PS_MAX_DELAY, s[k], numQMFSlots*sizeof(delay[k][0]));
00743 for (n = n0; n < nL; n++) {
00744
00745 out[k][n][0] = transient_gain[k_to_i[k]][n] * delay[k][n+PS_MAX_DELAY-14][0];
00746 out[k][n][1] = transient_gain[k_to_i[k]][n] * delay[k][n+PS_MAX_DELAY-14][1];
00747 }
00748 }
00749 for (; k < NR_BANDS[is34]; k++) {
00750 memcpy(delay[k], delay[k]+nL, PS_MAX_DELAY*sizeof(delay[k][0]));
00751 memcpy(delay[k]+PS_MAX_DELAY, s[k], numQMFSlots*sizeof(delay[k][0]));
00752 for (n = n0; n < nL; n++) {
00753
00754 out[k][n][0] = transient_gain[k_to_i[k]][n] * delay[k][n+PS_MAX_DELAY-1][0];
00755 out[k][n][1] = transient_gain[k_to_i[k]][n] * delay[k][n+PS_MAX_DELAY-1][1];
00756 }
00757 }
00758 }
00759
00760 static void remap34(int8_t (**p_par_mapped)[PS_MAX_NR_IIDICC],
00761 int8_t (*par)[PS_MAX_NR_IIDICC],
00762 int num_par, int num_env, int full)
00763 {
00764 int8_t (*par_mapped)[PS_MAX_NR_IIDICC] = *p_par_mapped;
00765 int e;
00766 if (num_par == 20 || num_par == 11) {
00767 for (e = 0; e < num_env; e++) {
00768 map_idx_20_to_34(par_mapped[e], par[e], full);
00769 }
00770 } else if (num_par == 10 || num_par == 5) {
00771 for (e = 0; e < num_env; e++) {
00772 map_idx_10_to_34(par_mapped[e], par[e], full);
00773 }
00774 } else {
00775 *p_par_mapped = par;
00776 }
00777 }
00778
00779 static void remap20(int8_t (**p_par_mapped)[PS_MAX_NR_IIDICC],
00780 int8_t (*par)[PS_MAX_NR_IIDICC],
00781 int num_par, int num_env, int full)
00782 {
00783 int8_t (*par_mapped)[PS_MAX_NR_IIDICC] = *p_par_mapped;
00784 int e;
00785 if (num_par == 34 || num_par == 17) {
00786 for (e = 0; e < num_env; e++) {
00787 map_idx_34_to_20(par_mapped[e], par[e], full);
00788 }
00789 } else if (num_par == 10 || num_par == 5) {
00790 for (e = 0; e < num_env; e++) {
00791 map_idx_10_to_20(par_mapped[e], par[e], full);
00792 }
00793 } else {
00794 *p_par_mapped = par;
00795 }
00796 }
00797
00798 static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2], int is34)
00799 {
00800 int e, b, k, n;
00801
00802 float (*H11)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H11;
00803 float (*H12)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H12;
00804 float (*H21)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H21;
00805 float (*H22)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H22;
00806 int8_t *opd_hist = ps->opd_hist;
00807 int8_t *ipd_hist = ps->ipd_hist;
00808 int8_t iid_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];
00809 int8_t icc_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];
00810 int8_t ipd_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];
00811 int8_t opd_mapped_buf[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC];
00812 int8_t (*iid_mapped)[PS_MAX_NR_IIDICC] = iid_mapped_buf;
00813 int8_t (*icc_mapped)[PS_MAX_NR_IIDICC] = icc_mapped_buf;
00814 int8_t (*ipd_mapped)[PS_MAX_NR_IIDICC] = ipd_mapped_buf;
00815 int8_t (*opd_mapped)[PS_MAX_NR_IIDICC] = opd_mapped_buf;
00816 const int8_t *k_to_i = is34 ? k_to_i_34 : k_to_i_20;
00817 const float (*H_LUT)[8][4] = (PS_BASELINE || ps->icc_mode < 3) ? HA : HB;
00818
00819
00820 if (ps->num_env_old) {
00821 memcpy(H11[0][0], H11[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[0][0][0]));
00822 memcpy(H11[1][0], H11[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H11[1][0][0]));
00823 memcpy(H12[0][0], H12[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[0][0][0]));
00824 memcpy(H12[1][0], H12[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H12[1][0][0]));
00825 memcpy(H21[0][0], H21[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[0][0][0]));
00826 memcpy(H21[1][0], H21[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H21[1][0][0]));
00827 memcpy(H22[0][0], H22[0][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[0][0][0]));
00828 memcpy(H22[1][0], H22[1][ps->num_env_old], PS_MAX_NR_IIDICC*sizeof(H22[1][0][0]));
00829 }
00830
00831 if (is34) {
00832 remap34(&iid_mapped, ps->iid_par, ps->nr_iid_par, ps->num_env, 1);
00833 remap34(&icc_mapped, ps->icc_par, ps->nr_icc_par, ps->num_env, 1);
00834 if (ps->enable_ipdopd) {
00835 remap34(&ipd_mapped, ps->ipd_par, ps->nr_ipdopd_par, ps->num_env, 0);
00836 remap34(&opd_mapped, ps->opd_par, ps->nr_ipdopd_par, ps->num_env, 0);
00837 }
00838 if (!ps->is34bands_old) {
00839 map_val_20_to_34(H11[0][0]);
00840 map_val_20_to_34(H11[1][0]);
00841 map_val_20_to_34(H12[0][0]);
00842 map_val_20_to_34(H12[1][0]);
00843 map_val_20_to_34(H21[0][0]);
00844 map_val_20_to_34(H21[1][0]);
00845 map_val_20_to_34(H22[0][0]);
00846 map_val_20_to_34(H22[1][0]);
00847 ipdopd_reset(ipd_hist, opd_hist);
00848 }
00849 } else {
00850 remap20(&iid_mapped, ps->iid_par, ps->nr_iid_par, ps->num_env, 1);
00851 remap20(&icc_mapped, ps->icc_par, ps->nr_icc_par, ps->num_env, 1);
00852 if (ps->enable_ipdopd) {
00853 remap20(&ipd_mapped, ps->ipd_par, ps->nr_ipdopd_par, ps->num_env, 0);
00854 remap20(&opd_mapped, ps->opd_par, ps->nr_ipdopd_par, ps->num_env, 0);
00855 }
00856 if (ps->is34bands_old) {
00857 map_val_34_to_20(H11[0][0]);
00858 map_val_34_to_20(H11[1][0]);
00859 map_val_34_to_20(H12[0][0]);
00860 map_val_34_to_20(H12[1][0]);
00861 map_val_34_to_20(H21[0][0]);
00862 map_val_34_to_20(H21[1][0]);
00863 map_val_34_to_20(H22[0][0]);
00864 map_val_34_to_20(H22[1][0]);
00865 ipdopd_reset(ipd_hist, opd_hist);
00866 }
00867 }
00868
00869
00870 for (e = 0; e < ps->num_env; e++) {
00871 for (b = 0; b < NR_PAR_BANDS[is34]; b++) {
00872 float h11, h12, h21, h22;
00873 h11 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][0];
00874 h12 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][1];
00875 h21 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][2];
00876 h22 = H_LUT[iid_mapped[e][b] + 7 + 23 * ps->iid_quant][icc_mapped[e][b]][3];
00877 if (!PS_BASELINE && ps->enable_ipdopd && b < ps->nr_ipdopd_par) {
00878
00879
00880 float h11i, h12i, h21i, h22i;
00881 float ipd_adj_re, ipd_adj_im;
00882 int opd_idx = opd_hist[b] * 8 + opd_mapped[e][b];
00883 int ipd_idx = ipd_hist[b] * 8 + ipd_mapped[e][b];
00884 float opd_re = pd_re_smooth[opd_idx];
00885 float opd_im = pd_im_smooth[opd_idx];
00886 float ipd_re = pd_re_smooth[ipd_idx];
00887 float ipd_im = pd_im_smooth[ipd_idx];
00888 opd_hist[b] = opd_idx & 0x3F;
00889 ipd_hist[b] = ipd_idx & 0x3F;
00890
00891 ipd_adj_re = opd_re*ipd_re + opd_im*ipd_im;
00892 ipd_adj_im = opd_im*ipd_re - opd_re*ipd_im;
00893 h11i = h11 * opd_im;
00894 h11 = h11 * opd_re;
00895 h12i = h12 * ipd_adj_im;
00896 h12 = h12 * ipd_adj_re;
00897 h21i = h21 * opd_im;
00898 h21 = h21 * opd_re;
00899 h22i = h22 * ipd_adj_im;
00900 h22 = h22 * ipd_adj_re;
00901 H11[1][e+1][b] = h11i;
00902 H12[1][e+1][b] = h12i;
00903 H21[1][e+1][b] = h21i;
00904 H22[1][e+1][b] = h22i;
00905 }
00906 H11[0][e+1][b] = h11;
00907 H12[0][e+1][b] = h12;
00908 H21[0][e+1][b] = h21;
00909 H22[0][e+1][b] = h22;
00910 }
00911 for (k = 0; k < NR_BANDS[is34]; k++) {
00912 float h11r, h12r, h21r, h22r;
00913 float h11i, h12i, h21i, h22i;
00914 float h11r_step, h12r_step, h21r_step, h22r_step;
00915 float h11i_step, h12i_step, h21i_step, h22i_step;
00916 int start = ps->border_position[e];
00917 int stop = ps->border_position[e+1];
00918 float width = 1.f / (stop - start);
00919 b = k_to_i[k];
00920 h11r = H11[0][e][b];
00921 h12r = H12[0][e][b];
00922 h21r = H21[0][e][b];
00923 h22r = H22[0][e][b];
00924 if (!PS_BASELINE && ps->enable_ipdopd) {
00925
00926 if ((is34 && k <= 13 && k >= 9) || (!is34 && k <= 1)) {
00927 h11i = -H11[1][e][b];
00928 h12i = -H12[1][e][b];
00929 h21i = -H21[1][e][b];
00930 h22i = -H22[1][e][b];
00931 } else {
00932 h11i = H11[1][e][b];
00933 h12i = H12[1][e][b];
00934 h21i = H21[1][e][b];
00935 h22i = H22[1][e][b];
00936 }
00937 }
00938
00939 h11r_step = (H11[0][e+1][b] - h11r) * width;
00940 h12r_step = (H12[0][e+1][b] - h12r) * width;
00941 h21r_step = (H21[0][e+1][b] - h21r) * width;
00942 h22r_step = (H22[0][e+1][b] - h22r) * width;
00943 if (!PS_BASELINE && ps->enable_ipdopd) {
00944 h11i_step = (H11[1][e+1][b] - h11i) * width;
00945 h12i_step = (H12[1][e+1][b] - h12i) * width;
00946 h21i_step = (H21[1][e+1][b] - h21i) * width;
00947 h22i_step = (H22[1][e+1][b] - h22i) * width;
00948 }
00949 for (n = start + 1; n <= stop; n++) {
00950
00951 float l_re = l[k][n][0];
00952 float l_im = l[k][n][1];
00953 float r_re = r[k][n][0];
00954 float r_im = r[k][n][1];
00955 h11r += h11r_step;
00956 h12r += h12r_step;
00957 h21r += h21r_step;
00958 h22r += h22r_step;
00959 if (!PS_BASELINE && ps->enable_ipdopd) {
00960 h11i += h11i_step;
00961 h12i += h12i_step;
00962 h21i += h21i_step;
00963 h22i += h22i_step;
00964
00965 l[k][n][0] = h11r*l_re + h21r*r_re - h11i*l_im - h21i*r_im;
00966 l[k][n][1] = h11r*l_im + h21r*r_im + h11i*l_re + h21i*r_re;
00967 r[k][n][0] = h12r*l_re + h22r*r_re - h12i*l_im - h22i*r_im;
00968 r[k][n][1] = h12r*l_im + h22r*r_im + h12i*l_re + h22i*r_re;
00969 } else {
00970 l[k][n][0] = h11r*l_re + h21r*r_re;
00971 l[k][n][1] = h11r*l_im + h21r*r_im;
00972 r[k][n][0] = h12r*l_re + h22r*r_re;
00973 r[k][n][1] = h12r*l_im + h22r*r_im;
00974 }
00975 }
00976 }
00977 }
00978 }
00979
00980 int ff_ps_apply(AVCodecContext *avctx, PSContext *ps, float L[2][38][64], float R[2][38][64], int top)
00981 {
00982 float Lbuf[91][32][2];
00983 float Rbuf[91][32][2];
00984 const int len = 32;
00985 int is34 = ps->is34bands;
00986
00987 top += NR_BANDS[is34] - 64;
00988 memset(ps->delay+top, 0, (NR_BANDS[is34] - top)*sizeof(ps->delay[0]));
00989 if (top < NR_ALLPASS_BANDS[is34])
00990 memset(ps->ap_delay + top, 0, (NR_ALLPASS_BANDS[is34] - top)*sizeof(ps->ap_delay[0]));
00991
00992 hybrid_analysis(Lbuf, ps->in_buf, L, is34, len);
00993 decorrelation(ps, Rbuf, Lbuf, is34);
00994 stereo_processing(ps, Lbuf, Rbuf, is34);
00995 hybrid_synthesis(L, Lbuf, is34, len);
00996 hybrid_synthesis(R, Rbuf, is34, len);
00997
00998 return 0;
00999 }
01000
01001 #define PS_INIT_VLC_STATIC(num, size) \
01002 INIT_VLC_STATIC(&vlc_ps[num], 9, ps_tmp[num].table_size / ps_tmp[num].elem_size, \
01003 ps_tmp[num].ps_bits, 1, 1, \
01004 ps_tmp[num].ps_codes, ps_tmp[num].elem_size, ps_tmp[num].elem_size, \
01005 size);
01006
01007 #define PS_VLC_ROW(name) \
01008 { name ## _codes, name ## _bits, sizeof(name ## _codes), sizeof(name ## _codes[0]) }
01009
01010 av_cold void ff_ps_init(void) {
01011
01012 static const struct {
01013 const void *ps_codes, *ps_bits;
01014 const unsigned int table_size, elem_size;
01015 } ps_tmp[] = {
01016 PS_VLC_ROW(huff_iid_df1),
01017 PS_VLC_ROW(huff_iid_dt1),
01018 PS_VLC_ROW(huff_iid_df0),
01019 PS_VLC_ROW(huff_iid_dt0),
01020 PS_VLC_ROW(huff_icc_df),
01021 PS_VLC_ROW(huff_icc_dt),
01022 PS_VLC_ROW(huff_ipd_df),
01023 PS_VLC_ROW(huff_ipd_dt),
01024 PS_VLC_ROW(huff_opd_df),
01025 PS_VLC_ROW(huff_opd_dt),
01026 };
01027
01028 PS_INIT_VLC_STATIC(0, 1544);
01029 PS_INIT_VLC_STATIC(1, 832);
01030 PS_INIT_VLC_STATIC(2, 1024);
01031 PS_INIT_VLC_STATIC(3, 1036);
01032 PS_INIT_VLC_STATIC(4, 544);
01033 PS_INIT_VLC_STATIC(5, 544);
01034 PS_INIT_VLC_STATIC(6, 512);
01035 PS_INIT_VLC_STATIC(7, 512);
01036 PS_INIT_VLC_STATIC(8, 512);
01037 PS_INIT_VLC_STATIC(9, 512);
01038
01039 ps_tableinit();
01040 }
01041
01042 av_cold void ff_ps_ctx_init(PSContext *ps)
01043 {
01044 }