From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Subject: [FFmpeg-devel] [PATCH v2 18/24] avcodec/mjpegenc_common: Only pass what is used from ScanTable
Date: Fri, 21 Oct 2022 22:12:54 +0200
Message-ID: <AS8P250MB0744BF0A68DB328DB05238088F2D9@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <AS8P250MB07440727410EF826F84418C68F2D9@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>
Namely ScanTable.permutated.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
libavcodec/mjpegenc.c | 2 +-
libavcodec/mjpegenc_common.c | 10 +++++-----
libavcodec/mjpegenc_common.h | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index e56a466b36..eafe7130e2 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -81,7 +81,7 @@ static av_cold void init_uni_ac_vlc(const uint8_t huff_size_ac[256],
static void mjpeg_encode_picture_header(MpegEncContext *s)
{
ff_mjpeg_encode_picture_header(s->avctx, &s->pb, s->picture->f, s->mjpeg_ctx,
- &s->intra_scantable, 0,
+ s->intra_scantable.permutated, 0,
s->intra_matrix, s->chroma_intra_matrix,
s->slice_context_count > 1);
diff --git a/libavcodec/mjpegenc_common.c b/libavcodec/mjpegenc_common.c
index c37c964931..6dfc4469a5 100644
--- a/libavcodec/mjpegenc_common.c
+++ b/libavcodec/mjpegenc_common.c
@@ -58,7 +58,7 @@ static int put_huffman_table(PutBitContext *p, int table_class, int table_id,
static void jpeg_table_header(AVCodecContext *avctx, PutBitContext *p,
MJpegContext *m,
- ScanTable *intra_scantable,
+ const uint8_t intra_matrix_permutation[64],
uint16_t luma_intra_matrix[64],
uint16_t chroma_intra_matrix[64],
int hsample[3], int use_slices, int matrices_differ)
@@ -76,7 +76,7 @@ static void jpeg_table_header(AVCodecContext *avctx, PutBitContext *p,
put_bits(p, 4, 0); /* 8 bit precision */
put_bits(p, 4, 0); /* table 0 */
for (int i = 0; i < 64; i++) {
- uint8_t j = intra_scantable->permutated[i];
+ uint8_t j = intra_matrix_permutation[i];
put_bits(p, 8, luma_intra_matrix[j]);
}
@@ -84,7 +84,7 @@ static void jpeg_table_header(AVCodecContext *avctx, PutBitContext *p,
put_bits(p, 4, 0); /* 8 bit precision */
put_bits(p, 4, 1); /* table 1 */
for(i=0;i<64;i++) {
- j = intra_scantable->permutated[i];
+ j = intra_matrix_permutation[i];
put_bits(p, 8, chroma_intra_matrix[j]);
}
}
@@ -275,7 +275,7 @@ void ff_mjpeg_init_hvsample(AVCodecContext *avctx, int hsample[4], int vsample[4
void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
const AVFrame *frame, struct MJpegContext *m,
- ScanTable *intra_scantable, int pred,
+ const uint8_t intra_matrix_permutation[64], int pred,
uint16_t luma_intra_matrix[64],
uint16_t chroma_intra_matrix[64],
int use_slices)
@@ -298,7 +298,7 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
chroma_matrix = !lossless && !!memcmp(luma_intra_matrix,
chroma_intra_matrix,
sizeof(luma_intra_matrix[0]) * 64);
- jpeg_table_header(avctx, pb, m, intra_scantable,
+ jpeg_table_header(avctx, pb, m, intra_matrix_permutation,
luma_intra_matrix, chroma_intra_matrix, hsample,
use_slices, chroma_matrix);
diff --git a/libavcodec/mjpegenc_common.h b/libavcodec/mjpegenc_common.h
index 5b13faae23..e9f0ea44a0 100644
--- a/libavcodec/mjpegenc_common.h
+++ b/libavcodec/mjpegenc_common.h
@@ -24,7 +24,6 @@
#include <stdint.h>
#include "avcodec.h"
-#include "idctdsp.h"
#include "put_bits.h"
struct MJpegContext;
@@ -33,7 +32,8 @@ int ff_mjpeg_add_icc_profile_size(AVCodecContext *avctx, const AVFrame *frame,
size_t *max_pkt_size);
void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
const AVFrame *frame, struct MJpegContext *m,
- ScanTable *intra_scantable, int pred,
+ const uint8_t intra_matrix_permutation[64],
+ int pred,
uint16_t luma_intra_matrix[64],
uint16_t chroma_intra_matrix[64],
int use_slices);
--
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:[~2022-10-21 20:15 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-21 20:11 [FFmpeg-devel] [PATCH v2 01/24] configure: Add idctdsp dependency to codecs that need it Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 02/24] avcodec/eamad: Don't use IDCTDSP-API unnecessarily Andreas Rheinhardt
2022-10-22 0:07 ` Peter Ross
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 03/24] avcodec/eatgq: " Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 04/24] avcodec/eatqi: " Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 05/24] avcodec/aic: Remove useless ScanTable Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 06/24] avcodec/imm4: " Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 07/24] avcodec/idctdsp: Add function to apply permutation to array Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 08/24] avcodec/agm: Only keep what is used from ScanTable Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 09/24] avcodec/asvdec: " Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 10/24] avcodec/dnxhddec: " Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 11/24] avcodec/cavs: Only keep what is needed from IDCTDSP-API Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 12/24] avcodec/g2meet: Only keep what is used from ScanTable Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 13/24] avcodec/g2meet: Pre-permute quantization tables Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 14/24] avcodec/intrax8: Only keep what is used from ScanTable Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 15/24] avcodec/mdec: " Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 16/24] avcodec/mimic: " Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 17/24] avcodec/mjpegdec: " Andreas Rheinhardt
2022-10-21 20:12 ` Andreas Rheinhardt [this message]
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 19/24] avcodec/speedhqdec: " Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 20/24] avcodec/wmv2dec: Remove unnecessary ScanTables Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 21/24] avcodec/idctdsp: Move ScanTable to mpegvideo Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 22/24] avcodec/eatgq: Move transient GetByteContext from context to stack Andreas Rheinhardt
2022-10-21 20:12 ` [FFmpeg-devel] [PATCH v2 23/24] avcodec/mpegvideo: Move ASM-offset warning to its proper place Andreas Rheinhardt
2022-10-21 20:13 ` [FFmpeg-devel] [PATCH v2 24/24] avcodec/mpegvideo: Don't use ScanTable where unnecessary Andreas Rheinhardt
2022-10-23 11:17 ` [FFmpeg-devel] [PATCH v2 01/24] configure: Add idctdsp dependency to codecs that need it 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=AS8P250MB0744BF0A68DB328DB05238088F2D9@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