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(); } } }
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(); } } }