aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-07 03:09:32 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-07 03:10:13 +0100
commitc9fef27deb992066c27255e22bb906015858a098 (patch)
tree055d22e84a4f5a55aa64b5e62aa0359937bd867d
parent08dde7567dea076363e3b9f3d02a738390a698fa (diff)
parent8883b5f85bfe35509633bc590d19b6a1b495690e (diff)
downloadffmpeg-c9fef27deb992066c27255e22bb906015858a098.tar.gz
Merge commit '8883b5f85bfe35509633bc590d19b6a1b495690e' into release/1.1
* commit '8883b5f85bfe35509633bc590d19b6a1b495690e': h264: Fix a typo from the previous commit h264: Lower bound check for slice offsets Add missing header to fix compilation after d2a0654 Prepare for 9.12 RELEASE configure: Add missing dependency of Snow decoder on videodsp rpza: limit the number of blocks to the total remaining blocks in the frame Conflicts: RELEASE Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rwxr-xr-xconfigure2
-rw-r--r--libavcodec/h264.c18
-rw-r--r--libavcodec/h264_loopfilter.c8
-rw-r--r--libavcodec/rpza.c4
4 files changed, 19 insertions, 13 deletions
diff --git a/configure b/configure
index 90fdff81e3..e6077a1917 100755
--- a/configure
+++ b/configure
@@ -1735,7 +1735,7 @@ rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvi
rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo"
shorten_decoder_select="golomb"
sipr_decoder_select="lsp"
-snow_decoder_select="dwt rangecoder"
+snow_decoder_select="dwt rangecoder videodsp"
snow_encoder_select="aandcttables dwt error_resilience mpegvideoenc rangecoder"
sonic_decoder_select="golomb"
sonic_encoder_select="golomb"
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index d7ec5d959a..fbbd4fc18c 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3237,8 +3237,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
get_se_golomb(&s->gb); /* slice_qs_delta */
h->deblocking_filter = 1;
- h->slice_alpha_c0_offset = 52;
- h->slice_beta_offset = 52;
+ h->slice_alpha_c0_offset = 0;
+ h->slice_beta_offset = 0;
if (h->pps.deblocking_filter_parameters_present) {
tmp = get_ue_golomb_31(&s->gb);
if (tmp > 2) {
@@ -3251,10 +3251,12 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
h->deblocking_filter ^= 1; // 1<->0
if (h->deblocking_filter) {
- h->slice_alpha_c0_offset += get_se_golomb(&s->gb) << 1;
- h->slice_beta_offset += get_se_golomb(&s->gb) << 1;
- if (h->slice_alpha_c0_offset > 104U ||
- h->slice_beta_offset > 104U) {
+ h->slice_alpha_c0_offset = get_se_golomb(&s->gb) * 2;
+ h->slice_beta_offset = get_se_golomb(&s->gb) * 2;
+ if (h->slice_alpha_c0_offset > 12 ||
+ h->slice_alpha_c0_offset < -12 ||
+ h->slice_beta_offset > 12 ||
+ h->slice_beta_offset < -12) {
av_log(s->avctx, AV_LOG_ERROR,
"deblocking filter parameters %d %d out of range\n",
h->slice_alpha_c0_offset, h->slice_beta_offset);
@@ -3291,7 +3293,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
}
}
}
- h->qp_thresh = 15 + 52 -
+ h->qp_thresh = 15 -
FFMIN(h->slice_alpha_c0_offset, h->slice_beta_offset) -
FFMAX3(0,
h->pps.chroma_qp_index_offset[0],
@@ -3365,7 +3367,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
h->ref_count[0], h->ref_count[1],
s->qscale,
h->deblocking_filter,
- h->slice_alpha_c0_offset / 2 - 26, h->slice_beta_offset / 2 - 26,
+ h->slice_alpha_c0_offset, h->slice_beta_offset,
h->use_weight,
h->use_weight == 1 && h->use_weight_chroma ? "c" : "",
h->slice_type == AV_PICTURE_TYPE_B ? (h->direct_spatial_mv_pred ? "SPAT" : "TEMP") : "");
diff --git a/libavcodec/h264_loopfilter.c b/libavcodec/h264_loopfilter.c
index 7cd9f69189..cad519d822 100644
--- a/libavcodec/h264_loopfilter.c
+++ b/libavcodec/h264_loopfilter.c
@@ -251,8 +251,8 @@ static av_always_inline void h264_filter_mb_fast_internal(H264Context *h,
int top_type= h->top_type;
int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
- int a = h->slice_alpha_c0_offset - qp_bd_offset;
- int b = h->slice_beta_offset - qp_bd_offset;
+ int a = 52 + h->slice_alpha_c0_offset - qp_bd_offset;
+ int b = 52 + h->slice_beta_offset - qp_bd_offset;
int mb_type = s->current_picture.f.mb_type[mb_xy];
int qp = s->current_picture.f.qscale_table[mb_xy];
@@ -712,8 +712,8 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint
av_unused int dir;
int chroma = CHROMA && !(CONFIG_GRAY && (s->flags&CODEC_FLAG_GRAY));
int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
- int a = h->slice_alpha_c0_offset - qp_bd_offset;
- int b = h->slice_beta_offset - qp_bd_offset;
+ int a = 52 + h->slice_alpha_c0_offset - qp_bd_offset;
+ int b = 52 + h->slice_beta_offset - qp_bd_offset;
if (FRAME_MBAFF
// and current and left pair do not have the same interlaced type
diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c
index 53757f2b31..d41675c58f 100644
--- a/libavcodec/rpza.c
+++ b/libavcodec/rpza.c
@@ -38,8 +38,10 @@
#include <stdlib.h>
#include <string.h>
+#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
+#include "libavutil/common.h"
#include "avcodec.h"
typedef struct RpzaContext {
@@ -126,6 +128,8 @@ static void rpza_decode_stream(RpzaContext *s)
}
}
+ n_blocks = FFMIN(n_blocks, total_blocks);
+
switch (opcode & 0xe0) {
/* Skip blocks */