From 1c5f264787b1c1cf67e5e71d08b8d8b03b0c8248 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 11 Oct 2017 05:57:59 +0200 Subject: [PATCH 1/2] mss1: Add missing macro parameters to ARITH_GET_* macros It is wrong to pass no arguments to a macro that expects one argument and some compilers complain. --- libavcodec/mss1.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c index a31af06e73..6679a1c1f7 100644 --- a/libavcodec/mss1.c +++ b/libavcodec/mss1.c @@ -34,7 +34,7 @@ typedef struct MSS1Context { SliceContext sc; } MSS1Context; -static void arith_normalise(ArithCoder *c) +static void arith1_normalise(ArithCoder *c) { for (;;) { if (c->high >= 0x8000) { @@ -60,7 +60,7 @@ static void arith_normalise(ArithCoder *c) } } -ARITH_GET_BIT() +ARITH_GET_BIT(1) static int arith_get_bits(ArithCoder *c, int bits) { @@ -71,7 +71,7 @@ static int arith_get_bits(ArithCoder *c, int bits) c->high = ((prob + range) >> bits) + c->low - 1; c->low += prob >> bits; - arith_normalise(c); + arith1_normalise(c); return val; } @@ -85,12 +85,12 @@ static int arith_get_number(ArithCoder *c, int mod_val) c->high = (prob + range) / mod_val + c->low - 1; c->low += prob / mod_val; - arith_normalise(c); + arith1_normalise(c); return val; } -static int arith_get_prob(ArithCoder *c, int16_t *probs) +static int arith1_get_prob(ArithCoder *c, int16_t *probs) { int range = c->high - c->low + 1; int val = ((c->value - c->low + 1) * probs[0] - 1) / range; @@ -105,7 +105,7 @@ static int arith_get_prob(ArithCoder *c, int16_t *probs) return sym; } -ARITH_GET_MODEL_SYM() +ARITH_GET_MODEL_SYM(1) static void arith_init(ArithCoder *c, GetBitContext *gb) { @@ -113,7 +113,7 @@ static void arith_init(ArithCoder *c, GetBitContext *gb) c->high = 0xFFFF; c->value = get_bits(gb, 16); c->gbc.gb = gb; - c->get_model_sym = arith_get_model_sym; + c->get_model_sym = arith1_get_model_sym; c->get_number = arith_get_number; } @@ -158,7 +158,7 @@ static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, c->pal_pic = ctx->pic->data[0] + ctx->pic->linesize[0] * (avctx->height - 1); c->pal_stride = -ctx->pic->linesize[0]; - c->keyframe = !arith_get_bit(&acoder); + c->keyframe = !arith1_get_bit(&acoder); if (c->keyframe) { c->corrupted = 0; ff_mss12_slicecontext_reset(&ctx->sc); From fbd63170bcbc5cad8965edad7c357f6eb4132250 Mon Sep 17 00:00:00 2001 From: Mark Thompson Date: Mon, 16 Oct 2017 23:02:24 +0100 Subject: [PATCH 2/2] cbs: Add test dependencies Fixes the MPEG-2 failure with --disable-error-resilience. --- tests/fate/cbs.mak | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/fate/cbs.mak b/tests/fate/cbs.mak index afd5c5dd8f..fc5967e6f3 100644 --- a/tests/fate/cbs.mak +++ b/tests/fate/cbs.mak @@ -4,6 +4,8 @@ fate-cbs: fate-cbs-h264 fate-cbs-hevc fate-cbs-mpeg2 +FATE_CBS_DEPS = $(call ALLYES, $(1)_DEMUXER $(1)_PARSER $(2)_METADATA_BSF $(3)_DECODER $(3)_MUXER) + define FATE_CBS_TEST # (codec, test_name, sample_file, output_format) FATE_CBS_$(1) += fate-cbs-$(1)-$(2) @@ -30,8 +32,9 @@ FATE_CBS_H264_SAMPLES = \ $(foreach N,$(FATE_CBS_H264_SAMPLES),$(eval $(call FATE_CBS_TEST,h264,$(basename $(N)),h264-conformance/$(N),h264))) -FATE_SAMPLES_AVCONV += $(FATE_CBS_h264) -fate-cbs-h264: $(FATE_CBS_h264) +FATE_CBS_H264-$(call FATE_CBS_DEPS, H264, H264, H264) = $(FATE_CBS_h264) +FATE_SAMPLES_AVCONV += $(FATE_CBS_H264-yes) +fate-cbs-h264: $(FATE_CBS_H264-yes) # H.265 read/write @@ -58,8 +61,9 @@ FATE_CBS_HEVC_SAMPLES = \ $(foreach N,$(FATE_CBS_HEVC_SAMPLES),$(eval $(call FATE_CBS_TEST,hevc,$(basename $(N)),hevc-conformance/$(N),hevc))) -FATE_SAMPLES_AVCONV += $(FATE_CBS_hevc) -fate-cbs-hevc: $(FATE_CBS_hevc) +FATE_CBS_HEVC-$(call FATE_CBS_DEPS, HEVC, HEVC, HEVC) = $(FATE_CBS_hevc) +FATE_SAMPLES_AVCONV += $(FATE_CBS_HEVC-yes) +fate-cbs-hevc: $(FATE_CBS_HEVC-yes) # MPEG-2 read/write @@ -70,5 +74,6 @@ FATE_CBS_MPEG2_SAMPLES = \ $(foreach N,$(FATE_CBS_MPEG2_SAMPLES),$(eval $(call FATE_CBS_TEST,mpeg2,$(basename $(N)),mpeg2/$(N),mpeg2video))) -FATE_SAMPLES_AVCONV += $(FATE_CBS_mpeg2) -fate-cbs-mpeg2: $(FATE_CBS_mpeg2) +FATE_CBS_MPEG2-$(call FATE_CBS_DEPS, MPEGVIDEO, MPEG2, MPEG2VIDEO) = $(FATE_CBS_mpeg2) +FATE_SAMPLES_AVCONV += $(FATE_CBS_MPEG2-yes) +fate-cbs-mpeg2: $(FATE_CBS_MPEG2-yes)