Mercurial > libavcodec.hg
comparison cavs.c @ 8796:c6dd98bff427 libavcodec
introduce a macroblock index to avoid a few x*width+y calculations
author | stefang |
---|---|
date | Tue, 10 Feb 2009 22:38:02 +0000 |
parents | e18df4791658 |
children | 0dce4fe6e6f3 |
comparison
equal
deleted
inserted
replaced
8795:e18df4791658 | 8796:c6dd98bff427 |
---|---|
565 /* clear top-left predictors if MB D is not available */ | 565 /* clear top-left predictors if MB D is not available */ |
566 if(!(h->flags & D_AVAIL)) { | 566 if(!(h->flags & D_AVAIL)) { |
567 h->mv[MV_FWD_D3] = ff_cavs_un_mv; | 567 h->mv[MV_FWD_D3] = ff_cavs_un_mv; |
568 h->mv[MV_BWD_D3] = ff_cavs_un_mv; | 568 h->mv[MV_BWD_D3] = ff_cavs_un_mv; |
569 } | 569 } |
570 /* set pointer for co-located macroblock type */ | |
571 h->col_type = &h->col_type_base[h->mby*h->mb_width + h->mbx]; | |
572 } | 570 } |
573 | 571 |
574 /** | 572 /** |
575 * save predictors for later macroblocks and increase | 573 * save predictors for later macroblocks and increase |
576 * macroblock address | 574 * macroblock address |
590 h->top_mv[0][h->mbx*2+0] = h->mv[MV_FWD_X2]; | 588 h->top_mv[0][h->mbx*2+0] = h->mv[MV_FWD_X2]; |
591 h->top_mv[0][h->mbx*2+1] = h->mv[MV_FWD_X3]; | 589 h->top_mv[0][h->mbx*2+1] = h->mv[MV_FWD_X3]; |
592 h->top_mv[1][h->mbx*2+0] = h->mv[MV_BWD_X2]; | 590 h->top_mv[1][h->mbx*2+0] = h->mv[MV_BWD_X2]; |
593 h->top_mv[1][h->mbx*2+1] = h->mv[MV_BWD_X3]; | 591 h->top_mv[1][h->mbx*2+1] = h->mv[MV_BWD_X3]; |
594 /* next MB address */ | 592 /* next MB address */ |
593 h->mbidx++; | |
595 h->mbx++; | 594 h->mbx++; |
596 if(h->mbx == h->mb_width) { //new mb line | 595 if(h->mbx == h->mb_width) { //new mb line |
597 h->flags = B_AVAIL|C_AVAIL; | 596 h->flags = B_AVAIL|C_AVAIL; |
598 /* clear left pred_modes */ | 597 /* clear left pred_modes */ |
599 h->pred_mode_Y[3] = h->pred_mode_Y[6] = NOT_AVAIL; | 598 h->pred_mode_Y[3] = h->pred_mode_Y[6] = NOT_AVAIL; |
635 h->cv = h->picture.data[2]; | 634 h->cv = h->picture.data[2]; |
636 h->l_stride = h->picture.linesize[0]; | 635 h->l_stride = h->picture.linesize[0]; |
637 h->c_stride = h->picture.linesize[1]; | 636 h->c_stride = h->picture.linesize[1]; |
638 h->luma_scan[2] = 8*h->l_stride; | 637 h->luma_scan[2] = 8*h->l_stride; |
639 h->luma_scan[3] = 8*h->l_stride+8; | 638 h->luma_scan[3] = 8*h->l_stride+8; |
640 h->mbx = h->mby = 0; | 639 h->mbx = h->mby = h->mbidx = 0; |
641 h->flags = 0; | 640 h->flags = 0; |
642 } | 641 } |
643 | 642 |
644 /***************************************************************************** | 643 /***************************************************************************** |
645 * | 644 * |