• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/libav-0.8.8/libavcodec/

Lines Matching defs:bd

555 static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
561 *bd->raw_samples = 0;
562 *bd->const_block = get_bits1(gb); // 1 = constant value, 0 = zero block (silence)
563 bd->js_blocks = get_bits1(gb);
568 if (*bd->const_block) {
570 *bd->raw_samples = get_sbits_long(gb, const_val_bits);
574 *bd->const_block = 1;
580 static void decode_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
582 int smp = bd->block_length - 1;
583 int32_t val = *bd->raw_samples;
584 int32_t *dst = bd->raw_samples + 1;
594 static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
606 int32_t *quant_cof = bd->quant_cof;
611 *bd->const_block = 0;
613 *bd->opt_order = 1;
614 bd->js_blocks = get_bits1(gb);
616 opt_order = *bd->opt_order;
632 if (bd->block_length & (sub_blocks - 1)) {
638 sb_length = bd->block_length >> log2_sub_blocks;
661 *bd->shift_lsbs = get_bits(gb, 4) + 1;
663 *bd->store_prev_samples = (bd->js_blocks && bd->raw_other) || *bd->shift_lsbs;
668 int opt_order_length = av_ceil_log2(av_clip((bd->block_length >> 3) - 1,
670 *bd->opt_order = get_bits(gb, opt_order_length);
671 if (*bd->opt_order > sconf->max_order) {
672 *bd->opt_order = sconf->max_order;
677 *bd->opt_order = sconf->max_order;
680 opt_order = *bd->opt_order;
736 *bd->use_ltp = get_bits1(gb);
738 if (*bd->use_ltp) {
741 bd->ltp_gain[0] = decode_rice(gb, 1) << 3;
742 bd->ltp_gain[1] = decode_rice(gb, 2) << 3;
746 bd->ltp_gain[2] = ltp_gain_values[r][c];
748 bd->ltp_gain[3] = decode_rice(gb, 2) << 3;
749 bd->ltp_gain[4] = decode_rice(gb, 1) << 3;
751 *bd->ltp_lag = get_bits(gb, ctx->ltp_lag_length);
752 *bd->ltp_lag += FFMAX(4, opt_order + 1);
757 if (bd->ra_block) {
759 bd->raw_samples[0] = decode_rice(gb, avctx->bits_per_raw_sample - 4);
761 bd->raw_samples[1] = decode_rice(gb, FFMIN(s[0] + 3, ctx->s_max));
763 bd->raw_samples[2] = decode_rice(gb, FFMIN(s[0] + 1, ctx->s_max));
772 unsigned int b = av_clip((av_ceil_log2(bd->block_length) - 3) >> 1, 0, 5);
781 current_res = bd->raw_samples + start;
799 current_res = bd->raw_samples + start;
839 current_res = bd->raw_samples + start;
855 static int decode_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
858 unsigned int block_length = bd->block_length;
861 int opt_order = *bd->opt_order;
864 int32_t *quant_cof = bd->quant_cof;
865 int32_t *lpc_cof = bd->lpc_cof;
866 int32_t *raw_samples = bd->raw_samples;
867 int32_t *raw_samples_end = bd->raw_samples + bd->block_length;
871 if (*bd->use_ltp) {
874 for (ltp_smp = FFMAX(*bd->ltp_lag - 2, 0); ltp_smp < block_length; ltp_smp++) {
875 int center = ltp_smp - *bd->ltp_lag;
884 y += MUL64(bd->ltp_gain[tab], raw_samples[base]);
891 if (bd->ra_block) {
906 if (*bd->store_prev_samples)
907 memcpy(bd->prev_raw_samples, raw_samples - sconf->max_order,
908 sizeof(*bd->prev_raw_samples) * sconf->max_order);
911 if (bd->js_blocks && bd->raw_other) {
914 if (bd->raw_other > raw_samples) { // D = R - L
916 right = bd->raw_other;
918 left = bd->raw_other;
927 if (*bd->shift_lsbs)
929 raw_samples[sb] >>= *bd->shift_lsbs;
939 raw_samples = bd->raw_samples + smp;
951 raw_samples = bd->raw_samples;
954 if (*bd->store_prev_samples)
955 memcpy(raw_samples - sconf->max_order, bd->prev_raw_samples,
964 static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
968 *bd->shift_lsbs = 0;
971 if (read_var_block_data(ctx, bd))
974 read_const_block_data(ctx, bd);
983 static int decode_block(ALSDecContext *ctx, ALSBlockData *bd)
988 if (*bd->const_block)
989 decode_const_block_data(ctx, bd);
990 else if (decode_var_block_data(ctx, bd))
995 if (*bd->shift_lsbs)
996 for (smp = 0; smp < bd->block_length; smp++)
997 bd->raw_samples[smp] <<= *bd->shift_lsbs;
1005 static int read_decode_block(ALSDecContext *ctx, ALSBlockData *bd)
1009 ret = read_block(ctx, bd);
1014 ret = decode_block(ctx, bd);
1043 ALSBlockData bd;
1045 memset(&bd, 0, sizeof(ALSBlockData));
1047 bd.ra_block = ra_frame;
1048 bd.const_block = ctx->const_block;
1049 bd.shift_lsbs = ctx->shift_lsbs;
1050 bd.opt_order = ctx->opt_order;
1051 bd.store_prev_samples = ctx->store_prev_samples;
1052 bd.use_ltp = ctx->use_ltp;
1053 bd.ltp_lag = ctx->ltp_lag;
1054 bd.ltp_gain = ctx->ltp_gain[0];
1055 bd.quant_cof = ctx->quant_cof[0];
1056 bd.lpc_cof = ctx->lpc_cof[0];
1057 bd.prev_raw_samples = ctx->prev_raw_samples;
1058 bd.raw_samples = ctx->raw_samples[c];
1062 bd.block_length = div_blocks[b];
1064 if (read_decode_block(ctx, &bd)) {
1066 zero_remaining(b, ctx->num_blocks, div_blocks, bd.raw_samples);
1069 bd.raw_samples += div_blocks[b];
1070 bd.ra_block = 0;
1086 ALSBlockData bd[2];
1088 memset(bd, 0, 2 * sizeof(ALSBlockData));
1090 bd[0].ra_block = ra_frame;
1091 bd[0].const_block = ctx->const_block;
1092 bd[0].shift_lsbs = ctx->shift_lsbs;
1093 bd[0].opt_order = ctx->opt_order;
1094 bd[0].store_prev_samples = ctx->store_prev_samples;
1095 bd[0].use_ltp = ctx->use_ltp;
1096 bd[0].ltp_lag = ctx->ltp_lag;
1097 bd[0].ltp_gain = ctx->ltp_gain[0];
1098 bd[0].quant_cof = ctx->quant_cof[0];
1099 bd[0].lpc_cof = ctx->lpc_cof[0];
1100 bd[0].prev_raw_samples = ctx->prev_raw_samples;
1101 bd[0].js_blocks = *js_blocks;
1103 bd[1].ra_block = ra_frame;
1104 bd[1].const_block = ctx->const_block;
1105 bd[1].shift_lsbs = ctx->shift_lsbs;
1106 bd[1].opt_order = ctx->opt_order;
1107 bd[1].store_prev_samples = ctx->store_prev_samples;
1108 bd[1].use_ltp = ctx->use_ltp;
1109 bd[1].ltp_lag = ctx->ltp_lag;
1110 bd[1].ltp_gain = ctx->ltp_gain[0];
1111 bd[1].quant_cof = ctx->quant_cof[0];
1112 bd[1].lpc_cof = ctx->lpc_cof[0];
1113 bd[1].prev_raw_samples = ctx->prev_raw_samples;
1114 bd[1].js_blocks = *(js_blocks + 1);
1120 bd[0].block_length = div_blocks[b];
1121 bd[1].block_length = div_blocks[b];
1123 bd[0].raw_samples = ctx->raw_samples[c ] + offset;
1124 bd[1].raw_samples = ctx->raw_samples[c + 1] + offset;
1126 bd[0].raw_other = bd[1].raw_samples;
1127 bd[1].raw_other = bd[0].raw_samples;
1129 if(read_decode_block(ctx, &bd[0]) || read_decode_block(ctx, &bd[1])) {
1131 zero_remaining(b, ctx->num_blocks, div_blocks, bd[0].raw_samples);
1132 zero_remaining(b, ctx->num_blocks, div_blocks, bd[1].raw_samples);
1137 if (bd[0].js_blocks) {
1138 if (bd[1].js_blocks)
1142 bd[0].raw_samples[s] = bd[1].raw_samples[s] - bd[0].raw_samples[s];
1143 } else if (bd[1].js_blocks) {
1145 bd[1].raw_samples[s] = bd[1].raw_samples[s] + bd[0].raw_samples[s];
1149 bd[0].ra_block = 0;
1150 bd[1].ra_block = 0;
1212 static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd,
1226 revert_channel_correlation(ctx, bd, cd, reverted, offset,
1237 bd->const_block = ctx->const_block + c;
1238 bd->shift_lsbs = ctx->shift_lsbs + c;
1239 bd->opt_order = ctx->opt_order + c;
1240 bd->store_prev_samples = ctx->store_prev_samples + c;
1241 bd->use_ltp = ctx->use_ltp + c;
1242 bd->ltp_lag = ctx->ltp_lag + c;
1243 bd->ltp_gain = ctx->ltp_gain[c];
1244 bd->lpc_cof = ctx->lpc_cof[c];
1245 bd->quant_cof = ctx->quant_cof[c];
1246 bd->raw_samples = ctx->raw_samples[c] + offset;
1252 unsigned int end = bd->block_length - 1;
1275 bd->raw_samples[smp] += y >> 7;
1284 bd->raw_samples[smp] += y >> 7;
1354 ALSBlockData bd;
1365 memset(&bd, 0, sizeof(ALSBlockData));
1368 bd.ra_block = ra_frame;
1369 bd.prev_raw_samples = ctx->prev_raw_samples;
1374 bd.block_length = div_blocks[b];
1377 bd.const_block = ctx->const_block + c;
1378 bd.shift_lsbs = ctx->shift_lsbs + c;
1379 bd.opt_order = ctx->opt_order + c;
1380 bd.store_prev_samples = ctx->store_prev_samples + c;
1381 bd.use_ltp = ctx->use_ltp + c;
1382 bd.ltp_lag = ctx->ltp_lag + c;
1383 bd.ltp_gain = ctx->ltp_gain[c];
1384 bd.lpc_cof = ctx->lpc_cof[c];
1385 bd.quant_cof = ctx->quant_cof[c];
1386 bd.raw_samples = ctx->raw_samples[c] + offset;
1387 bd.raw_other = NULL;
1389 read_block(ctx, &bd);
1395 if (revert_channel_correlation(ctx, &bd, ctx->chan_data,
1400 bd.const_block = ctx->const_block + c;
1401 bd.shift_lsbs = ctx->shift_lsbs + c;
1402 bd.opt_order = ctx->opt_order + c;
1403 bd.store_prev_samples = ctx->store_prev_samples + c;
1404 bd.use_ltp = ctx->use_ltp + c;
1405 bd.ltp_lag = ctx->ltp_lag + c;
1406 bd.ltp_gain = ctx->ltp_gain[c];
1407 bd.lpc_cof = ctx->lpc_cof[c];
1408 bd.quant_cof = ctx->quant_cof[c];
1409 bd.raw_samples = ctx->raw_samples[c] + offset;
1410 decode_block(ctx, &bd);
1415 bd.ra_block = 0;