diff options
author | Younes Manton <[email protected]> | 2008-06-28 20:16:01 -0400 |
---|---|---|
committer | Younes Manton <[email protected]> | 2008-06-30 10:11:02 -0400 |
commit | 3933fec6bd62285506fecdc3a254306648cfefb2 (patch) | |
tree | 62e9f0e1832a853d789a67c22f434a56cf5e69be /src/libXvMC/surface.c | |
parent | 0a6aec8c0f2173cfb95ce95d12b66f090ea0ba1f (diff) |
g3dvl: Support for field and frame based MC for progressive pictures.
MC support for frame and field based motion prediction. Also various bug
fixes, clean up.
Diffstat (limited to 'src/libXvMC/surface.c')
-rw-r--r-- | src/libXvMC/surface.c | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/src/libXvMC/surface.c b/src/libXvMC/surface.c index e4602d82042..5656895650e 100644 --- a/src/libXvMC/surface.c +++ b/src/libXvMC/surface.c @@ -32,6 +32,34 @@ static enum VL_PICTURE PictureToVL(int xvmc_pic) return vl_pic; } +static enum VL_MC_TYPE MotionToVL(int xvmc_motion_type) +{ + enum VL_MC_TYPE vl_mc_type; + + switch (xvmc_motion_type) + { + case XVMC_PREDICTION_FRAME: + { + vl_mc_type = VL_FRAME_MC; + break; + } + case XVMC_PREDICTION_FIELD: + { + vl_mc_type = VL_FIELD_MC; + break; + } + case XVMC_PREDICTION_DUAL_PRIME: + { + vl_mc_type = VL_DUAL_PRIME_MC; + break; + } + default: + assert(0); + } + + return vl_mc_type; +} + Status XvMCCreateSurface(Display *display, XvMCContext *context, XvMCSurface *surface) { struct VL_CONTEXT *vl_ctx; @@ -155,7 +183,7 @@ Status XvMCRenderSurface flags == XVMC_SECOND_FIELD ? VL_FIELD_SECOND : VL_FIELD_FIRST, macroblocks->macro_blocks[i].x, macroblocks->macro_blocks[i].y, - macroblocks->macro_blocks[i].motion_type == XVMC_PREDICTION_FRAME ? VL_FIELD_MC : VL_FRAME_MC, + MotionToVL(macroblocks->macro_blocks[i].motion_type), &motion_vector, macroblocks->macro_blocks[i].coded_block_pattern, macroblocks->macro_blocks[i].dct_type == XVMC_DCT_TYPE_FIELD ? VL_DCT_FIELD_CODED : VL_DCT_FRAME_CODED, @@ -188,7 +216,7 @@ Status XvMCRenderSurface flags == XVMC_SECOND_FIELD ? VL_FIELD_SECOND : VL_FIELD_FIRST, macroblocks->macro_blocks[i].x, macroblocks->macro_blocks[i].y, - macroblocks->macro_blocks[i].motion_type == XVMC_PREDICTION_FRAME ? VL_FIELD_MC : VL_FRAME_MC, + MotionToVL(macroblocks->macro_blocks[i].motion_type), &motion_vector, macroblocks->macro_blocks[i].coded_block_pattern, macroblocks->macro_blocks[i].dct_type == XVMC_DCT_TYPE_FIELD ? VL_DCT_FIELD_CODED : VL_DCT_FRAME_CODED, @@ -233,7 +261,7 @@ Status XvMCRenderSurface flags == XVMC_SECOND_FIELD ? VL_FIELD_SECOND : VL_FIELD_FIRST, macroblocks->macro_blocks[i].x, macroblocks->macro_blocks[i].y, - macroblocks->macro_blocks[i].motion_type == XVMC_PREDICTION_FRAME ? VL_FIELD_MC : VL_FRAME_MC, + MotionToVL(macroblocks->macro_blocks[i].motion_type), motion_vector, macroblocks->macro_blocks[i].coded_block_pattern, macroblocks->macro_blocks[i].dct_type == XVMC_DCT_TYPE_FIELD ? VL_DCT_FIELD_CODED : VL_DCT_FRAME_CODED, |