Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH 41/61] avcodec/aacps: Pass logctx as void* instead of AVCodecContext*
Date: Wed, 27 Sep 2023 00:17:12 +0200
Message-ID: <GV1P250MB0737B69B041B764D52FAABE88FC3A@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <GV1P250MB073754E215A199E7219CC13A8FC3A@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM>

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/aacps.h        |  3 +--
 libavcodec/aacps_common.c | 26 +++++++++++++-------------
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/libavcodec/aacps.h b/libavcodec/aacps.h
index 9d7e79c2b2..c8814b4c3d 100644
--- a/libavcodec/aacps.h
+++ b/libavcodec/aacps.h
@@ -27,7 +27,6 @@
 #include "libavutil/mem_internal.h"
 
 #include "aacpsdsp.h"
-#include "avcodec.h"
 #include "get_bits.h"
 
 #define PS_MAX_NUM_ENV 5
@@ -95,7 +94,7 @@ extern const int8_t ff_k_to_i_34[];
 void ff_ps_init_common(void);
 void AAC_RENAME(ff_ps_init)(void);
 void AAC_RENAME(ff_ps_ctx_init)(PSContext *ps);
-int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb,
+int ff_ps_read_data(void *logctx, GetBitContext *gb,
                      PSCommonContext *ps, int bits_left);
 int AAC_RENAME(ff_ps_apply)(PSContext *ps, INTFLOAT L[2][38][64], INTFLOAT R[2][38][64], int top);
 
diff --git a/libavcodec/aacps_common.c b/libavcodec/aacps_common.c
index bee07b5fb3..11bdb960cf 100644
--- a/libavcodec/aacps_common.c
+++ b/libavcodec/aacps_common.c
@@ -67,14 +67,14 @@ static VLC vlc_ps[10];
  * Inter-channel Phase Difference/Overall Phase Difference parameters from the \
  * bitstream. \
  * \
- * @param avctx contains the current codec context \
+ * @param logctx a context for logging \
  * @param gb    pointer to the input bitstream \
  * @param ps    pointer to the Parametric Stereo context \
  * @param PAR   pointer to the parameter to be read \
  * @param e     envelope to decode \
  * @param dt    1: time delta-coded, 0: frequency delta-coded \
  */ \
-static int read_ ## PAR ## _data(AVCodecContext *avctx, GetBitContext *gb, PSCommonContext *ps, \
+static int read_ ## PAR ## _data(void *logctx, GetBitContext *gb, PSCommonContext *ps, \
                         int8_t (*PAR)[PS_MAX_NR_IIDICC], int table_idx, int e, int dt) \
 { \
     int b, num = ps->nr_ ## PAR ## _par; \
@@ -101,7 +101,7 @@ static int read_ ## PAR ## _data(AVCodecContext *avctx, GetBitContext *gb, PSCom
     } \
     return 0; \
 err: \
