Mercurial > libavcodec.hg
comparison dnxhdenc.c @ 5795:8b6fe123be88 libavcodec
typo weigth->weight
author | bcoudurier |
---|---|
date | Mon, 08 Oct 2007 12:28:36 +0000 |
parents | c3f2a6425d2d |
children | 5691b843e72a |
comparison
equal
deleted
inserted
replaced
5794:8412118b41d3 | 5795:8b6fe123be88 |
---|---|
128 CHECKED_ALLOCZ(ctx->qmatrix_l16, (ctx->m.avctx->qmax+1) * 64 * 2 * sizeof(uint16_t)); | 128 CHECKED_ALLOCZ(ctx->qmatrix_l16, (ctx->m.avctx->qmax+1) * 64 * 2 * sizeof(uint16_t)); |
129 CHECKED_ALLOCZ(ctx->qmatrix_c16, (ctx->m.avctx->qmax+1) * 64 * 2 * sizeof(uint16_t)); | 129 CHECKED_ALLOCZ(ctx->qmatrix_c16, (ctx->m.avctx->qmax+1) * 64 * 2 * sizeof(uint16_t)); |
130 | 130 |
131 for (i = 1; i < 64; i++) { | 131 for (i = 1; i < 64; i++) { |
132 int j = ctx->m.dsp.idct_permutation[ff_zigzag_direct[i]]; | 132 int j = ctx->m.dsp.idct_permutation[ff_zigzag_direct[i]]; |
133 weight_matrix[j] = ctx->cid_table->luma_weigth[i]; | 133 weight_matrix[j] = ctx->cid_table->luma_weight[i]; |
134 } | 134 } |
135 ff_convert_matrix(&ctx->m.dsp, ctx->qmatrix_l, ctx->qmatrix_l16, weight_matrix, | 135 ff_convert_matrix(&ctx->m.dsp, ctx->qmatrix_l, ctx->qmatrix_l16, weight_matrix, |
136 ctx->m.intra_quant_bias, 1, ctx->m.avctx->qmax, 1); | 136 ctx->m.intra_quant_bias, 1, ctx->m.avctx->qmax, 1); |
137 for (i = 1; i < 64; i++) { | 137 for (i = 1; i < 64; i++) { |
138 int j = ctx->m.dsp.idct_permutation[ff_zigzag_direct[i]]; | 138 int j = ctx->m.dsp.idct_permutation[ff_zigzag_direct[i]]; |
139 weight_matrix[j] = ctx->cid_table->chroma_weigth[i]; | 139 weight_matrix[j] = ctx->cid_table->chroma_weight[i]; |
140 } | 140 } |
141 ff_convert_matrix(&ctx->m.dsp, ctx->qmatrix_c, ctx->qmatrix_c16, weight_matrix, | 141 ff_convert_matrix(&ctx->m.dsp, ctx->qmatrix_c, ctx->qmatrix_c16, weight_matrix, |
142 ctx->m.intra_quant_bias, 1, ctx->m.avctx->qmax, 1); | 142 ctx->m.intra_quant_bias, 1, ctx->m.avctx->qmax, 1); |
143 for (qscale = 1; qscale <= ctx->m.avctx->qmax; qscale++) { | 143 for (qscale = 1; qscale <= ctx->m.avctx->qmax; qscale++) { |
144 for (i = 0; i < 64; i++) { | 144 for (i = 0; i < 64; i++) { |
325 put_bits(&ctx->m.pb, ctx->table_vlc_bits[0], ctx->table_vlc_codes[0]); // EOB | 325 put_bits(&ctx->m.pb, ctx->table_vlc_bits[0], ctx->table_vlc_codes[0]); // EOB |
326 } | 326 } |
327 | 327 |
328 static av_always_inline void dnxhd_unquantize_c(DNXHDEncContext *ctx, DCTELEM *block, int n, int qscale, int last_index) | 328 static av_always_inline void dnxhd_unquantize_c(DNXHDEncContext *ctx, DCTELEM *block, int n, int qscale, int last_index) |
329 { | 329 { |
330 const uint8_t *weigth_matrix; | 330 const uint8_t *weight_matrix; |
331 int level; | 331 int level; |
332 int i; | 332 int i; |
333 | 333 |
334 weigth_matrix = (n&2) ? ctx->cid_table->chroma_weigth : ctx->cid_table->luma_weigth; | 334 weight_matrix = (n&2) ? ctx->cid_table->chroma_weight : ctx->cid_table->luma_weight; |
335 | 335 |
336 for (i = 1; i <= last_index; i++) { | 336 for (i = 1; i <= last_index; i++) { |
337 int j = ctx->m.intra_scantable.permutated[i]; | 337 int j = ctx->m.intra_scantable.permutated[i]; |
338 level = block[j]; | 338 level = block[j]; |
339 if (level) { | 339 if (level) { |
340 if (level < 0) { | 340 if (level < 0) { |
341 level = (1-2*level) * qscale * weigth_matrix[i]; | 341 level = (1-2*level) * qscale * weight_matrix[i]; |
342 if (weigth_matrix[i] != 32) | 342 if (weight_matrix[i] != 32) |
343 level += 32; | 343 level += 32; |
344 level >>= 6; | 344 level >>= 6; |
345 level = -level; | 345 level = -level; |
346 } else { | 346 } else { |
347 level = (2*level+1) * qscale * weigth_matrix[i]; | 347 level = (2*level+1) * qscale * weight_matrix[i]; |
348 if (weigth_matrix[i] != 32) | 348 if (weight_matrix[i] != 32) |
349 level += 32; | 349 level += 32; |
350 level >>= 6; | 350 level >>= 6; |
351 } | 351 } |
352 block[j] = level; | 352 block[j] = level; |
353 } | 353 } |