00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00028 #include "libavutil/imgutils.h"
00029 #include "internal.h"
00030 #include "dsputil.h"
00031 #include "avcodec.h"
00032 #include "h264.h"
00033 #include "h264data.h"
00034 #include "golomb.h"
00035
00036
00037
00038 #include <assert.h>
00039
00040 static const AVRational pixel_aspect[17]={
00041 {0, 1},
00042 {1, 1},
00043 {12, 11},
00044 {10, 11},
00045 {16, 11},
00046 {40, 33},
00047 {24, 11},
00048 {20, 11},
00049 {32, 11},
00050 {80, 33},
00051 {18, 11},
00052 {15, 11},
00053 {64, 33},
00054 {160,99},
00055 {4, 3},
00056 {3, 2},
00057 {2, 1},
00058 };
00059
00060 const uint8_t ff_h264_chroma_qp[52]={
00061 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,
00062 12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,
00063 28,29,29,30,31,32,32,33,34,34,35,35,36,36,37,37,
00064 37,38,38,38,39,39,39,39
00065 };
00066
00067 static const uint8_t default_scaling4[2][16]={
00068 { 6,13,20,28,
00069 13,20,28,32,
00070 20,28,32,37,
00071 28,32,37,42
00072 },{
00073 10,14,20,24,
00074 14,20,24,27,
00075 20,24,27,30,
00076 24,27,30,34
00077 }};
00078
00079 static const uint8_t default_scaling8[2][64]={
00080 { 6,10,13,16,18,23,25,27,
00081 10,11,16,18,23,25,27,29,
00082 13,16,18,23,25,27,29,31,
00083 16,18,23,25,27,29,31,33,
00084 18,23,25,27,29,31,33,36,
00085 23,25,27,29,31,33,36,38,
00086 25,27,29,31,33,36,38,40,
00087 27,29,31,33,36,38,40,42
00088 },{
00089 9,13,15,17,19,21,22,24,
00090 13,13,17,19,21,22,24,25,
00091 15,17,19,21,22,24,25,27,
00092 17,19,21,22,24,25,27,28,
00093 19,21,22,24,25,27,28,30,
00094 21,22,24,25,27,28,30,32,
00095 22,24,25,27,28,30,32,33,
00096 24,25,27,28,30,32,33,35
00097 }};
00098
00099 static inline int decode_hrd_parameters(H264Context *h, SPS *sps){
00100 MpegEncContext * const s = &h->s;
00101 int cpb_count, i;
00102 cpb_count = get_ue_golomb_31(&s->gb) + 1;
00103
00104 if(cpb_count > 32U){
00105 av_log(h->s.avctx, AV_LOG_ERROR, "cpb_count %d invalid\n", cpb_count);
00106 return -1;
00107 }
00108
00109 get_bits(&s->gb, 4);
00110 get_bits(&s->gb, 4);
00111 for(i=0; i<cpb_count; i++){
00112 get_ue_golomb(&s->gb);
00113 get_ue_golomb(&s->gb);
00114 get_bits1(&s->gb);
00115 }
00116 sps->initial_cpb_removal_delay_length = get_bits(&s->gb, 5) + 1;
00117 sps->cpb_removal_delay_length = get_bits(&s->gb, 5) + 1;
00118 sps->dpb_output_delay_length = get_bits(&s->gb, 5) + 1;
00119 sps->time_offset_length = get_bits(&s->gb, 5);
00120 sps->cpb_cnt = cpb_count;
00121 return 0;
00122 }
00123
00124 static inline int decode_vui_parameters(H264Context *h, SPS *sps){
00125 MpegEncContext * const s = &h->s;
00126 int aspect_ratio_info_present_flag;
00127 unsigned int aspect_ratio_idc;
00128
00129 aspect_ratio_info_present_flag= get_bits1(&s->gb);
00130
00131 if( aspect_ratio_info_present_flag ) {
00132 aspect_ratio_idc= get_bits(&s->gb, 8);
00133 if( aspect_ratio_idc == EXTENDED_SAR ) {
00134 sps->sar.num= get_bits(&s->gb, 16);
00135 sps->sar.den= get_bits(&s->gb, 16);
00136 }else if(aspect_ratio_idc < FF_ARRAY_ELEMS(pixel_aspect)){
00137 sps->sar= pixel_aspect[aspect_ratio_idc];
00138 }else{
00139 av_log(h->s.avctx, AV_LOG_ERROR, "illegal aspect ratio\n");
00140 return -1;
00141 }
00142 }else{
00143 sps->sar.num=
00144 sps->sar.den= 0;
00145 }
00146
00147
00148 if(get_bits1(&s->gb)){
00149 get_bits1(&s->gb);
00150 }
00151
00152 sps->video_signal_type_present_flag = get_bits1(&s->gb);
00153 if(sps->video_signal_type_present_flag){
00154 get_bits(&s->gb, 3);
00155 sps->full_range = get_bits1(&s->gb);
00156
00157 sps->colour_description_present_flag = get_bits1(&s->gb);
00158 if(sps->colour_description_present_flag){
00159 sps->color_primaries = get_bits(&s->gb, 8);
00160 sps->color_trc = get_bits(&s->gb, 8);
00161 sps->colorspace = get_bits(&s->gb, 8);
00162 if (sps->color_primaries >= AVCOL_PRI_NB)
00163 sps->color_primaries = AVCOL_PRI_UNSPECIFIED;
00164 if (sps->color_trc >= AVCOL_TRC_NB)
00165 sps->color_trc = AVCOL_TRC_UNSPECIFIED;
00166 if (sps->colorspace >= AVCOL_SPC_NB)
00167 sps->colorspace = AVCOL_SPC_UNSPECIFIED;
00168 }
00169 }
00170
00171 if(get_bits1(&s->gb)){
00172 s->avctx->chroma_sample_location = get_ue_golomb(&s->gb)+1;
00173 get_ue_golomb(&s->gb);
00174 }
00175
00176 sps->timing_info_present_flag = get_bits1(&s->gb);
00177 if(sps->timing_info_present_flag){
00178 sps->num_units_in_tick = get_bits_long(&s->gb, 32);
00179 sps->time_scale = get_bits_long(&s->gb, 32);
00180 if(!sps->num_units_in_tick || !sps->time_scale){
00181 av_log(h->s.avctx, AV_LOG_ERROR, "time_scale/num_units_in_tick invalid or unsupported (%d/%d)\n", sps->time_scale, sps->num_units_in_tick);
00182 return -1;
00183 }
00184 sps->fixed_frame_rate_flag = get_bits1(&s->gb);
00185 }
00186
00187 sps->nal_hrd_parameters_present_flag = get_bits1(&s->gb);
00188 if(sps->nal_hrd_parameters_present_flag)
00189 if(decode_hrd_parameters(h, sps) < 0)
00190 return -1;
00191 sps->vcl_hrd_parameters_present_flag = get_bits1(&s->gb);
00192 if(sps->vcl_hrd_parameters_present_flag)
00193 if(decode_hrd_parameters(h, sps) < 0)
00194 return -1;
00195 if(sps->nal_hrd_parameters_present_flag || sps->vcl_hrd_parameters_present_flag)
00196 get_bits1(&s->gb);
00197 sps->pic_struct_present_flag = get_bits1(&s->gb);
00198
00199 sps->bitstream_restriction_flag = get_bits1(&s->gb);
00200 if(sps->bitstream_restriction_flag){
00201 get_bits1(&s->gb);
00202 get_ue_golomb(&s->gb);
00203 get_ue_golomb(&s->gb);
00204 get_ue_golomb(&s->gb);
00205 get_ue_golomb(&s->gb);
00206 sps->num_reorder_frames= get_ue_golomb(&s->gb);
00207 get_ue_golomb(&s->gb);
00208
00209 if(s->gb.size_in_bits < get_bits_count(&s->gb)){
00210 av_log(h->s.avctx, AV_LOG_ERROR, "Overread VUI by %d bits\n", get_bits_count(&s->gb) - s->gb.size_in_bits);
00211 sps->num_reorder_frames=0;
00212 sps->bitstream_restriction_flag= 0;
00213 }
00214
00215 if(sps->num_reorder_frames > 16U ){
00216 av_log(h->s.avctx, AV_LOG_ERROR, "illegal num_reorder_frames %d\n", sps->num_reorder_frames);
00217 return -1;
00218 }
00219 }
00220
00221 return 0;
00222 }
00223
00224 static void decode_scaling_list(H264Context *h, uint8_t *factors, int size,
00225 const uint8_t *jvt_list, const uint8_t *fallback_list){
00226 MpegEncContext * const s = &h->s;
00227 int i, last = 8, next = 8;
00228 const uint8_t *scan = size == 16 ? zigzag_scan : ff_zigzag_direct;
00229 if(!get_bits1(&s->gb))
00230 memcpy(factors, fallback_list, size*sizeof(uint8_t));
00231 else
00232 for(i=0;i<size;i++){
00233 if(next)
00234 next = (last + get_se_golomb(&s->gb)) & 0xff;
00235 if(!i && !next){
00236 memcpy(factors, jvt_list, size*sizeof(uint8_t));
00237 break;
00238 }
00239 last = factors[scan[i]] = next ? next : last;
00240 }
00241 }
00242
00243 static void decode_scaling_matrices(H264Context *h, SPS *sps, PPS *pps, int is_sps,
00244 uint8_t (*scaling_matrix4)[16], uint8_t (*scaling_matrix8)[64]){
00245 MpegEncContext * const s = &h->s;
00246 int fallback_sps = !is_sps && sps->scaling_matrix_present;
00247 const uint8_t *fallback[4] = {
00248 fallback_sps ? sps->scaling_matrix4[0] : default_scaling4[0],
00249 fallback_sps ? sps->scaling_matrix4[3] : default_scaling4[1],
00250 fallback_sps ? sps->scaling_matrix8[0] : default_scaling8[0],
00251 fallback_sps ? sps->scaling_matrix8[1] : default_scaling8[1]
00252 };
00253 if(get_bits1(&s->gb)){
00254 sps->scaling_matrix_present |= is_sps;
00255 decode_scaling_list(h,scaling_matrix4[0],16,default_scaling4[0],fallback[0]);
00256 decode_scaling_list(h,scaling_matrix4[1],16,default_scaling4[0],scaling_matrix4[0]);
00257 decode_scaling_list(h,scaling_matrix4[2],16,default_scaling4[0],scaling_matrix4[1]);
00258 decode_scaling_list(h,scaling_matrix4[3],16,default_scaling4[1],fallback[1]);
00259 decode_scaling_list(h,scaling_matrix4[4],16,default_scaling4[1],scaling_matrix4[3]);
00260 decode_scaling_list(h,scaling_matrix4[5],16,default_scaling4[1],scaling_matrix4[4]);
00261 if(is_sps || pps->transform_8x8_mode){
00262 decode_scaling_list(h,scaling_matrix8[0],64,default_scaling8[0],fallback[2]);
00263 decode_scaling_list(h,scaling_matrix8[1],64,default_scaling8[1],fallback[3]);
00264 }
00265 }
00266 }
00267
00268 int ff_h264_decode_seq_parameter_set(H264Context *h){
00269 MpegEncContext * const s = &h->s;
00270 int profile_idc, level_idc, constraint_set_flags = 0;
00271 unsigned int sps_id;
00272 int i;
00273 SPS *sps;
00274
00275 profile_idc= get_bits(&s->gb, 8);
00276 constraint_set_flags |= get_bits1(&s->gb) << 0;
00277 constraint_set_flags |= get_bits1(&s->gb) << 1;
00278 constraint_set_flags |= get_bits1(&s->gb) << 2;
00279 constraint_set_flags |= get_bits1(&s->gb) << 3;
00280 get_bits(&s->gb, 4);
00281 level_idc= get_bits(&s->gb, 8);
00282 sps_id= get_ue_golomb_31(&s->gb);
00283
00284 if(sps_id >= MAX_SPS_COUNT) {
00285 av_log(h->s.avctx, AV_LOG_ERROR, "sps_id (%d) out of range\n", sps_id);
00286 return -1;
00287 }
00288 sps= av_mallocz(sizeof(SPS));
00289 if(sps == NULL)
00290 return -1;
00291
00292 sps->time_offset_length = 24;
00293 sps->profile_idc= profile_idc;
00294 sps->constraint_set_flags = constraint_set_flags;
00295 sps->level_idc= level_idc;
00296
00297 memset(sps->scaling_matrix4, 16, sizeof(sps->scaling_matrix4));
00298 memset(sps->scaling_matrix8, 16, sizeof(sps->scaling_matrix8));
00299 sps->scaling_matrix_present = 0;
00300
00301 if(sps->profile_idc >= 100){
00302 sps->chroma_format_idc= get_ue_golomb_31(&s->gb);
00303 if(sps->chroma_format_idc == 3)
00304 sps->residual_color_transform_flag = get_bits1(&s->gb);
00305 sps->bit_depth_luma = get_ue_golomb(&s->gb) + 8;
00306 sps->bit_depth_chroma = get_ue_golomb(&s->gb) + 8;
00307 sps->transform_bypass = get_bits1(&s->gb);
00308 decode_scaling_matrices(h, sps, NULL, 1, sps->scaling_matrix4, sps->scaling_matrix8);
00309 }else{
00310 sps->chroma_format_idc= 1;
00311 sps->bit_depth_luma = 8;
00312 sps->bit_depth_chroma = 8;
00313 }
00314
00315 sps->log2_max_frame_num= get_ue_golomb(&s->gb) + 4;
00316 sps->poc_type= get_ue_golomb_31(&s->gb);
00317
00318 if(sps->poc_type == 0){
00319 sps->log2_max_poc_lsb= get_ue_golomb(&s->gb) + 4;
00320 } else if(sps->poc_type == 1){
00321 sps->delta_pic_order_always_zero_flag= get_bits1(&s->gb);
00322 sps->offset_for_non_ref_pic= get_se_golomb(&s->gb);
00323 sps->offset_for_top_to_bottom_field= get_se_golomb(&s->gb);
00324 sps->poc_cycle_length = get_ue_golomb(&s->gb);
00325
00326 if((unsigned)sps->poc_cycle_length >= FF_ARRAY_ELEMS(sps->offset_for_ref_frame)){
00327 av_log(h->s.avctx, AV_LOG_ERROR, "poc_cycle_length overflow %u\n", sps->poc_cycle_length);
00328 goto fail;
00329 }
00330
00331 for(i=0; i<sps->poc_cycle_length; i++)
00332 sps->offset_for_ref_frame[i]= get_se_golomb(&s->gb);
00333 }else if(sps->poc_type != 2){
00334 av_log(h->s.avctx, AV_LOG_ERROR, "illegal POC type %d\n", sps->poc_type);
00335 goto fail;
00336 }
00337
00338 sps->ref_frame_count= get_ue_golomb_31(&s->gb);
00339 if(sps->ref_frame_count > MAX_PICTURE_COUNT-2 || sps->ref_frame_count >= 32U){
00340 av_log(h->s.avctx, AV_LOG_ERROR, "too many reference frames\n");
00341 goto fail;
00342 }
00343 sps->gaps_in_frame_num_allowed_flag= get_bits1(&s->gb);
00344 sps->mb_width = get_ue_golomb(&s->gb) + 1;
00345 sps->mb_height= get_ue_golomb(&s->gb) + 1;
00346 if((unsigned)sps->mb_width >= INT_MAX/16 || (unsigned)sps->mb_height >= INT_MAX/16 ||
00347 av_image_check_size(16*sps->mb_width, 16*sps->mb_height, 0, h->s.avctx)){
00348 av_log(h->s.avctx, AV_LOG_ERROR, "mb_width/height overflow\n");
00349 goto fail;
00350 }
00351
00352 sps->frame_mbs_only_flag= get_bits1(&s->gb);
00353 if(!sps->frame_mbs_only_flag)
00354 sps->mb_aff= get_bits1(&s->gb);
00355 else
00356 sps->mb_aff= 0;
00357
00358 sps->direct_8x8_inference_flag= get_bits1(&s->gb);
00359 if(!sps->frame_mbs_only_flag && !sps->direct_8x8_inference_flag){
00360 av_log(h->s.avctx, AV_LOG_ERROR, "This stream was generated by a broken encoder, invalid 8x8 inference\n");
00361 goto fail;
00362 }
00363
00364 #ifndef ALLOW_INTERLACE
00365 if(sps->mb_aff)
00366 av_log(h->s.avctx, AV_LOG_ERROR, "MBAFF support not included; enable it at compile-time.\n");
00367 #endif
00368 sps->crop= get_bits1(&s->gb);
00369 if(sps->crop){
00370 sps->crop_left = get_ue_golomb(&s->gb);
00371 sps->crop_right = get_ue_golomb(&s->gb);
00372 sps->crop_top = get_ue_golomb(&s->gb);
00373 sps->crop_bottom= get_ue_golomb(&s->gb);
00374 if(sps->crop_left || sps->crop_top){
00375 av_log(h->s.avctx, AV_LOG_ERROR, "insane cropping not completely supported, this could look slightly wrong ...\n");
00376 }
00377 if(sps->crop_right >= 8 || sps->crop_bottom >= 8){
00378 av_log(h->s.avctx, AV_LOG_ERROR, "brainfart cropping not supported, this could look slightly wrong ...\n");
00379 }
00380 }else{
00381 sps->crop_left =
00382 sps->crop_right =
00383 sps->crop_top =
00384 sps->crop_bottom= 0;
00385 }
00386
00387 sps->vui_parameters_present_flag= get_bits1(&s->gb);
00388 if( sps->vui_parameters_present_flag )
00389 if (decode_vui_parameters(h, sps) < 0)
00390 goto fail;
00391
00392 if(!sps->sar.den)
00393 sps->sar.den= 1;
00394
00395 if(s->avctx->debug&FF_DEBUG_PICT_INFO){
00396 av_log(h->s.avctx, AV_LOG_DEBUG, "sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%d/%d/%d/%d %s %s %d/%d\n",
00397 sps_id, sps->profile_idc, sps->level_idc,
00398 sps->poc_type,
00399 sps->ref_frame_count,
00400 sps->mb_width, sps->mb_height,
00401 sps->frame_mbs_only_flag ? "FRM" : (sps->mb_aff ? "MB-AFF" : "PIC-AFF"),
00402 sps->direct_8x8_inference_flag ? "8B8" : "",
00403 sps->crop_left, sps->crop_right,
00404 sps->crop_top, sps->crop_bottom,
00405 sps->vui_parameters_present_flag ? "VUI" : "",
00406 ((const char*[]){"Gray","420","422","444"})[sps->chroma_format_idc],
00407 sps->timing_info_present_flag ? sps->num_units_in_tick : 0,
00408 sps->timing_info_present_flag ? sps->time_scale : 0
00409 );
00410 }
00411
00412 av_free(h->sps_buffers[sps_id]);
00413 h->sps_buffers[sps_id]= sps;
00414 h->sps = *sps;
00415 return 0;
00416 fail:
00417 av_free(sps);
00418 return -1;
00419 }
00420
00421 static void
00422 build_qp_table(PPS *pps, int t, int index)
00423 {
00424 int i;
00425 for(i = 0; i < 52; i++)
00426 pps->chroma_qp_table[t][i] = ff_h264_chroma_qp[av_clip(i + index, 0, 51)];
00427 }
00428
00429 int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length){
00430 MpegEncContext * const s = &h->s;
00431 unsigned int pps_id= get_ue_golomb(&s->gb);
00432 PPS *pps;
00433
00434 if(pps_id >= MAX_PPS_COUNT) {
00435 av_log(h->s.avctx, AV_LOG_ERROR, "pps_id (%d) out of range\n", pps_id);
00436 return -1;
00437 }
00438
00439 pps= av_mallocz(sizeof(PPS));
00440 if(pps == NULL)
00441 return -1;
00442 pps->sps_id= get_ue_golomb_31(&s->gb);
00443 if((unsigned)pps->sps_id>=MAX_SPS_COUNT || h->sps_buffers[pps->sps_id] == NULL){
00444 av_log(h->s.avctx, AV_LOG_ERROR, "sps_id out of range\n");
00445 goto fail;
00446 }
00447
00448 pps->cabac= get_bits1(&s->gb);
00449 pps->pic_order_present= get_bits1(&s->gb);
00450 pps->slice_group_count= get_ue_golomb(&s->gb) + 1;
00451 if(pps->slice_group_count > 1 ){
00452 pps->mb_slice_group_map_type= get_ue_golomb(&s->gb);
00453 av_log(h->s.avctx, AV_LOG_ERROR, "FMO not supported\n");
00454 switch(pps->mb_slice_group_map_type){
00455 case 0:
00456 #if 0
00457 | for( i = 0; i <= num_slice_groups_minus1; i++ ) | | |
00458 | run_length[ i ] |1 |ue(v) |
00459 #endif
00460 break;
00461 case 2:
00462 #if 0
00463 | for( i = 0; i < num_slice_groups_minus1; i++ ) | | |
00464 |{ | | |
00465 | top_left_mb[ i ] |1 |ue(v) |
00466 | bottom_right_mb[ i ] |1 |ue(v) |
00467 | } | | |
00468 #endif
00469 break;
00470 case 3:
00471 case 4:
00472 case 5:
00473 #if 0
00474 | slice_group_change_direction_flag |1 |u(1) |
00475 | slice_group_change_rate_minus1 |1 |ue(v) |
00476 #endif
00477 break;
00478 case 6:
00479 #if 0
00480 | slice_group_id_cnt_minus1 |1 |ue(v) |
00481 | for( i = 0; i <= slice_group_id_cnt_minus1; i++ | | |
00482 |) | | |
00483 | slice_group_id[ i ] |1 |u(v) |
00484 #endif
00485 break;
00486 }
00487 }
00488 pps->ref_count[0]= get_ue_golomb(&s->gb) + 1;
00489 pps->ref_count[1]= get_ue_golomb(&s->gb) + 1;
00490 if(pps->ref_count[0]-1 > 32-1 || pps->ref_count[1]-1 > 32-1){
00491 av_log(h->s.avctx, AV_LOG_ERROR, "reference overflow (pps)\n");
00492 goto fail;
00493 }
00494
00495 pps->weighted_pred= get_bits1(&s->gb);
00496 pps->weighted_bipred_idc= get_bits(&s->gb, 2);
00497 pps->init_qp= get_se_golomb(&s->gb) + 26;
00498 pps->init_qs= get_se_golomb(&s->gb) + 26;
00499 pps->chroma_qp_index_offset[0]= get_se_golomb(&s->gb);
00500 pps->deblocking_filter_parameters_present= get_bits1(&s->gb);
00501 pps->constrained_intra_pred= get_bits1(&s->gb);
00502 pps->redundant_pic_cnt_present = get_bits1(&s->gb);
00503
00504 pps->transform_8x8_mode= 0;
00505 h->dequant_coeff_pps= -1;
00506 memcpy(pps->scaling_matrix4, h->sps_buffers[pps->sps_id]->scaling_matrix4, sizeof(pps->scaling_matrix4));
00507 memcpy(pps->scaling_matrix8, h->sps_buffers[pps->sps_id]->scaling_matrix8, sizeof(pps->scaling_matrix8));
00508
00509 if(get_bits_count(&s->gb) < bit_length){
00510 pps->transform_8x8_mode= get_bits1(&s->gb);
00511 decode_scaling_matrices(h, h->sps_buffers[pps->sps_id], pps, 0, pps->scaling_matrix4, pps->scaling_matrix8);
00512 pps->chroma_qp_index_offset[1]= get_se_golomb(&s->gb);
00513 } else {
00514 pps->chroma_qp_index_offset[1]= pps->chroma_qp_index_offset[0];
00515 }
00516
00517 build_qp_table(pps, 0, pps->chroma_qp_index_offset[0]);
00518 build_qp_table(pps, 1, pps->chroma_qp_index_offset[1]);
00519 if(pps->chroma_qp_index_offset[0] != pps->chroma_qp_index_offset[1])
00520 pps->chroma_qp_diff= 1;
00521
00522 if(s->avctx->debug&FF_DEBUG_PICT_INFO){
00523 av_log(h->s.avctx, AV_LOG_DEBUG, "pps:%u sps:%u %s slice_groups:%d ref:%d/%d %s qp:%d/%d/%d/%d %s %s %s %s\n",
00524 pps_id, pps->sps_id,
00525 pps->cabac ? "CABAC" : "CAVLC",
00526 pps->slice_group_count,
00527 pps->ref_count[0], pps->ref_count[1],
00528 pps->weighted_pred ? "weighted" : "",
00529 pps->init_qp, pps->init_qs, pps->chroma_qp_index_offset[0], pps->chroma_qp_index_offset[1],
00530 pps->deblocking_filter_parameters_present ? "LPAR" : "",
00531 pps->constrained_intra_pred ? "CONSTR" : "",
00532 pps->redundant_pic_cnt_present ? "REDU" : "",
00533 pps->transform_8x8_mode ? "8x8DCT" : ""
00534 );
00535 }
00536
00537 av_free(h->pps_buffers[pps_id]);
00538 h->pps_buffers[pps_id]= pps;
00539 return 0;
00540 fail:
00541 av_free(pps);
00542 return -1;
00543 }