comparison vc1.c @ 3691:ff18ceefe3d8 libavcodec

[Cosmetics] Remove if(profile < PROFILE_ADVANCED) from decode_sequence_header() as it's always true and reindent code inside by the way.
author kostya
date Sat, 09 Sep 2006 11:28:02 +0000
parents 35aae593db08
children 7857ae840b0b
comparison
equal deleted inserted replaced
3690:35aae593db08 3691:ff18ceefe3d8
1162 { 1162 {
1163 av_log(avctx, AV_LOG_ERROR, 1163 av_log(avctx, AV_LOG_ERROR,
1164 "LOOPFILTER shell not be enabled in simple profile\n"); 1164 "LOOPFILTER shell not be enabled in simple profile\n");
1165 } 1165 }
1166 1166
1167 if (v->profile < PROFILE_ADVANCED) 1167 v->res_x8 = get_bits(gb, 1); //reserved
1168 if (v->res_x8)
1168 { 1169 {
1169 v->res_x8 = get_bits(gb, 1); //reserved 1170 av_log(avctx, AV_LOG_ERROR,
1170 if (v->res_x8) 1171 "1 for reserved RES_X8 is forbidden\n");
1171 { 1172 //return -1;
1172 av_log(avctx, AV_LOG_ERROR, 1173 }
1173 "1 for reserved RES_X8 is forbidden\n"); 1174 v->multires = get_bits(gb, 1);
1174 //return -1; 1175 v->res_fasttx = get_bits(gb, 1);
1175 } 1176 if (!v->res_fasttx)
1176 v->multires = get_bits(gb, 1); 1177 {
1177 v->res_fasttx = get_bits(gb, 1); 1178 av_log(avctx, AV_LOG_ERROR,
1178 if (!v->res_fasttx) 1179 "0 for reserved RES_FASTTX is forbidden\n");
1179 { 1180 //return -1;
1180 av_log(avctx, AV_LOG_ERROR,
1181 "0 for reserved RES_FASTTX is forbidden\n");
1182 //return -1;
1183 }
1184 } 1181 }
1185 1182
1186 v->fastuvmc = get_bits(gb, 1); //common 1183 v->fastuvmc = get_bits(gb, 1); //common
1187 if (!v->profile && !v->fastuvmc) 1184 if (!v->profile && !v->fastuvmc)
1188 { 1185 {
1198 return -1; 1195 return -1;
1199 } 1196 }
1200 v->dquant = get_bits(gb, 2); //common 1197 v->dquant = get_bits(gb, 2); //common
1201 v->vstransform = get_bits(gb, 1); //common 1198 v->vstransform = get_bits(gb, 1); //common
1202 1199
1203 if (v->profile < PROFILE_ADVANCED) 1200 v->res_transtab = get_bits(gb, 1);
1201 if (v->res_transtab)
1204 { 1202 {
1205 v->res_transtab = get_bits(gb, 1); 1203 av_log(avctx, AV_LOG_ERROR,
1206 if (v->res_transtab) 1204 "1 for reserved RES_TRANSTAB is forbidden\n");
1207 { 1205 return -1;
1208 av_log(avctx, AV_LOG_ERROR,
1209 "1 for reserved RES_TRANSTAB is forbidden\n");
1210 return -1;
1211 }
1212 } 1206 }
1213 1207
1214 v->overlap = get_bits(gb, 1); //common 1208 v->overlap = get_bits(gb, 1); //common
1215 1209
1216 if (v->profile < PROFILE_ADVANCED) 1210 v->s.resync_marker = get_bits(gb, 1);
1211 v->rangered = get_bits(gb, 1);
1212 if (v->rangered && v->profile == PROFILE_SIMPLE)
1217 { 1213 {
1218 v->s.resync_marker = get_bits(gb, 1); 1214 av_log(avctx, AV_LOG_INFO,
1219 v->rangered = get_bits(gb, 1); 1215 "RANGERED should be set to 0 in simple profile\n");
1220 if (v->rangered && v->profile == PROFILE_SIMPLE)
1221 {
1222 av_log(avctx, AV_LOG_INFO,
1223 "RANGERED should be set to 0 in simple profile\n");
1224 }
1225 } 1216 }
1226 1217
1227 v->s.max_b_frames = avctx->max_b_frames = get_bits(gb, 3); //common 1218 v->s.max_b_frames = avctx->max_b_frames = get_bits(gb, 3); //common
1228 v->quantizer_mode = get_bits(gb, 2); //common 1219 v->quantizer_mode = get_bits(gb, 2); //common
1229 1220
1230 if (v->profile < PROFILE_ADVANCED) 1221 v->finterpflag = get_bits(gb, 1); //common
1222 v->res_rtm_flag = get_bits(gb, 1); //reserved
1223 if (!v->res_rtm_flag)
1231 { 1224 {
1232 v->finterpflag = get_bits(gb, 1); //common
1233 v->res_rtm_flag = get_bits(gb, 1); //reserved
1234 if (!v->res_rtm_flag)
1235 {
1236 // av_log(avctx, AV_LOG_ERROR, 1225 // av_log(avctx, AV_LOG_ERROR,
1237 // "0 for reserved RES_RTM_FLAG is forbidden\n"); 1226 // "0 for reserved RES_RTM_FLAG is forbidden\n");
1238 av_log(avctx, AV_LOG_ERROR, 1227 av_log(avctx, AV_LOG_ERROR,
1239 "Old WMV3 version detected, only I-frames will be decoded\n"); 1228 "Old WMV3 version detected, only I-frames will be decoded\n");
1240 //return -1; 1229 //return -1;
1241 } 1230 }
1242 av_log(avctx, AV_LOG_DEBUG, 1231 av_log(avctx, AV_LOG_DEBUG,
1243 "Profile %i:\nfrmrtq_postproc=%i, bitrtq_postproc=%i\n" 1232 "Profile %i:\nfrmrtq_postproc=%i, bitrtq_postproc=%i\n"
1244 "LoopFilter=%i, MultiRes=%i, FastUVMC=%i, Extended MV=%i\n" 1233 "LoopFilter=%i, MultiRes=%i, FastUVMC=%i, Extended MV=%i\n"
1245 "Rangered=%i, VSTransform=%i, Overlap=%i, SyncMarker=%i\n" 1234 "Rangered=%i, VSTransform=%i, Overlap=%i, SyncMarker=%i\n"
1246 "DQuant=%i, Quantizer mode=%i, Max B frames=%i\n", 1235 "DQuant=%i, Quantizer mode=%i, Max B frames=%i\n",
1247 v->profile, v->frmrtq_postproc, v->bitrtq_postproc, 1236 v->profile, v->frmrtq_postproc, v->bitrtq_postproc,
1248 v->s.loop_filter, v->multires, v->fastuvmc, v->extended_mv, 1237 v->s.loop_filter, v->multires, v->fastuvmc, v->extended_mv,
1249 v->rangered, v->vstransform, v->overlap, v->s.resync_marker, 1238 v->rangered, v->vstransform, v->overlap, v->s.resync_marker,
1250 v->dquant, v->quantizer_mode, avctx->max_b_frames 1239 v->dquant, v->quantizer_mode, avctx->max_b_frames
1251 ); 1240 );
1252 return 0; 1241 return 0;
1253 }
1254 return -1;
1255 } 1242 }
1256 1243
1257 static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb) 1244 static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
1258 { 1245 {
1259 v->res_rtm_flag = 1; 1246 v->res_rtm_flag = 1;