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

  /* Flush group of pictures start code. */

  flush_bits32;

  /* Parse off drop frame flag. */

  get_bits1(data);
  if (data) {
    vid_stream->group.drop_flag = TRUE;
  } else
    vid_stream->group.drop_flag = FALSE;

  /* Parse off hour component of time code. */

  get_bits5(data);
  vid_stream->group.tc_hours = data;

  /* Parse off minute component of time code. */

  get_bits6(data);
  vid_stream->group.tc_minutes = data;

  /* Flush marker bit. */

  flush_bits(1);

  /* Parse off second component of time code. */

  get_bits6(data);
  vid_stream->group.tc_seconds = data;

  /* Parse off picture count component of time code. */

  get_bits6(data);
  vid_stream->group.tc_pictures = data;

  /* Parse off closed gop and broken link flags. */

  get_bits2(data);
  if (data > 1) {
    vid_stream->group.closed_gop = TRUE;
    if (data > 2) {
      vid_stream->group.broken_link = TRUE;
    } else
      vid_stream->group.broken_link = FALSE;
  } else {
    vid_stream->group.closed_gop = FALSE;
    if (data) {
      vid_stream->group.broken_link = TRUE;
    } else
      vid_stream->group.broken_link = FALSE;
  }

  /* Goto next start code. */

  next_start_code(vid_stream);

  /* If next start code is extension data, parse off extension data. */

  if (next_bits(32, EXT_START_CODE, vid_stream)) {
    flush_bits32;
    if (vid_stream->group.ext_data != NULL) {
      free(vid_stream->group.ext_data);
      vid_stream->group.ext_data = NULL;
    }
    vid_stream->group.ext_data = get_ext_data(vid_stream);
  }
  /* If next start code is user data, parse off user data. */

  if (next_bits(32, USER_START_CODE,vid_stream)) {
    flush_bits32;
    if (vid_stream->group.user_data != NULL) {
      free(vid_stream->group.user_data);
      vid_stream->group.user_data = NULL;
    }
    vid_stream->group.user_data = get_ext_data(vid_stream);
  }
  return PARSE_OK;
}
/*
 *--------------------------------------------------------------
 *
 * ParseGOP --
 *
 *      Parses of group of pictures header from bit stream
 *      associated with vid_stream.
 *
 * Results:
 *      Values in gop header placed into video stream structure.
 *
 * Side effects:
 *      Bit stream irreversibly parsed.
 *
 *--------------------------------------------------------------
 */
ParseGOP
Parses of group of pictures header from bit stream
associated with vid_stream.

Values in gop header placed into video stream structure.

Side effects:
Bit stream irreversibly parsed.
ParseGOP Parses of group of pictures header from bit stream associated with vid_stream . Values in gop header placed into video stream structure . Side effects : Bit stream irreversibly parsed .
static int ParseGOP( VidStream* vid_stream )
{
  unsigned int data;
  flush_bits32;
  get_bits1(data);
  if (data) {
    vid_stream->group.drop_flag = TRUE;
  } else
    vid_stream->group.drop_flag = FALSE;
  get_bits5(data);
  vid_stream->group.tc_hours = data;
  get_bits6(data);
  vid_stream->group.tc_minutes = data;
  flush_bits(1);
  get_bits6(data);
  vid_stream->group.tc_seconds = data;
  get_bits6(data);
  vid_stream->group.tc_pictures = data;
  get_bits2(data);
  if (data > 1) {
    vid_stream->group.closed_gop = TRUE;
    if (data > 2) {
      vid_stream->group.broken_link = TRUE;
    } else
      vid_stream->group.broken_link = FALSE;
  } else {
    vid_stream->group.closed_gop = FALSE;
    if (data) {
      vid_stream->group.broken_link = TRUE;
    } else
      vid_stream->group.broken_link = FALSE;
  }
  next_start_code(vid_stream);
  if (next_bits(32, EXT_START_CODE, vid_stream)) {
    flush_bits32;
    if (vid_stream->group.ext_data != NULL) {
      free(vid_stream->group.ext_data);
      vid_stream->group.ext_data = NULL;
    }
    vid_stream->group.ext_data = get_ext_data(vid_stream);
  }
  if (next_bits(32, USER_START_CODE,vid_stream)) {
    flush_bits32;
    if (vid_stream->group.user_data != NULL) {
      free(vid_stream->group.user_data);
      vid_stream->group.user_data = NULL;
    }
    vid_stream->group.user_data = get_ext_data(vid_stream);
  }
  return PARSE_OK;
}
static int ParseGOP ( VidStream * vid_stream ) { unsigned int data ; flush_bits32 ; get_bits1 ( data ) ; if ( data ) { vid_stream -> group . drop_flag = TRUE ; } else vid_stream -> group . drop_flag = FALSE ; get_bits5 ( data ) ; vid_stream -> group . tc_hours = data ; get_bits6 ( data ) ; vid_stream -> group . tc_minutes = data ; flush_bits ( 1 ) ; get_bits6 ( data ) ; vid_stream -> group . tc_seconds = data ; get_bits6 ( data ) ; vid_stream -> group . tc_pictures = data ; get_bits2 ( data ) ; if ( data > 1 ) { vid_stream -> group . closed_gop = TRUE ; if ( data > 2 ) { vid_stream -> group . broken_link = TRUE ; } else vid_stream -> group . broken_link = FALSE ; } else { vid_stream -> group . closed_gop = FALSE ; if ( data ) { vid_stream -> group . broken_link = TRUE ; } else vid_stream -> group . broken_link = FALSE ; } next_start_code ( vid_stream ) ; if ( next_bits ( 32 , EXT_START_CODE , vid_stream ) ) { flush_bits32 ; if ( vid_stream -> group . ext_data != NULL ) { free ( vid_stream -> group . ext_data ) ; vid_stream -> group . ext_data = NULL ; } vid_stream -> group . ext_data = get_ext_data ( vid_stream ) ; } if ( next_bits ( 32 , USER_START_CODE , vid_stream ) ) { flush_bits32 ; if ( vid_stream -> group . user_data != NULL ) { free ( vid_stream -> group . user_data ) ; vid_stream -> group . user_data = NULL ; } vid_stream -> group . user_data = get_ext_data ( vid_stream ) ; } return PARSE_OK ; }
ParseGOP
      Parses of group of pictures header from bit stream
      associated with vid_stream.
ParseGOP Parses of group of pictures header from bit stream associated with vid_stream .
/* Flush group of pictures start code. */ /* Parse off drop frame flag. */ /* Parse off hour component of time code. */ /* Parse off minute component of time code. */ /* Flush marker bit. */ /* Parse off second component of time code. */ /* Parse off picture count component of time code. */ /* Parse off closed gop and broken link flags. */ /* Goto next start code. */ /* If next start code is extension data, parse off extension data. */ /* If next start code is user data, parse off user data. */