comparison vc1.c @ 9521:d8e5002210cb libavcodec

Remove some useless assignments and variables found by Clang
author kostya
date Tue, 21 Apr 2009 05:24:50 +0000
parents e90d0068a03f
children bf81b6f776ea
comparison
equal deleted inserted replaced
9520:c9c23894f4ae 9521:d8e5002210cb
410 static void vc1_mc_1mv(VC1Context *v, int dir) 410 static void vc1_mc_1mv(VC1Context *v, int dir)
411 { 411 {
412 MpegEncContext *s = &v->s; 412 MpegEncContext *s = &v->s;
413 DSPContext *dsp = &v->s.dsp; 413 DSPContext *dsp = &v->s.dsp;
414 uint8_t *srcY, *srcU, *srcV; 414 uint8_t *srcY, *srcU, *srcV;
415 int dxy, uvdxy, mx, my, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y; 415 int dxy, mx, my, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y;
416 416
417 if(!v->s.last_picture.data[0])return; 417 if(!v->s.last_picture.data[0])return;
418 418
419 mx = s->mv[dir][0][0]; 419 mx = s->mv[dir][0][0];
420 my = s->mv[dir][0][1]; 420 my = s->mv[dir][0][1];
541 dsp->put_no_rnd_pixels_tab[0][dxy](s->dest[0], srcY, s->linesize, 16); 541 dsp->put_no_rnd_pixels_tab[0][dxy](s->dest[0], srcY, s->linesize, 16);
542 } 542 }
543 543
544 if(s->flags & CODEC_FLAG_GRAY) return; 544 if(s->flags & CODEC_FLAG_GRAY) return;
545 /* Chroma MC always uses qpel bilinear */ 545 /* Chroma MC always uses qpel bilinear */
546 uvdxy = ((uvmy & 3) << 2) | (uvmx & 3);
547 uvmx = (uvmx&3)<<1; 546 uvmx = (uvmx&3)<<1;
548 uvmy = (uvmy&3)<<1; 547 uvmy = (uvmy&3)<<1;
549 if(!v->rnd){ 548 if(!v->rnd){
550 dsp->put_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy); 549 dsp->put_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
551 dsp->put_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy); 550 dsp->put_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
646 static void vc1_mc_4mv_chroma(VC1Context *v) 645 static void vc1_mc_4mv_chroma(VC1Context *v)
647 { 646 {
648 MpegEncContext *s = &v->s; 647 MpegEncContext *s = &v->s;
649 DSPContext *dsp = &v->s.dsp; 648 DSPContext *dsp = &v->s.dsp;
650 uint8_t *srcU, *srcV; 649 uint8_t *srcU, *srcV;
651 int uvdxy, uvmx, uvmy, uvsrc_x, uvsrc_y; 650 int uvmx, uvmy, uvsrc_x, uvsrc_y;
652 int i, idx, tx = 0, ty = 0; 651 int i, idx, tx = 0, ty = 0;
653 int mvx[4], mvy[4], intra[4]; 652 int mvx[4], mvy[4], intra[4];
654 static const int count[16] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4}; 653 static const int count[16] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
655 654
656 if(!v->s.last_picture.data[0])return; 655 if(!v->s.last_picture.data[0])return;
761 } 760 }
762 } 761 }
763 } 762 }
764 763
765 /* Chroma MC always uses qpel bilinear */ 764 /* Chroma MC always uses qpel bilinear */
766 uvdxy = ((uvmy & 3) << 2) | (uvmx & 3);
767 uvmx = (uvmx&3)<<1; 765 uvmx = (uvmx&3)<<1;
768 uvmy = (uvmy&3)<<1; 766 uvmy = (uvmy&3)<<1;
769 if(!v->rnd){ 767 if(!v->rnd){
770 dsp->put_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy); 768 dsp->put_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
771 dsp->put_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy); 769 dsp->put_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
1207 case FF_B_TYPE: 1205 case FF_B_TYPE:
1208 if (v->pq < 5) v->tt_index = 0; 1206 if (v->pq < 5) v->tt_index = 0;
1209 else if(v->pq < 13) v->tt_index = 1; 1207 else if(v->pq < 13) v->tt_index = 1;
1210 else v->tt_index = 2; 1208 else v->tt_index = 2;
1211 1209
1212 lowquant = (v->pq > 12) ? 0 : 1;
1213 v->mv_mode = get_bits1(gb) ? MV_PMODE_1MV : MV_PMODE_1MV_HPEL_BILIN; 1210 v->mv_mode = get_bits1(gb) ? MV_PMODE_1MV : MV_PMODE_1MV_HPEL_BILIN;
1214 v->s.quarter_sample = (v->mv_mode == MV_PMODE_1MV); 1211 v->s.quarter_sample = (v->mv_mode == MV_PMODE_1MV);
1215 v->s.mspel = v->s.quarter_sample; 1212 v->s.mspel = v->s.quarter_sample;
1216 1213
1217 status = bitplane_decoding(v->direct_mb_plane, &v->dmb_is_raw, v); 1214 status = bitplane_decoding(v->direct_mb_plane, &v->dmb_is_raw, v);
1459 1456
1460 if (v->pq < 5) v->tt_index = 0; 1457 if (v->pq < 5) v->tt_index = 0;
1461 else if(v->pq < 13) v->tt_index = 1; 1458 else if(v->pq < 13) v->tt_index = 1;
1462 else v->tt_index = 2; 1459 else v->tt_index = 2;
1463 1460
1464 lowquant = (v->pq > 12) ? 0 : 1;
1465 v->mv_mode = get_bits1(gb) ? MV_PMODE_1MV : MV_PMODE_1MV_HPEL_BILIN; 1461 v->mv_mode = get_bits1(gb) ? MV_PMODE_1MV : MV_PMODE_1MV_HPEL_BILIN;
1466 v->s.quarter_sample = (v->mv_mode == MV_PMODE_1MV); 1462 v->s.quarter_sample = (v->mv_mode == MV_PMODE_1MV);
1467 v->s.mspel = v->s.quarter_sample; 1463 v->s.mspel = v->s.quarter_sample;
1468 1464
1469 status = bitplane_decoding(v->direct_mb_plane, &v->dmb_is_raw, v); 1465 status = bitplane_decoding(v->direct_mb_plane, &v->dmb_is_raw, v);
1753 static void vc1_interp_mc(VC1Context *v) 1749 static void vc1_interp_mc(VC1Context *v)
1754 { 1750 {
1755 MpegEncContext *s = &v->s; 1751 MpegEncContext *s = &v->s;
1756 DSPContext *dsp = &v->s.dsp; 1752 DSPContext *dsp = &v->s.dsp;
1757 uint8_t *srcY, *srcU, *srcV; 1753 uint8_t *srcY, *srcU, *srcV;
1758 int dxy, uvdxy, mx, my, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y; 1754 int dxy, mx, my, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y;
1759 1755
1760 if(!v->s.next_picture.data[0])return; 1756 if(!v->s.next_picture.data[0])return;
1761 1757
1762 mx = s->mv[1][0][0]; 1758 mx = s->mv[1][0][0];
1763 my = s->mv[1][0][1]; 1759 my = s->mv[1][0][1];
1852 dsp->avg_no_rnd_pixels_tab[0][dxy](s->dest[0], srcY, s->linesize, 16); 1848 dsp->avg_no_rnd_pixels_tab[0][dxy](s->dest[0], srcY, s->linesize, 16);
1853 } 1849 }
1854 1850
1855 if(s->flags & CODEC_FLAG_GRAY) return; 1851 if(s->flags & CODEC_FLAG_GRAY) return;
1856 /* Chroma MC always uses qpel blilinear */ 1852 /* Chroma MC always uses qpel blilinear */
1857 uvdxy = ((uvmy & 3) << 2) | (uvmx & 3);
1858 uvmx = (uvmx&3)<<1; 1853 uvmx = (uvmx&3)<<1;
1859 uvmy = (uvmy&3)<<1; 1854 uvmy = (uvmy&3)<<1;
1860 if(!v->rnd){ 1855 if(!v->rnd){
1861 dsp->avg_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy); 1856 dsp->avg_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
1862 dsp->avg_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy); 1857 dsp->avg_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
2195 */ 2190 */
2196 static inline int vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n, 2191 static inline int vc1_pred_dc(MpegEncContext *s, int overlap, int pq, int n,
2197 int a_avail, int c_avail, 2192 int a_avail, int c_avail,
2198 int16_t **dc_val_ptr, int *dir_ptr) 2193 int16_t **dc_val_ptr, int *dir_ptr)
2199 { 2194 {
2200 int a, b, c, wrap, pred, scale; 2195 int a, b, c, wrap, pred;
2201 int16_t *dc_val; 2196 int16_t *dc_val;
2202 int mb_pos = s->mb_x + s->mb_y * s->mb_stride; 2197 int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
2203 int q1, q2 = 0; 2198 int q1, q2 = 0;
2204
2205 /* find prediction - wmv3_dc_scale always used here in fact */
2206 if (n < 4) scale = s->y_dc_scale;
2207 else scale = s->c_dc_scale;
2208 2199
2209 wrap = s->block_wrap[n]; 2200 wrap = s->block_wrap[n];
2210 dc_val= s->dc_val[0] + s->block_index[n]; 2201 dc_val= s->dc_val[0] + s->block_index[n];
2211 2202
2212 /* B A 2203 /* B A
2418 } else { 2409 } else {
2419 block[0] = dcdiff * s->c_dc_scale; 2410 block[0] = dcdiff * s->c_dc_scale;
2420 } 2411 }
2421 /* Skip ? */ 2412 /* Skip ? */
2422 run_diff = 0; 2413 run_diff = 0;
2423 i = 0;
2424 if (!coded) { 2414 if (!coded) {
2425 goto not_coded; 2415 goto not_coded;
2426 } 2416 }
2427 2417
2428 //AC Decoding 2418 //AC Decoding
2490 if(!coded) { 2480 if(!coded) {
2491 int k, scale; 2481 int k, scale;
2492 ac_val = s->ac_val[0][0] + s->block_index[n] * 16; 2482 ac_val = s->ac_val[0][0] + s->block_index[n] * 16;
2493 ac_val2 = ac_val; 2483 ac_val2 = ac_val;
2494 2484
2485 i = 0;
2495 scale = v->pq * 2 + v->halfpq; 2486 scale = v->pq * 2 + v->halfpq;
2496 memset(ac_val2, 0, 16 * 2); 2487 memset(ac_val2, 0, 16 * 2);
2497 if(dc_pred_dir) {//left 2488 if(dc_pred_dir) {//left
2498 ac_val -= 16; 2489 ac_val -= 16;
2499 if(s->ac_pred) 2490 if(s->ac_pred)
2590 } else { 2581 } else {
2591 block[0] = dcdiff * s->c_dc_scale; 2582 block[0] = dcdiff * s->c_dc_scale;
2592 } 2583 }
2593 /* Skip ? */ 2584 /* Skip ? */
2594 run_diff = 0; 2585 run_diff = 0;
2595 i = 0;
2596 2586
2597 //AC Decoding 2587 //AC Decoding
2598 i = 1; 2588 i = 1;
2599 2589
2600 /* check if AC is needed at all */ 2590 /* check if AC is needed at all */
2796 } else { 2786 } else {
2797 block[0] = dcdiff * s->c_dc_scale; 2787 block[0] = dcdiff * s->c_dc_scale;
2798 } 2788 }
2799 /* Skip ? */ 2789 /* Skip ? */
2800 run_diff = 0; 2790 run_diff = 0;
2801 i = 0;
2802 2791
2803 //AC Decoding 2792 //AC Decoding
2804 i = 1; 2793 i = 1;
2805 2794
2806 /* check if AC is needed at all and adjust direction if needed */ 2795 /* check if AC is needed at all and adjust direction if needed */
3437 } 3426 }
3438 if (direct) { 3427 if (direct) {
3439 cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); 3428 cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2);
3440 GET_MQUANT(); 3429 GET_MQUANT();
3441 s->mb_intra = 0; 3430 s->mb_intra = 0;
3442 mb_has_coeffs = 0;
3443 s->current_picture.qscale_table[mb_pos] = mquant; 3431 s->current_picture.qscale_table[mb_pos] = mquant;
3444 if(!v->ttmbf) 3432 if(!v->ttmbf)
3445 ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2); 3433 ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2);
3446 dmv_x[0] = dmv_y[0] = dmv_x[1] = dmv_y[1] = 0; 3434 dmv_x[0] = dmv_y[0] = dmv_x[1] = dmv_y[1] = 0;
3447 vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype); 3435 vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype);