예제 #1
0
파일: header.c 프로젝트: xxthink/rm52j
void extension_data(char *buf,int startcodepos, int length)
{
    int ext_ID;

    memcpy (currStream->streamBuffer, buf, length);
    currStream->code_len = currStream->bitstream_length = length;
    currStream->read_len = currStream->frame_bitoffset = (startcodepos+1)*8;

    ext_ID = u_v(4,"extension ID");

    switch (ext_ID)
    {
    case SEQUENCE_DISPLAY_EXTENSION_ID:
        sequence_display_extension();
        break;
    case COPYRIGHT_EXTENSION_ID:
        copyright_extension();
        break;
    case PICTURE_DISPLAY_EXTENSION_ID:
        picture_display_extension();
    case CAMERAPARAMETERS_EXTENSION_ID:
        cameraparameters_extension();
        break;
    default:
        printf("reserved extension start code ID %d\n",ext_ID);
        break;
    }

}
예제 #2
0
void extension_data(int i)
{
  while (nextbits(8) == EXTENSION_START_CODE)
  {
    zprintf(1, "\nextension_start_code = 0x000001%02X\n", getbits(8));
    if (i == 0)
    {
      if (nextbits(4) == SEQUENCE_DISPLAY_EXTENSION_ID)
        sequence_display_extension();
      if (nextbits(4) == SEQUENCE_SCALABLE_EXTENSION_ID)
        sequence_scalable_extension();
    }
    if (i == 2)
    {
      if (nextbits(4) == QUANT_MATRIX_EXTENSION_ID)
        quant_matrix_extension();
      if (nextbits(4) == PICTURE_DISPLAY_EXTENSION_ID)
        picture_display_extension();
      if (nextbits(4) == PICTURE_SPATIAL_SCALABLE_EXTENSION_ID)
        picture_spatial_scalable_extension();
      if (nextbits(4) == PICTURE_TEMPORAL_SCALABLE_EXTENSION_ID)
        picture_temporal_scalable_extension();
    }
  }
}
예제 #3
0
static void ext_user_data()
{
  int code,ext_ID;

  startcode();

  while ((code = showbits(32))==EXT_START_CODE || code==USER_START_CODE)
  {
    if (code==EXT_START_CODE)
    {
      flushbits32();
      ext_ID = getbits(4);
      switch (ext_ID)
      {
      case SEQ_ID:
        sequence_extension();
        break;
      case DISP_ID:
        sequence_display_extension();
        break;
      case QUANT_ID:
        quant_matrix_extension();
        break;
      case SEQSCAL_ID:
        sequence_scalable_extension();
        break;
      case PANSCAN_ID:
        picture_display_extension();
        break;
      case CODING_ID:
        picture_coding_extension();
        break;
      case SPATSCAL_ID:
        picture_spatial_scalable_extension();
        break;
      case TEMPSCAL_ID:
        picture_temporal_scalable_extension();
        break;
      default:
        fprintf(stderr,"reserved extension start code ID %d\n",ext_ID);
        break;
      }
      startcode();
    }
    else
    {
      if (verbose)
        printf("user data\n");
      flushbits32();
      startcode();
    }
  }
}