android/ringlibsdl/project/jni/smpeg2-2.0.0/video/video.cpp
static void ProcessSkippedPFrameMBlocks( VidStream* vid_stream )
{
  int row_size, half_row, mb_row, mb_col, row, col, rr;
  int addr, row_incr, half_row_incr, crow, ccol;
  int *dest, *src, *dest1, *src1;
#ifndef DISABLE_DITHER
  int ditherType=vid_stream->ditherType;
#endif

  /* Calculate row sizes for luminance and Cr/Cb macroblock areas. */

  row_size = vid_stream->mb_width << 4;
  half_row = (row_size >> 1);
  row_incr = row_size >> 2;
  half_row_incr = half_row >> 2;

  /* For each skipped macroblock, do... */

  for (addr = vid_stream->mblock.past_mb_addr + 1;
       addr < vid_stream->mblock.mb_address; addr++) {

    /* Calculate macroblock row and col. */

    mb_row = addr / vid_stream->mb_width;
    mb_col = addr % vid_stream->mb_width;

    /* Calculate upper left pixel row,col for luminance plane. */

    row = mb_row << 4;
    col = mb_col << 4;

    /* For each row in macroblock luminance plane... */

    dest = (int *)(vid_stream->current->luminance + (row * row_size) + col);
    src = (int *)(vid_stream->future->luminance + (row * row_size) + col);

    for (rr = 0; rr < 8; rr++) {

      /* Copy pixel values from last I or P picture. */

      dest[0] = src[0];
      dest[1] = src[1];
      dest[2] = src[2];
      dest[3] = src[3];
      dest += row_incr;
      src += row_incr;

      dest[0] = src[0];
      dest[1] = src[1];
      dest[2] = src[2];
      dest[3] = src[3];
      dest += row_incr;
      src += row_incr;
    }

    /*
     * Divide row,col to get upper left pixel of macroblock in Cr and Cb
     * planes.
     */

    crow = row >> 1;
    ccol = col >> 1;

    /* For each row in Cr, and Cb planes... */

    dest = (int *)(vid_stream->current->Cr + (crow * half_row) + ccol);
    src = (int *)(vid_stream->future->Cr + (crow * half_row) + ccol);
    dest1 = (int *)(vid_stream->current->Cb + (crow * half_row) + ccol);
    src1 = (int *)(vid_stream->future->Cb + (crow * half_row) + ccol);

    for (rr = 0; rr < 4; rr++) {

      /* Copy pixel values from last I or P picture. */

      dest[0] = src[0];
      dest[1] = src[1];

      dest1[0] = src1[0];
      dest1[1] = src1[1];

      dest += half_row_incr;
      src += half_row_incr;
      dest1 += half_row_incr;
      src1 += half_row_incr;

      dest[0] = src[0];
      dest[1] = src[1];

      dest1[0] = src1[0];
      dest1[1] = src1[1];

      dest += half_row_incr;
      src += half_row_incr;
      dest1 += half_row_incr;
      src1 += half_row_incr;
    }

#ifndef DISABLE_DITHER
    if (ditherType == MBORDERED_DITHER) {
      MBOrderedDitherDisplayCopy(vid_stream, addr,
                                 1, 0, 0, 0, 0, 0,
                                 vid_stream->future->display,
                                 (unsigned char *) NULL);
      vid_stream->ditherFlags[addr] = 0;
    }
#endif
  }

  vid_stream->mblock.recon_right_for_prev = 0;
  vid_stream->mblock.recon_down_for_prev = 0;
}
/*
 *--------------------------------------------------------------
 *
 * ProcessSkippedPFrameMBlocks --
 *
 *    Processes skipped macroblocks in P frames.
 *
 * Results:
 *    Calculates pixel values for luminance, Cr, and Cb planes
 *      in current pict image for skipped macroblocks.
 *
 * Side effects:
 *    Pixel values in pict image changed.
 *
 *--------------------------------------------------------------
 */
ProcessSkippedPFrameMBlocks
Processes skipped macroblocks in P frames.

Calculates pixel values for luminance, Cr, and Cb planes
in current pict image for skipped macroblocks.

