summaryrefslogtreecommitdiff
path: root/libavcodec/huffman.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-07-30 13:13:45 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-08-05 19:58:10 +0200
commitb75dc8bd70ae479452da36e2dcaad6ef007a553f (patch)
treef189382a026de1e5c93089cc8ed28b81d33e0e4b /libavcodec/huffman.c
parenta449fb35ca6128a414e555f9cc31fa0ec13c4a5d (diff)
avcodec/huffman: Use logcontext instead of AVCodecContext
Said AVCodecContext is only used for logging; it furthermore avoids an avcodec.h inclusion. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/huffman.c')
-rw-r--r--libavcodec/huffman.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/huffman.c b/libavcodec/huffman.c
index df1141b7e7..be351ba2d6 100644
--- a/libavcodec/huffman.c
+++ b/libavcodec/huffman.c
@@ -29,7 +29,6 @@
#include "libavutil/qsort.h"
#include "libavutil/common.h"
-#include "avcodec.h"
#include "huffman.h"
#include "vlc.h"
@@ -154,7 +153,7 @@ static int build_huff_tree(VLC *vlc, Node *nodes, int head, int flags, int nb_bi
* nodes size must be 2*nb_codes
* first nb_codes nodes.count must be set
*/
-int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes, int nb_bits,
+int ff_huff_build_tree(void *logctx, VLC *vlc, int nb_codes, int nb_bits,
Node *nodes, HuffCmp cmp, int flags)
{
int i, j;
@@ -168,7 +167,7 @@ int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes, int nb_bit
}
if (sum >> 31) {
- av_log(avctx, AV_LOG_ERROR,
+ av_log(logctx, AV_LOG_ERROR,
"Too high symbol frequencies. "
"Tree construction is not possible\n");
return -1;
@@ -193,7 +192,7 @@ int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes, int nb_bit
cur_node++;
}
if (build_huff_tree(vlc, nodes, nb_codes * 2 - 2, flags, nb_bits) < 0) {
- av_log(avctx, AV_LOG_ERROR, "Error building tree\n");
+ av_log(logctx, AV_LOG_ERROR, "Error building tree\n");
return -1;
}
return 0;