-    av_log(avctx, AV_LOG_ERROR, "illegal "#PAR"\n"); \
+    av_log(logctx, AV_LOG_ERROR, "illegal "#PAR"\n"); \
     return AVERROR_INVALIDDATA; \
 }
 
@@ -131,7 +131,7 @@ static int ps_read_extension_data(GetBitContext *gb, PSCommonContext *ps,
     return get_bits_count(gb) - count;
 }
 
-int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host,
+int ff_ps_read_data(void *logctx, GetBitContext *gb_host,
                     PSCommonContext *ps, int bits_left)
 {
     int e;
@@ -146,7 +146,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host,
         if (ps->enable_iid) {
             int iid_mode = get_bits(gb, 3);
             if (iid_mode > 5) {
-                av_log(avctx, AV_LOG_ERROR, "iid_mode %d is reserved.\n",
+                av_log(logctx, AV_LOG_ERROR, "iid_mode %d is reserved.\n",
                        iid_mode);
                 goto err;
             }
@@ -158,7 +158,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host,
         if (ps->enable_icc) {
             ps->icc_mode = get_bits(gb, 3);
             if (ps->icc_mode > 5) {
-                av_log(avctx, AV_LOG_ERROR, "icc_mode %d is reserved.\n",
+                av_log(logctx, AV_LOG_ERROR, "icc_mode %d is reserved.\n",
                        ps->icc_mode);
                 goto err;
             }
@@ -176,7 +176,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host,
         for (e = 1; e <= ps->num_env; e++) {
             ps->border_position[e] = get_bits(gb, 5);
             if (ps->border_position[e] < ps->border_position[e-1]) {
-                av_log(avctx, AV_LOG_ERROR, "border_position non monotone.\n");
+                av_log(logctx, AV_LOG_ERROR, "border_position non monotone.\n");
                 goto err;
             }
         }
@@ -187,7 +187,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host,
     if (ps->enable_iid) {
         for (e = 0; e < ps->num_env; e++) {
             int dt = get_bits1(gb);
-            if (read_iid_data(avctx, gb, ps, ps->iid_par, huff_iid[2*dt+ps->iid_quant], e, dt))
+            if (read_iid_data(logctx, gb, ps, ps->iid_par, huff_iid[2*dt+ps->iid_quant], e, dt))
                 goto err;
         }
     } else
@@ -196,7 +196,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host,
     if (ps->enable_icc)
         for (e = 0; e < ps->num_env; e++) {
             int dt = get_bits1(gb);
-            if (read_icc_data(avctx, gb, ps, ps->icc_par, dt ? huff_icc_dt : huff_icc_df, e, dt))
+            if (read_icc_data(logctx, gb, ps, ps->icc_par, dt ? huff_icc_dt : huff_icc_df, e, dt))
                 goto err;
         }
     else
@@ -213,7 +213,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host,
             cnt -= 2 + ps_read_extension_data(gb, ps, ps_extension_id);
         }
         if (cnt < 0) {
-            av_log(avctx, AV_LOG_ERROR, "ps extension overflow %d\n", cnt);
+            av_log(logctx, AV_LOG_ERROR, "ps extension overflow %d\n", cnt);
             goto err;
         }
         skip_bits(gb, cnt);
@@ -241,7 +241,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host,
         if (ps->enable_iid){
             for (b = 0; b < ps->nr_iid_par; b++) {
                 if (FFABS(ps->iid_par[ps->num_env][b]) > 7 + 8 * ps->iid_quant) {
-                    av_log(avctx, AV_LOG_ERROR, "iid_par invalid\n");
+                    av_log(logctx, AV_LOG_ERROR, "iid_par invalid\n");
                     goto err;
                 }
             }
@@ -249,7 +249,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host,
         if (ps->enable_icc){
             for (b = 0; b < ps->nr_iid_par; b++) {
                 if (ps->icc_par[ps->num_env][b] > 7U) {
-                    av_log(avctx, AV_LOG_ERROR, "icc_par invalid\n");
+                    av_log(logctx, AV_LOG_ERROR, "icc_par invalid\n");
                     goto err;
                 }
             }
@@ -278,7 +278,7 @@ int ff_ps_read_data(AVCodecContext *avctx, GetBitContext *gb_host,
         skip_bits_long(gb_host, bits_consumed);
         return bits_consumed;
     }
-    av_log(avctx, AV_LOG_ERROR, "Expected to read %d PS bits actually read %d.\n", bits_left, bits_consumed);
+    av_log(logctx, AV_LOG_ERROR, "Expected to read %d PS bits actually read %d.\n", bits_left, bits_consumed);
 err:
     ps->start = 0;
     skip_bits_long(gb_host, bits_left);
-- 
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".

  parent reply	other threads:[~2023-09-26 22:22 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26 22:12 [FFmpeg-devel] [PATCH 01/61] avcodec/vlc: Add functions to init static VLCElem[] without VLC Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 02/61] avcodec/vp3: Make VLC tables static where possible Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 03/61] avcodec/vp3: Increase some VLC tables Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 04/61] avcodec/h264_cavlc: Avoid superfluous VLC structures Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 05/61] avcodec/h264_cavlc: Avoid indirection for coefficient table VLCs Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 06/61] avcodec/h264_cavlc: Remove code duplication Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 07/61] avcodec/asvdec: Avoid superfluous VLC structures Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 08/61] avcodec/faxcompr: " Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 09/61] avcodec/h261dec: " Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 10/61] avcodec/ituh263dec: " Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 11/61] avcodec/msmpeg4_vc1_data: " Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 12/61] avcodec/svq1dec: " Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 13/61] avcodec/svq1dec: Increase size of VLC Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 14/61] avcodec/rv40: Avoid superfluous VLC structures Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 15/61] avcodec/mpc7: " Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 16/61] avcodec/intrax8: " Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 17/61] avcodec/clearvideo: " Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 18/61] avcodec/atrac9dec: " Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 19/61] avcodec/imc: " Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 20/61] avcodec/refstruct: Add simple API for refcounted objects Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 21/61] avcodec/vp3: Share coefficient VLCs between threads Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 22/61] avcodec/vp3: Avoid complete VLC struct, only use VLCElem* Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 23/61] avcodec/vp3: Reindent after the previous commits Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 24/61] avcodec/rv34: Avoid superfluous VLC structures Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 25/61] avcodec/rv34: Constify pointer to static object Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 26/61] avcodec/wnv1: Avoid unnecessary VLC structure Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 27/61] avcodec/mv30: " Andreas Rheinhardt