Side effects:
Pixel values in pict image changed.
ProcessSkippedPFrameMBlocks Processes skipped macroblocks in P frames . Calculates pixel values for luminance Cr and Cb planes in current pict image for skipped macroblocks . Side effects : Pixel values in pict image changed .
static void ProcessSkippedPFrameMBlocks( VidStream* vid_stream )
{
  int row_size, half_row, mb_row, mb_col, row, col, rr;
  int addr, row_incr, half_row_incr, crow, ccol;
  int *dest, *src, *dest1, *src1;
#ifndef DISABLE_DITHER
  int ditherType=vid_stream->ditherType;
#endif
  row_size = vid_stream->mb_width << 4;
  half_row = (row_size >> 1);
  row_incr = row_size >> 2;
  half_row_incr = half_row >> 2;
  for (addr = vid_stream->mblock.past_mb_addr + 1;
       addr < vid_stream->mblock.mb_address; addr++) {
    mb_row = addr / vid_stream->mb_width;
    mb_col = addr % vid_stream->mb_width;
    row = mb_row << 4;
    col = mb_col << 4;
    dest = (int *)(vid_stream->current->luminance + (row * row_size) + col);
    src = (int *)(vid_stream->future->luminance + (row * row_size) + col);
    for (rr = 0; rr < 8; rr++) {
      dest[0] = src[0];
      dest[1] = src[1];
      dest[2] = src[2];
      dest[3] = src[3];
      dest += row_incr;
      src += row_incr;
      dest[0] = src[0];
      dest[1] = src[1];
      dest[2] = src[2];
      dest[3] = src[3];
      dest += row_incr;
      src += row_incr;
    }
    crow = row >> 1;
    ccol = col >> 1;
    dest = (int *)(vid_stream->current->Cr + (crow * half_row) + ccol);
    src = (int *)(vid_stream->future->Cr + (crow * half_row) + ccol);
    dest1 = (int *)(vid_stream->current->Cb + (crow * half_row) + ccol);
    src1 = (int *)(vid_stream->future->Cb + (crow * half_row) + ccol);
    for (rr = 0; rr < 4; rr++) {
      dest[0] = src[0];
      dest[1] = src[1];
      dest1[0] = src1[0];
      dest1[1] = src1[1];
      dest += half_row_incr;
      src += half_row_incr;
      dest1 += half_row_incr;
      src1 += half_row_incr;
      dest[0] = src[0];
      dest[1] = src[1];
      dest1[0] = src1[0];
      dest1[1] = src1[1];
      dest += half_row_incr;
      src += half_row_incr;
      dest1 += half_row_incr;
      src1 += half_row_incr;
    }
#ifndef DISABLE_DITHER
    if (ditherType == MBORDERED_DITHER) {
      MBOrderedDitherDisplayCopy(vid_stream, addr,
                                 1, 0, 0, 0, 0, 0,
                                 vid_stream->future->display,
                                 (unsigned char *) NULL);
      vid_stream->ditherFlags[addr] = 0;
    }
#endif
  }
  vid_stream->mblock.recon_right_for_prev = 0;
  vid_stream->mblock.recon_down_for_prev = 0;
}
static void ProcessSkippedPFrameMBlocks ( VidStream * vid_stream ) { int row_size , half_row , mb_row , mb_col , row , col , rr ; int addr , row_incr , half_row_incr , crow , ccol ; int * dest , * src , * dest1 , * src1 ; #ifndef DISABLE_DITHER int ditherType = vid_stream -> ditherType ; #endif row_size = vid_stream -> mb_width << 4 ; half_row = ( row_size >> 1 ) ; row_incr = row_size >> 2 ; half_row_incr = half_row >> 2 ; for ( addr = vid_stream -> mblock . past_mb_addr + 1 ; addr < vid_stream -> mblock . mb_address ; addr ++ ) { mb_row = addr / vid_stream -> mb_width ; mb_col = addr % vid_stream -> mb_width ; row = mb_row << 4 ; col = mb_col << 4 ; dest = ( int * ) ( vid_stream -> current -> luminance + ( row * row_size ) + col ) ; src = ( int * ) ( vid_stream -> future -> luminance + ( row * row_size ) + col ) ; for ( rr = 0 ; rr < 8 ; rr ++ ) { dest [ 0 ] = src [ 0 ] ; dest [ 1 ] = src [ 1 ] ; dest [ 2 ] = src [ 2 ] ; dest [ 3 ] = src [ 3 ] ; dest += row_incr ; src += row_incr ; dest [ 0 ] = src [ 0 ] ; dest [ 1 ] = src [ 1 ] ; dest [ 2 ] = src [ 2 ] ; dest [ 3 ] = src [ 3 ] ; dest += row_incr ; src += row_incr ; } crow = row >> 1 ; ccol = col >> 1 ; dest = ( int * ) ( vid_stream -> current -> Cr + ( crow * half_row ) + ccol ) ; src = ( int * ) ( vid_stream -> future -> Cr + ( crow * half_row ) + ccol ) ; dest1 = ( int * ) ( vid_stream -> current -> Cb + ( crow * half_row ) + ccol ) ; src1 = ( int * ) ( vid_stream -> future -> Cb + ( crow * half_row ) + ccol ) ; for ( rr = 0 ; rr < 4 ; rr ++ ) { dest [ 0 ] = src [ 0 ] ; dest [ 1 ] = src [ 1 ] ; dest1 [ 0 ] = src1 [ 0 ] ; dest1 [ 1 ] = src1 [ 1 ] ; dest += half_row_incr ; src += half_row_incr ; dest1 += half_row_incr ; src1 += half_row_incr ; dest [ 0 ] = src [ 0 ] ; dest [ 1 ] = src [ 1 ] ; dest1 [ 0 ] = src1 [ 0 ] ; dest1 [ 1 ] = src1 [ 1 ] ; dest += half_row_incr ; src += half_row_incr ; dest1 += half_row_incr ; src1 += half_row_incr ; } #ifndef DISABLE_DITHER if ( ditherType == MBORDERED_DITHER ) { MBOrderedDitherDisplayCopy ( vid_stream , addr , 1 , 0 , 0 , 0 , 0 , 0 , vid_stream -> future -> display , ( unsigned char * ) NULL ) ; vid_stream -> ditherFlags [ addr ] = 0 ; } #endif } vid_stream -> mblock . recon_right_for_prev = 0 ; vid_stream -> mblock . recon_down_for_prev = 0 ; }
ProcessSkippedPFrameMBlocks
    Processes skipped macroblocks in P frames.
ProcessSkippedPFrameMBlocks Processes skipped macroblocks in P frames .
/* Calculate row sizes for luminance and Cr/Cb macroblock areas. */ /* For each skipped macroblock, do... */ /* Calculate macroblock row and col. */ /* Calculate upper left pixel row,col for luminance plane. */ /* For each row in macroblock luminance plane... */ /* Copy pixel values from last I or P picture. */ /*
     * Divide row,col to get upper left pixel of macroblock in Cr and Cb
     * planes.
     */ /* For each row in Cr, and Cb planes... */ /* Copy pixel values from last I or P picture. */