diff options
author | Julian Scheel <julian@jusst.de> | 2009-02-02 12:31:14 +0000 |
---|---|---|
committer | Julian Scheel <julian@jusst.de> | 2009-02-02 12:31:14 +0000 |
commit | 63cdcee855ddceb0b1bb9bfb81d76593e82d6fdc (patch) | |
tree | de6f28b3193bdd2cb34c6527eac8b2580cc3b83f /src | |
parent | af3278bde6c5c04a99bf8382dec87c8e235cda81 (diff) | |
download | xine-lib-63cdcee855ddceb0b1bb9bfb81d76593e82d6fdc.tar.gz xine-lib-63cdcee855ddceb0b1bb9bfb81d76593e82d6fdc.tar.bz2 |
Replace previous commit with a proper fix taking slc-specific num_ref_idx_*_active values into account. this finally fixes the perfectly standard compliant (c: divx7 samples.
Diffstat (limited to 'src')
-rw-r--r-- | src/libvdpau/h264_parser.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libvdpau/h264_parser.c b/src/libvdpau/h264_parser.c index d088d21f9..141f0d43e 100644 --- a/src/libvdpau/h264_parser.c +++ b/src/libvdpau/h264_parser.c @@ -835,6 +835,10 @@ uint8_t parse_slice_header(struct buf_reader *buf, struct nal_parser *parser) if (slc->slice_type == SLICE_B) slc->direct_spatial_mv_pred_flag = read_bits(buf, 1); + /* take default values in case they are not set here */ + slc->num_ref_idx_l0_active_minus1 = pps->num_ref_idx_l0_active_minus1; + slc->num_ref_idx_l1_active_minus1 = pps->num_ref_idx_l1_active_minus1; + if (slc->slice_type == SLICE_P || slc->slice_type == SLICE_SP || slc->slice_type == SLICE_B) { slc->num_ref_idx_active_override_flag = read_bits(buf, 1); @@ -932,10 +936,7 @@ void parse_pred_weight_table(struct buf_reader *buf, struct nal_unit *nal) nal->slc->pred_weight_table.chroma_log2_weight_denom = read_exp_golomb(buf); int i; - /* FIXME: Being spec-compliant here and loop to num_ref_idx_l0_active_minus1 - * will break Divx7 files. Keep this in mind if any other streams are broken - */ - for (i = 0; i <= 1 /*pps->num_ref_idx_l0_active_minus1*/; i++) { + for (i = 0; i <= pps->num_ref_idx_l0_active_minus1; i++) { uint8_t luma_weight_l0_flag = read_bits(buf, 1); if (luma_weight_l0_flag == 1) { @@ -962,7 +963,7 @@ void parse_pred_weight_table(struct buf_reader *buf, struct nal_unit *nal) /* FIXME: Being spec-compliant here and loop to num_ref_idx_l0_active_minus1 * will break Divx7 files. Keep this in mind if any other streams are broken */ - for (i = 0; i <= 1 /*pps->num_ref_idx_l1_active_minus1*/; i++) { + for (i = 0; i <= pps->num_ref_idx_l1_active_minus1; i++) { uint8_t luma_weight_l1_flag = read_bits(buf, 1); if (luma_weight_l1_flag == 1) { |