From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 12/14] avcodec/lagarith: Use void* instead of AVCodecContext* as logctx
Date: Thu, 28 Sep 2023 23:35:46 +0200
Message-ID: <AS8P250MB0744D884E9F36EB7394ED21B8FC1A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <AS8P250MB0744136FB53B9E573DD249D68FC1A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/lagarith.c | 14 +++++++-------
libavcodec/lagarithrac.h | 3 +--
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c
index 3288c0517c..9574f78871 100644
--- a/libavcodec/lagarith.c
+++ b/libavcodec/lagarith.c
@@ -166,17 +166,17 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb)
/* Read probabilities from bitstream */
for (i = 1; i < 257; i++) {
if (lag_decode_prob(gb, &rac->prob[i]) < 0) {
- av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability encountered.\n");
+ av_log(rac->logctx, AV_LOG_ERROR, "Invalid probability encountered.\n");
return AVERROR_INVALIDDATA;
}
if ((uint64_t)cumul_prob + rac->prob[i] > UINT_MAX) {
- av_log(rac->avctx, AV_LOG_ERROR, "Integer overflow encountered in cumulative probability calculation.\n");
+ av_log(rac->logctx, AV_LOG_ERROR, "Integer overflow encountered in cumulative probability calculation.\n");
return AVERROR_INVALIDDATA;
}
cumul_prob += rac->prob[i];
if (!rac->prob[i]) {
if (lag_decode_prob(gb, &prob)) {
- av_log(rac->avctx, AV_LOG_ERROR, "Invalid probability run encountered.\n");
+ av_log(rac->logctx, AV_LOG_ERROR, "Invalid probability run encountered.\n");
return AVERROR_INVALIDDATA;
}
if (prob > 256 - i)
@@ -189,7 +189,7 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb)
}
if (!cumul_prob) {
- av_log(rac->avctx, AV_LOG_ERROR, "All probabilities are 0!\n");
+ av_log(rac->logctx, AV_LOG_ERROR, "All probabilities are 0!\n");
return AVERROR_INVALIDDATA;
}
@@ -207,7 +207,7 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb)
scaled_cumul_prob += rac->prob[i];
}
if (scaled_cumul_prob <= 0) {
- av_log(rac->avctx, AV_LOG_ERROR, "Scaled probabilities invalid\n");
+ av_log(rac->logctx, AV_LOG_ERROR, "Scaled probabilities invalid\n");
return AVERROR_INVALIDDATA;
}
for (; i < 257; i++) {
@@ -221,7 +221,7 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb)
cumulative_target = 1U << scale_factor;
if (scaled_cumul_prob > cumulative_target) {
- av_log(rac->avctx, AV_LOG_ERROR,
+ av_log(rac->logctx, AV_LOG_ERROR,
"Scaled probabilities are larger than target!\n");
return AVERROR_INVALIDDATA;
}
@@ -463,7 +463,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst,
const uint8_t *src_end = src + src_size;
int ret;
- rac.avctx = l->avctx;
+ rac.logctx = l->avctx;
l->zeros = 0;
if(src_size < 2)
diff --git a/libavcodec/lagarithrac.h b/libavcodec/lagarithrac.h
index a31b054dbb..2c8cb7385a 100644
--- a/libavcodec/lagarithrac.h
+++ b/libavcodec/lagarithrac.h
@@ -32,11 +32,10 @@
#include <stdint.h>
#include "libavutil/intreadwrite.h"
-#include "avcodec.h"
#include "get_bits.h"
typedef struct lag_rac {
- AVCodecContext *avctx;
+ void *logctx;
unsigned low;
unsigned range;
unsigned scale; /**< Number of bits of precision in range. */
--
2.34.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2023-09-28 21:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-28 21:32 [FFmpeg-devel] [PATCH 01/14] configure: Remove obsolete wmavoice->rdft, dct dependencies Andreas Rheinhardt
2023-09-28 21:35 ` [FFmpeg-devel] [PATCH 02/14] configure: Remove obsolete ffplay->rdft dependency Andreas Rheinhardt
2023-09-28 21:35 ` [FFmpeg-devel] [PATCH 03/14] configure: Remove unnecessary vf_spp->fft dependency Andreas Rheinhardt
2023-09-28 21:35 ` [FFmpeg-devel] [PATCH 04/14] avcodec/mpegaudiodsp: Init dct32 directly Andreas Rheinhardt
2023-09-28 21:35 ` [FFmpeg-devel] [PATCH 06/14] configure: Remove dct, fft, mdct, rdft subsystems Andreas Rheinhardt
2023-09-28 21:35 ` [FFmpeg-devel] [PATCH 07/14] avcodec/vorbis: Use void* logctx instead of AVCodecContext* Andreas Rheinhardt
2023-09-30 10:28 ` Andreas Rheinhardt
2023-09-28 21:35 ` [FFmpeg-devel] [PATCH 08/14] avcodec/utvideo: Split UTvideoContext into decoder and encoder contexts Andreas Rheinhardt
2023-09-28 21:35 ` [FFmpeg-devel] [PATCH 09/14] avcodec/sipr: Remove write-only AVCodecContext* Andreas Rheinhardt
2023-09-28 21:35 ` [FFmpeg-devel] [PATCH 10/14] avcodec/roqvideo: Use void*, not AVCodecContext* for logctx Andreas Rheinhardt
2023-09-28 21:35 ` [FFmpeg-devel] [PATCH 11/14] avcodec/opus_silk: Use void* instead of AVCodecContext* as logctx Andreas Rheinhardt
2023-09-28 21:35 ` Andreas Rheinhardt [this message]
2023-09-28 21:35 ` [FFmpeg-devel] [PATCH 13/14] avcodec/flac_parse: " Andreas Rheinhardt
2023-09-28 21:35 ` [FFmpeg-devel] [PATCH 14/14] avcodec/bgmc: " Andreas Rheinhardt
2023-09-28 21:42 ` [FFmpeg-devel] [PATCH 01/14] configure: Remove obsolete wmavoice->rdft, dct dependencies Andreas Rheinhardt
2023-09-28 21:59 ` Lynne
2023-09-28 22:11 ` Andreas Rheinhardt
2023-09-28 23:26 ` Lynne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AS8P250MB0744D884E9F36EB7394ED21B8FC1A@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \
--to=andreas.rheinhardt@outlook.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git