diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/video_dec/libvdpau/alterh264_decode.c | 30 | ||||
-rw-r--r-- | src/video_dec/libvdpau/h264_parser.c | 6 | ||||
-rw-r--r-- | src/video_dec/libvdpau/vdpau_h264.c | 2 | ||||
-rw-r--r-- | src/video_dec/libvdpau/vdpau_mpeg12.c | 27 | ||||
-rw-r--r-- | src/video_dec/libvdpau/vdpau_mpeg4.c | 1 | ||||
-rw-r--r-- | src/video_dec/libvdpau/vdpau_vc1.c | 19 |
6 files changed, 69 insertions, 16 deletions
diff --git a/src/video_dec/libvdpau/alterh264_decode.c b/src/video_dec/libvdpau/alterh264_decode.c index f11162f3e..6c93e0a32 100644 --- a/src/video_dec/libvdpau/alterh264_decode.c +++ b/src/video_dec/libvdpau/alterh264_decode.c @@ -290,11 +290,13 @@ dbp_append (vdpau_h264_alter_decoder_t * this_gen, int second_field) int max = sp->num_ref_frames ? sp->num_ref_frames : 1; max = (max > MAX_DPB_SIZE) ? MAX_DPB_SIZE : max; +#ifdef LOG vo_frame_t *vo = (vo_frame_t *) cur_pic->videoSurface; vdpau_accel_t *accel = (vdpau_accel_t *) vo->accel_data; lprintf ("|||||||||||||||||||||||||||||||||||||||| dbp_append surface = %d\n", accel->surface); +#endif if (second_field) { @@ -1061,14 +1063,14 @@ ref_pic_list_reordering (vdpau_h264_alter_decoder_t * this_gen) { if (read_bits (&seq->br, 1)) { - uint32_t tmp, diff; + uint32_t tmp/*, diff*/; do { tmp = read_exp_ue (&seq->br); if (tmp == 0 || tmp == 1) - diff = read_exp_ue (&seq->br); + /*diff =*/ read_exp_ue (&seq->br); else if (tmp == 2) - diff = read_exp_ue (&seq->br); + /*diff =*/ read_exp_ue (&seq->br); } while (tmp != 3 && !seq->br.oflow); } @@ -1077,14 +1079,14 @@ ref_pic_list_reordering (vdpau_h264_alter_decoder_t * this_gen) { if (read_bits (&seq->br, 1)) { - uint32_t tmp2, diff2; + uint32_t tmp2/*, diff2*/; do { tmp2 = read_exp_ue (&seq->br); if (tmp2 == 0 || tmp2 == 1) - diff2 = read_exp_ue (&seq->br); + /*diff2 =*/ read_exp_ue (&seq->br); else if (tmp2 == 2) - diff2 = read_exp_ue (&seq->br); + /*diff2 =*/ read_exp_ue (&seq->br); } while (tmp2 != 3 && !seq->br.oflow); } @@ -1101,11 +1103,15 @@ dec_ref_pic_marking (vdpau_h264_alter_decoder_t * this_gen, uint8_t idr) if (idr) { +#ifdef LOG uint8_t no_output_of_prior_pics_flag = read_bits (&seq->br, 1); lprintf ("no_output_of_prior_pics_flag = %u\n", no_output_of_prior_pics_flag); uint8_t long_term_reference_flag = read_bits (&seq->br, 1); lprintf ("long_term_reference_flag = %u\n", long_term_reference_flag); +#else + skip_bits (&seq->br, 2); +#endif } else { @@ -1144,20 +1150,32 @@ dec_ref_pic_marking (vdpau_h264_alter_decoder_t * this_gen, uint8_t idr) } if (memory_management_control_operation == 2) { +#ifdef LOG uint32_t long_term_pic_num = read_exp_ue (&seq->br); lprintf ("long_term_pic_num = %u\n", long_term_pic_num); +#else + read_exp_ue (&seq->br); +#endif } if (memory_management_control_operation == 3 || memory_management_control_operation == 6) { +#ifdef LOG uint32_t long_term_frame_idx = read_exp_ue (&seq->br); lprintf ("long_term_frame_idx = %u\n", long_term_frame_idx); +#else + read_exp_ue (&seq->br); +#endif } if (memory_management_control_operation == 4) { +#ifdef LOG uint32_t max_long_term_frame_idx_plus1 = read_exp_ue (&seq->br); lprintf ("max_long_term_frame_idx_plus1 = %u\n", max_long_term_frame_idx_plus1); +#else + read_exp_ue (&seq->br); +#endif } } while (memory_management_control_operation && !seq->br.oflow); diff --git a/src/video_dec/libvdpau/h264_parser.c b/src/video_dec/libvdpau/h264_parser.c index d495bf483..01033e2cc 100644 --- a/src/video_dec/libvdpau/h264_parser.c +++ b/src/video_dec/libvdpau/h264_parser.c @@ -109,6 +109,7 @@ void parse_dec_ref_pic_marking(struct buf_reader *buf, /* here goes the parser implementation */ +#if 0 static void decode_nal(uint8_t **ret, int *len_ret, uint8_t *buf, int buf_len) { // TODO: rework without copying @@ -130,6 +131,7 @@ static void decode_nal(uint8_t **ret, int *len_ret, uint8_t *buf, int buf_len) *len_ret = pos - *ret; } +#endif #if 0 static inline void dump_bits(const char *label, const struct buf_reader *buf, int bits) @@ -269,8 +271,8 @@ struct nal_unit* parse_nal_header(struct buf_reader *buf, buf->cur_pos = buf->buf + 1; //lprintf("NAL: %d\n", nal->nal_unit_type); - struct buf_reader ibuf; - ibuf.cur_offset = 8; + //struct buf_reader ibuf; + //ibuf.cur_offset = 8; switch (nal->nal_unit_type) { case NAL_SPS: diff --git a/src/video_dec/libvdpau/vdpau_h264.c b/src/video_dec/libvdpau/vdpau_h264.c index 25ed62295..17dd536ff 100644 --- a/src/video_dec/libvdpau/vdpau_h264.c +++ b/src/video_dec/libvdpau/vdpau_h264.c @@ -804,7 +804,7 @@ static void vdpau_h264_decode_data (video_decoder_t *this_gen, */ static void vdpau_h264_flush (video_decoder_t *this_gen) { vdpau_h264_decoder_t *this = (vdpau_h264_decoder_t*) this_gen; - struct decoded_picture *decoded_pic = NULL; + //struct decoded_picture *decoded_pic = NULL; if(this->dangling_img){ this->dangling_img->free(this->dangling_img); diff --git a/src/video_dec/libvdpau/vdpau_mpeg12.c b/src/video_dec/libvdpau/vdpau_mpeg12.c index 1067f8634..4121cfb06 100644 --- a/src/video_dec/libvdpau/vdpau_mpeg12.c +++ b/src/video_dec/libvdpau/vdpau_mpeg12.c @@ -289,6 +289,7 @@ static void sequence_header( vdpau_mpeg12_decoder_t *this_gen, uint8_t *buf, int lprintf( "aspect_ratio_information: %d\n", sequence->aspect_ratio_information ); sequence->frame_rate_code = read_bits( &sequence->br, 4 ); lprintf( "frame_rate_code: %d\n", sequence->frame_rate_code ); +#ifdef LOG int tmp; tmp = read_bits( &sequence->br, 18 ); lprintf( "bit_rate_value: %d\n", tmp ); @@ -298,6 +299,9 @@ static void sequence_header( vdpau_mpeg12_decoder_t *this_gen, uint8_t *buf, int lprintf( "vbv_buffer_size_value: %d\n", tmp ); tmp = read_bits( &sequence->br, 1 ); lprintf( "constrained_parameters_flag: %d\n", tmp ); +#else + skip_bits(&sequence->br, 30); +#endif i = read_bits( &sequence->br, 1 ); lprintf( "load_intra_quantizer_matrix: %d\n", i ); if ( i ) { @@ -444,8 +448,12 @@ static void picture_header( vdpau_mpeg12_decoder_t *this_gen, uint8_t *buf, int } bits_reader_set( &sequence->br, buf, len ); +#ifdef LOG int tmp = read_bits( &sequence->br, 10 ); lprintf( "temporal_reference: %d\n", tmp ); +#else + skip_bits( &sequence->br, 10 ); +#endif infos->picture_coding_type = read_bits( &sequence->br, 3 ); lprintf( "picture_coding_type: %d\n", infos->picture_coding_type ); infos->forward_reference = VDP_INVALID_HANDLE; @@ -470,9 +478,13 @@ static void picture_header( vdpau_mpeg12_decoder_t *this_gen, uint8_t *buf, int static void sequence_extension( sequence_t *sequence, uint8_t *buf, int len ) { bits_reader_set( &sequence->br, buf, len ); +#ifdef LOG int tmp = read_bits( &sequence->br, 4 ); lprintf( "extension_start_code_identifier: %d\n", tmp ); skip_bits( &sequence->br, 1 ); +#else + skip_bits( &sequence->br, 5 ); +#endif switch ( read_bits( &sequence->br, 3 ) ) { case 5: sequence->profile = VDP_DECODER_PROFILE_MPEG2_SIMPLE; break; default: sequence->profile = VDP_DECODER_PROFILE_MPEG2_MAIN; @@ -482,6 +494,7 @@ static void sequence_extension( sequence_t *sequence, uint8_t *buf, int len ) lprintf( "progressive_sequence: %d\n", sequence->progressive_sequence ); if ( read_bits( &sequence->br, 2 ) == 2 ) sequence->chroma = VO_CHROMA_422; +#ifdef LOG tmp = read_bits( &sequence->br, 2 ); lprintf( "horizontal_size_extension: %d\n", tmp ); tmp = read_bits( &sequence->br, 2 ); @@ -494,6 +507,9 @@ static void sequence_extension( sequence_t *sequence, uint8_t *buf, int len ) lprintf( "vbv_buffer_size_extension: %d\n", tmp ); tmp = read_bits( &sequence->br, 1 ); lprintf( "low_delay: %d\n", tmp ); +#else + skip_bits( &sequence->br, 26 ); +#endif sequence->frame_rate_extension_n = read_bits( &sequence->br, 2 ); lprintf( "frame_rate_extension_n: %d\n", sequence->frame_rate_extension_n ); sequence->frame_rate_extension_d = read_bits( &sequence->br, 5 ); @@ -509,8 +525,12 @@ static void picture_coding_extension( sequence_t *sequence, uint8_t *buf, int le infos = &sequence->picture.vdp_infos2; bits_reader_set( &sequence->br, buf, len ); +#ifdef LOG int tmp = read_bits( &sequence->br, 4 ); lprintf( "extension_start_code_identifier: %d\n", tmp ); +#else + skip_bits( &sequence->br, 4 ); +#endif infos->f_code[0][0] = read_bits( &sequence->br, 4 ); infos->f_code[0][1] = read_bits( &sequence->br, 4 ); infos->f_code[1][0] = read_bits( &sequence->br, 4 ); @@ -537,8 +557,12 @@ static void picture_coding_extension( sequence_t *sequence, uint8_t *buf, int le lprintf( "alternate_scan: %d\n", infos->alternate_scan ); sequence->picture.repeat_first_field = read_bits( &sequence->br, 1 ); lprintf( "repeat_first_field: %d\n", sequence->picture.repeat_first_field ); +#ifdef LOG tmp = read_bits( &sequence->br, 1 ); lprintf( "chroma_420_type: %d\n", tmp ); +#else + skip_bits( &sequence->br, 1 ); +#endif sequence->picture.progressive_frame = read_bits( &sequence->br, 1 ); lprintf( "progressive_frame: %d\n", sequence->picture.progressive_frame ); } @@ -688,6 +712,7 @@ static void decode_render( vdpau_mpeg12_decoder_t *vd, vdpau_accel_t *accel ) vbit.bitstream = pic->slices; vbit.bitstream_bytes = (pic->vdp_infos.picture_structure==PICTURE_FRAME)? pic->slices_pos : pic->slices_pos_top; st = accel->vdp_decoder_render( vd->decoder, accel->surface, (VdpPictureInfo*)&pic->vdp_infos, 1, &vbit ); +#ifdef LOG if ( st!=VDP_STATUS_OK ) lprintf( "decoder failed : %d!! %s\n", st, accel->vdp_get_error_string( st ) ); else { @@ -698,6 +723,7 @@ static void decode_render( vdpau_mpeg12_decoder_t *vd, vdpau_accel_t *accel ) info->intra_vlc_format, info->alternate_scan, info->q_scale_type, info->top_field_first, info->full_pel_forward_vector, info->full_pel_backward_vector, info->f_code[0][0], info->f_code[0][1], info->f_code[1][0], info->f_code[1][1] ); } +#endif if ( pic->vdp_infos.picture_structure != PICTURE_FRAME ) { pic->vdp_infos2.backward_reference = VDP_INVALID_HANDLE; @@ -937,7 +963,6 @@ static void vdpau_mpeg12_decode_data (video_decoder_t *this_gen, buf_element_t * * This function is called when xine needs to flush the system. */ static void vdpau_mpeg12_flush (video_decoder_t *this_gen) { - vdpau_mpeg12_decoder_t *this = (vdpau_mpeg12_decoder_t *) this_gen; lprintf( "vdpau_mpeg12_flush\n" ); } diff --git a/src/video_dec/libvdpau/vdpau_mpeg4.c b/src/video_dec/libvdpau/vdpau_mpeg4.c index 4d7dee1ed..70c0ed4bc 100644 --- a/src/video_dec/libvdpau/vdpau_mpeg4.c +++ b/src/video_dec/libvdpau/vdpau_mpeg4.c @@ -1027,7 +1027,6 @@ static void vdpau_mpeg4_decode_data (video_decoder_t *this_gen, buf_element_t *b * This function is called when xine needs to flush the system. */ static void vdpau_mpeg4_flush (video_decoder_t *this_gen) { - vdpau_mpeg4_decoder_t *this = (vdpau_mpeg4_decoder_t *) this_gen; lprintf( "vdpau_mpeg4_flush\n" ); } diff --git a/src/video_dec/libvdpau/vdpau_vc1.c b/src/video_dec/libvdpau/vdpau_vc1.c index fe6ce26b4..67e908c47 100644 --- a/src/video_dec/libvdpau/vdpau_vc1.c +++ b/src/video_dec/libvdpau/vdpau_vc1.c @@ -288,8 +288,12 @@ static void sequence_header_advanced( vdpau_vc1_decoder_t *this_gen, uint8_t *bu if ( read_bits( &sequence->br, 1 ) ) { if ( read_bits( &sequence->br, 1 ) ) { +#ifdef LOG int exp = read_bits( &sequence->br, 16 ); lprintf("framerate exp = %d\n", exp); +#else + skip_bits( &sequence->br, 16 ); +#endif } else { double nr = read_bits( &sequence->br, 8 ); @@ -311,9 +315,13 @@ static void sequence_header_advanced( vdpau_vc1_decoder_t *this_gen, uint8_t *bu } } if ( read_bits( &sequence->br, 1 ) ) { +#ifdef LOG int col = read_bits( &sequence->br, 8 ); lprintf("color_standard = %d\n", col); skip_bits( &sequence->br, 16 ); +#else + skip_bits( &sequence->br, 24 ); +#endif } } sequence->picture.hrd_param_flag = read_bits( &sequence->br, 1 ); @@ -409,7 +417,7 @@ static void entry_point( vdpau_vc1_decoder_t *this_gen, uint8_t *buf, int len ) static void picture_header( vdpau_vc1_decoder_t *this_gen, uint8_t *buf, int len ) { sequence_t *sequence = (sequence_t*)&this_gen->sequence; - picture_t *pic = (picture_t*)&sequence->picture; + //picture_t *pic = (picture_t*)&sequence->picture; VdpPictureInfoVC1 *info = &(sequence->picture.vdp_infos); int tmp; @@ -661,11 +669,13 @@ static void decode_render( vdpau_vc1_decoder_t *vd, vdpau_accel_t *accel, uint8_ lprintf( "DECODER SUCCESS : slices=%d, slices_bytes=%d, current=%d, forwref:%d, backref:%d, pts:%lld\n", pic->vdp_infos.slice_count, vbit.bitstream_bytes, accel->surface, pic->vdp_infos.forward_reference, pic->vdp_infos.backward_reference, seq->seq_pts ); } +#ifdef LOG VdpPictureInfoVC1 *info = &(seq->picture.vdp_infos); lprintf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", info->slice_count, info->picture_type, info->frame_coding_mode, info->postprocflag, info->pulldown, info->interlace, info->tfcntrflag, info->finterpflag, info->psf, info->dquant, info->panscan_flag, info->refdist_flag, info->quantizer, info->extended_mv, info->extended_dmv, info->overlap, info->vstransform, info->loopfilter, info->fastuvmc, info->range_mapy_flag, info->range_mapy, info->range_mapuv_flag, info->range_mapuv, info->multires, info->syncmarker, info->rangered, info->maxbframes, info->deblockEnable, info->pquant ); +#endif if ( pic->field ) { int old_type = pic->vdp_infos.picture_type; @@ -701,11 +711,13 @@ static void decode_render( vdpau_vc1_decoder_t *vd, vdpau_accel_t *accel, uint8_ lprintf( "DECODER SUCCESS (second field): slices=%d, slices_bytes=%d, current=%d, forwref:%d, backref:%d, pts:%lld\n", pic->vdp_infos.slice_count, vbit.bitstream_bytes, accel->surface, pic->vdp_infos.forward_reference, pic->vdp_infos.backward_reference, seq->seq_pts ); } +#ifdef LOG VdpPictureInfoVC1 *info = &(seq->picture.vdp_infos); lprintf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", info->slice_count, info->picture_type, info->frame_coding_mode, info->postprocflag, info->pulldown, info->interlace, info->tfcntrflag, info->finterpflag, info->psf, info->dquant, info->panscan_flag, info->refdist_flag, info->quantizer, info->extended_mv, info->extended_dmv, info->overlap, info->vstransform, info->loopfilter, info->fastuvmc, info->range_mapy_flag, info->range_mapy, info->range_mapuv_flag, info->range_mapuv, info->multires, info->syncmarker, info->rangered, info->maxbframes, info->deblockEnable, info->pquant ); +#endif pic->vdp_infos.picture_type = old_type; } @@ -973,11 +985,10 @@ static void vdpau_vc1_decode_data (video_decoder_t *this_gen, buf_element_t *buf return; } - int res, startcode=0; + int res; while ( seq->bufseek <= seq->bufpos-4 ) { uint8_t *buffer = seq->buf+seq->bufseek; if ( buffer[0]==0 && buffer[1]==0 && buffer[2]==1 ) { - startcode = 1; seq->current_code = buffer[3]; lprintf("current_code = %d\n", seq->current_code); if ( seq->start<0 ) { @@ -1015,7 +1026,6 @@ static void vdpau_vc1_decode_data (video_decoder_t *this_gen, buf_element_t *buf * This function is called when xine needs to flush the system. */ static void vdpau_vc1_flush (video_decoder_t *this_gen) { - vdpau_vc1_decoder_t *this = (vdpau_vc1_decoder_t *) this_gen; lprintf( "vdpau_vc1_flush\n" ); } @@ -1034,7 +1044,6 @@ static void vdpau_vc1_reset (video_decoder_t *this_gen) { * The decoder should forget any stored pts values here. */ static void vdpau_vc1_discontinuity (video_decoder_t *this_gen) { - vdpau_vc1_decoder_t *this = (vdpau_vc1_decoder_t *) this_gen; lprintf( "vdpau_vc1_discontinuity\n" ); } |