2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 28/61] avcodec/vqcdec: " Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 29/61] avcodec/mobiclip: " Andreas Rheinhardt
2023-09-27 23:20   ` Michael Niedermayer
2023-09-27 23:44     ` Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 30/61] avcodec/mimic: " Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 31/61] avcodec/imm4: " Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 32/61] avcodec/lagarith: " Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 33/61] avcodec/speedhqdec: " Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 34/61] avcodec/vc1: Avoid superfluous VLC structures Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 35/61] avcodec/4xm: Avoid unnecessary " Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 36/61] avcodec/indeo2: Avoid unnecessary VLC structure Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 37/61] avcodec/mss4: Partially inline max_depth and nb_bits of VLC Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 38/61] avcodec/mpeg4videodec: Avoid superfluous VLC structures Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 39/61] avcodec/msmpeg4dec: " Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 40/61] avcodec/aacps: Remove unused AVCodecContext* parameter from ff_ps_apply Andreas Rheinhardt
2023-09-26 22:17 ` Andreas Rheinhardt [this message]
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 42/61] avcodec/aacdectab: Deduplicate common decoder tables Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 43/61] avcodec/aacdec_template: Deduplicate VLCs Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 44/61] avcodec/aacdec_template: Don't init unused table for fixed-point decoder Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 45/61] avcodec/aactab: Improve included headers Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 46/61] avcodec/aacdec_common: Avoid superfluous VLC structures Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 47/61] avcodec/aacsbr_template: Deduplicate VLCs Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 48/61] avcodec/aacdec_common: Avoid superfluous VLC structures for SBR VLCs Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 49/61] avcodec/aacdec_common: Switch to ff_vlc_init_tables_from_lengths() Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 50/61] avcodec/aacdec_common: Combine huffman tabs Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 51/61] avcodec/aacdec_common: Apply offset for SBR VLCs during init Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 52/61] avcodec/aacps: Move initializing common stuff to aacdec_common.c Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 53/61] avcodec/aacps_common: Avoid superfluous VLC structures Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 54/61] avcodec/aacps_common: Switch to ff_vlc_init_tables_from_lengths() Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 55/61] avcodec/aacps_common: Combine huffman tabels Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 56/61] avcodec/aacps_common: Apply offset for VLCs during init Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 57/61] avcodec/mpegaudiodec_common: Avoid superfluous VLC structures Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 58/61] avcodec/mpeg12: Avoid unnecessary " Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 59/61] avcodec/wmaprodec: Avoid superfluous " Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 60/61] avcodec/wmavoice: Avoid unnecessary VLC structure Andreas Rheinhardt
2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 61/61] avcodec/vlc: Remove unused macros Andreas Rheinhardt
2023-10-30 23:08 ` [FFmpeg-devel] [PATCH 01/61] avcodec/vlc: Add functions to init static VLCElem[] without VLC Andreas Rheinhardt

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=GV1P250MB0737B69B041B764D52FAABE88FC3A@GV1P250MB0737.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