From 2d5fd7886a29b36e696d01ee777c886b421f4eb2 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sun, 5 May 2013 20:51:52 +0200 Subject: [PATCH 1/2] bgmc: Do not mark ff_bgmc_decode_init() as av_cold The function is possibly called once per block. --- libavcodec/bgmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/bgmc.c b/libavcodec/bgmc.c index c0ebcacb04..c7f732e7bb 100644 --- a/libavcodec/bgmc.c +++ b/libavcodec/bgmc.c @@ -485,8 +485,8 @@ av_cold void ff_bgmc_end(uint8_t **cf_lut, int **cf_lut_status) /** Initialize decoding and reads the first value */ -av_cold void ff_bgmc_decode_init(GetBitContext *gb, unsigned int *h, - unsigned int *l, unsigned int *v) +void ff_bgmc_decode_init(GetBitContext *gb, unsigned int *h, + unsigned int *l, unsigned int *v) { *h = TOP_VALUE; *l = 0; From 46c1917350f58dfab84e41919e6c02d43950db8c Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Sat, 4 May 2013 12:47:15 +0200 Subject: [PATCH 2/2] nut: use a define for the nut version Ease switching version in the future and make evident why that value. --- libavformat/nut.h | 2 ++ libavformat/nutdec.c | 2 +- libavformat/nutenc.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/nut.h b/libavformat/nut.h index 89b0248fa4..8e5767d97d 100644 --- a/libavformat/nut.h +++ b/libavformat/nut.h @@ -39,6 +39,8 @@ #define MAX_DISTANCE (1024*32-1) +#define NUT_VERSION 3 + typedef enum{ FLAG_KEY = 1, ///= 2 && tmp <= 3); + GET_V(tmp, tmp >= 2 && tmp <= NUT_VERSION); GET_V(stream_count, tmp > 0 && tmp <= NUT_MAX_STREAMS); nut->max_distance = ffio_read_varlen(bc); diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index df70f94122..7234cd9ee0 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -323,7 +323,7 @@ static void write_mainheader(NUTContext *nut, AVIOContext *bc) tmp_head_idx; int64_t tmp_match; - ff_put_v(bc, 3); /* version */ + ff_put_v(bc, NUT_VERSION); ff_put_v(bc, nut->avf->nb_streams); ff_put_v(bc, nut->max_distance); ff_put_v(bc, nut->time_base_count);