android/ringlibsdl/project/jni/smpeg2-2.0.0/video/video.cpp
static int ParseSlice( VidStream* vid_stream )
{
  unsigned int data;

  /* Flush slice start code. */

  flush_bits(24);

  /* Parse off slice vertical position. */

  get_bits8(data);
  vid_stream->slice.vert_pos = data;

  /* Parse off quantization scale. */

  get_bits5(data);
  vid_stream->slice.quant_scale = data;

  /* Parse off extra bit slice info. */

  if (vid_stream->slice.extra_info != NULL) {
    free(vid_stream->slice.extra_info);
    vid_stream->slice.extra_info = NULL;
  }
  vid_stream->slice.extra_info = get_extra_bit_info(vid_stream);

  /* Reset past intrablock address. */

  vid_stream->mblock.past_intra_addr = -2;

  /* Reset previous recon motion vectors. */

  vid_stream->mblock.recon_right_for_prev = 0;
  vid_stream->mblock.recon_down_for_prev = 0;
  vid_stream->mblock.recon_right_back_prev = 0;
  vid_stream->mblock.recon_down_back_prev = 0;

  /* Reset macroblock address. */

  vid_stream->mblock.mb_address = ((vid_stream->slice.vert_pos - 1) *
                                   vid_stream->mb_width) - 1;

  /* Reset past dct dc y, cr, and cb values. */

  vid_stream->block.dct_dc_y_past = 1024 << 3;
  vid_stream->block.dct_dc_cr_past = 1024 << 3;
  vid_stream->block.dct_dc_cb_past = 1024 << 3;

  return PARSE_OK;
}
/*
 *--------------------------------------------------------------
 *
 * ParseSlice --
 *
 *      Parses off slice header.
 *
 * Results:
 *      Values found in slice header put into video stream structure.
 *
 * Side effects:
 *      Bit stream irreversibly parsed.
 *
 *--------------------------------------------------------------
 */
ParseSlice
Parses off slice header.

Values found in slice header put into video stream structure.

Side effects:
Bit stream irreversibly parsed.
ParseSlice Parses off slice header . Values found in slice header put into video stream structure . Side effects : Bit stream irreversibly parsed .
static int ParseSlice( VidStream* vid_stream )
{
  unsigned int data;
  flush_bits(24);
  get_bits8(data);
  vid_stream->slice.vert_pos = data;
  get_bits5(data);
  vid_stream->slice.quant_scale = data;
  if (vid_stream->slice.extra_info != NULL) {
    free(vid_stream->slice.extra_info);
    vid_stream->slice.extra_info = NULL;
  }
  vid_stream->slice.extra_info = get_extra_bit_info(vid_stream);
  vid_stream->mblock.past_intra_addr = -2;
  vid_stream->mblock.recon_right_for_prev = 0;
  vid_stream->mblock.recon_down_for_prev = 0;
  vid_stream->mblock.recon_right_back_prev = 0;
  vid_stream->mblock.recon_down_back_prev = 0;
  vid_stream->mblock.mb_address = ((vid_stream->slice.vert_pos - 1) *
                                   vid_stream->mb_width) - 1;
  vid_stream->block.dct_dc_y_past = 1024 << 3;
  vid_stream->block.dct_dc_cr_past = 1024 << 3;
  vid_stream->block.dct_dc_cb_past = 1024 << 3;
  return PARSE_OK;
}
static int ParseSlice ( VidStream * vid_stream ) { unsigned int data ; flush_bits ( 24 ) ; get_bits8 ( data ) ; vid_stream -> slice . vert_pos = data ; get_bits5 ( data ) ; vid_stream -> slice . quant_scale = data ; if ( vid_stream -> slice . extra_info != NULL ) { free ( vid_stream -> slice . extra_info ) ; vid_stream -> slice . extra_info = NULL ; } vid_stream -> slice . extra_info = get_extra_bit_info ( vid_stream ) ; vid_stream -> mblock . past_intra_addr = -2 ; vid_stream -> mblock . recon_right_for_prev = 0 ; vid_stream -> mblock . recon_down_for_prev = 0 ; vid_stream -> mblock . recon_right_back_prev = 0 ; vid_stream -> mblock . recon_down_back_prev = 0 ; vid_stream -> mblock . mb_address = ( ( vid_stream -> slice . vert_pos - 1 ) * vid_stream -> mb_width ) - 1 ; vid_stream -> block . dct_dc_y_past = 1024 << 3 ; vid_stream -> block . dct_dc_cr_past = 1024 << 3 ; vid_stream -> block . dct_dc_cb_past = 1024 << 3 ; return PARSE_OK ; }
ParseSlice
      Parses off slice header.
ParseSlice Parses off slice header .
/* Flush slice start code. */ /* Parse off slice vertical position. */ /* Parse off quantization scale. */ /* Parse off extra bit slice info. */ /* Reset past intrablock address. */ /* Reset previous recon motion vectors. */ /* Reset macroblock address. */ /* Reset past dct dc y, cr, and cb values. */