comparison ivi_common.c @ 11853:1547c744b8d4 libavcodec

Prepare Indeo4 (step 1): upscale indeo5 base tables by 2 and convert those into uint16_t.
author maxim
date Tue, 08 Jun 2010 09:20:12 +0000
parents 25ce7aff1e1d
children 7204cb7dd601
comparison
equal deleted inserted replaced
11852:24a6c651c3f3 11853:1547c744b8d4
336 uint32_t cbp, sym, lo, hi, quant, buf_offs, q; 336 uint32_t cbp, sym, lo, hi, quant, buf_offs, q;
337 IVIMbInfo *mb; 337 IVIMbInfo *mb;
338 RVMapDesc *rvmap = band->rv_map; 338 RVMapDesc *rvmap = band->rv_map;
339 void (*mc_with_delta_func)(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type); 339 void (*mc_with_delta_func)(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
340 void (*mc_no_delta_func) (int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type); 340 void (*mc_no_delta_func) (int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
341 const uint8_t *base_tab, *scale_tab; 341 const uint16_t *base_tab;
342 const uint8_t *scale_tab;
342 343
343 prev_dc = 0; /* init intra prediction for the DC coefficient */ 344 prev_dc = 0; /* init intra prediction for the DC coefficient */
344 345
345 blk_size = band->blk_size; 346 blk_size = band->blk_size;
346 col_mask = blk_size - 1; /* column mask for tracking non-zero coeffs */ 347 col_mask = blk_size - 1; /* column mask for tracking non-zero coeffs */
412 pos = band->scan[scan_pos]; 413 pos = band->scan[scan_pos];
413 414
414 if (IVI_DEBUG && !val) 415 if (IVI_DEBUG && !val)
415 av_log(NULL, AV_LOG_ERROR, "Val = 0 encountered!\n"); 416 av_log(NULL, AV_LOG_ERROR, "Val = 0 encountered!\n");
416 417
417 q = (base_tab[pos] * scale_tab[quant]) >> 8; 418 q = (base_tab[pos] * scale_tab[quant]) >> 9;
418 if (q > 1) 419 if (q > 1)
419 val = val * q + FFSIGN(val) * (((q ^ 1) - 1) >> 1); 420 val = val * q + FFSIGN(val) * (((q ^ 1) - 1) >> 1);
420 trvec[pos] = val; 421 trvec[pos] = val;
421 col_flags[pos & col_mask] |= !!val; /* track columns containing non-zero coeffs */ 422 col_flags[pos & col_mask] |= !!val; /* track columns containing non-zero coeffs */
422 }// while 423 }// while