static void ddl_getdec_profilelevel(struct ddl_decoder_data *decoder, u32 profile, u32 level) { enum vcd_codec_profile codec_profile = VCD_PROFILE_UNKNOWN; enum vcd_codec_level codec_level = VCD_LEVEL_UNKNOWN; switch (decoder->codec.codec) { case VCD_CODEC_MPEG4: { if (profile == VIDC_720P_PROFILE_MPEG4_SP) codec_profile = VCD_PROFILE_MPEG4_SP; else if (profile == VIDC_720P_PROFILE_MPEG4_ASP) codec_profile = VCD_PROFILE_MPEG4_ASP; ddl_getmpeg4_declevel(&codec_level, level); break; } case VCD_CODEC_H264: { if (profile == VIDC_720P_PROFILE_H264_BASELINE) codec_profile = VCD_PROFILE_H264_BASELINE; else if (profile == VIDC_720P_PROFILE_H264_MAIN) codec_profile = VCD_PROFILE_H264_MAIN; else if (profile == VIDC_720P_PROFILE_H264_HIGH) codec_profile = VCD_PROFILE_H264_HIGH; ddl_geth264_declevel(&codec_level, level); break; } default: case VCD_CODEC_H263: { break; } case VCD_CODEC_VC1: case VCD_CODEC_VC1_RCV: { if (profile == VIDC_720P_PROFILE_VC1_SP) codec_profile = VCD_PROFILE_VC1_SIMPLE; else if (profile == VIDC_720P_PROFILE_VC1_MAIN) codec_profile = VCD_PROFILE_VC1_MAIN; else if (profile == VIDC_720P_PROFILE_VC1_ADV) codec_profile = VCD_PROFILE_VC1_ADVANCE; ddl_get_vc1_dec_level(&codec_level, level, profile); break; } case VCD_CODEC_MPEG2: { if (profile == VIDC_720P_PROFILE_MPEG2_MAIN) codec_profile = VCD_PROFILE_MPEG2_MAIN; else if (profile == VIDC_720P_PROFILE_MPEG2_SP) codec_profile = VCD_PROFILE_MPEG2_SIMPLE; ddl_get_mpeg2_dec_level(&codec_level, level); break; } } decoder->profile.profile = codec_profile; decoder->level.level = codec_level; }
static void ddl_getdec_profilelevel(struct ddl_decoder_data_type *p_decoder, u32 n_profile, u32 n_level) { enum vcd_codec_profile_type profile = VCD_PROFILE_UNKNOWN; enum vcd_codec_level_type level = VCD_LEVEL_UNKNOWN; switch (p_decoder->codec_type.e_codec) { case VCD_CODEC_MPEG4: { if (n_profile == VIDC_720P_PROFILE_MPEG4_SP) profile = VCD_PROFILE_MPEG4_SP; else if (n_profile == VIDC_720P_PROFILE_MPEG4_ASP) profile = VCD_PROFILE_MPEG4_ASP; ddl_getmpeg4_declevel(&level, n_level); break; } case VCD_CODEC_H264: { if (n_profile == VIDC_720P_PROFILE_H264_BASELINE) profile = VCD_PROFILE_H264_BASELINE; else if (n_profile == VIDC_720P_PROFILE_H264_MAIN) profile = VCD_PROFILE_H264_MAIN; else if (n_profile == VIDC_720P_PROFILE_H264_HIGH) profile = VCD_PROFILE_H264_HIGH; ddl_geth264_declevel(&level, n_level); break; } default: case VCD_CODEC_H263: { break; } case VCD_CODEC_VC1: case VCD_CODEC_VC1_RCV: { if (n_profile == VIDC_720P_PROFILE_VC1_SP) profile = VCD_PROFILE_VC1_SIMPLE; else if (n_profile == VIDC_720P_PROFILE_VC1_MAIN) profile = VCD_PROFILE_VC1_MAIN; else if (n_profile == VIDC_720P_PROFILE_VC1_ADV) profile = VCD_PROFILE_VC1_ADVANCE; ddl_get_vc1_dec_level(&level, n_level, profile); break; } case VCD_CODEC_MPEG2: { if (n_profile == VIDC_720P_PROFILE_MPEG2_MAIN) profile = VCD_PROFILE_MPEG2_MAIN; else if (n_profile == VIDC_720P_PROFILE_MPEG2_SP) profile = VCD_PROFILE_MPEG2_SIMPLE; ddl_get_mpeg2_dec_level(&level, n_level); break; } } p_decoder->profile.e_profile = profile; p_decoder->level.e_level = level; }