mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-11 09:20:01 +01:00
avcodec/mjpegenc_common: Only pass what is used from ScanTable
Namely ScanTable.permutated. Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -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)
|
static void mjpeg_encode_picture_header(MpegEncContext *s)
|
||||||
{
|
{
|
||||||
ff_mjpeg_encode_picture_header(s->avctx, &s->pb, s->picture->f, s->mjpeg_ctx,
|
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->intra_matrix, s->chroma_intra_matrix,
|
||||||
s->slice_context_count > 1);
|
s->slice_context_count > 1);
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
static void jpeg_table_header(AVCodecContext *avctx, PutBitContext *p,
|
||||||
MJpegContext *m,
|
MJpegContext *m,
|
||||||
ScanTable *intra_scantable,
|
const uint8_t intra_matrix_permutation[64],
|
||||||
uint16_t luma_intra_matrix[64],
|
uint16_t luma_intra_matrix[64],
|
||||||
uint16_t chroma_intra_matrix[64],
|
uint16_t chroma_intra_matrix[64],
|
||||||
int hsample[3], int use_slices, int matrices_differ)
|
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); /* 8 bit precision */
|
||||||
put_bits(p, 4, 0); /* table 0 */
|
put_bits(p, 4, 0); /* table 0 */
|
||||||
for (int i = 0; i < 64; i++) {
|
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]);
|
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, 0); /* 8 bit precision */
|
||||||
put_bits(p, 4, 1); /* table 1 */
|
put_bits(p, 4, 1); /* table 1 */
|
||||||
for(i=0;i<64;i++) {
|
for(i=0;i<64;i++) {
|
||||||
j = intra_scantable->permutated[i];
|
j = intra_matrix_permutation[i];
|
||||||
put_bits(p, 8, chroma_intra_matrix[j]);
|
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,
|
void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
|
||||||
const AVFrame *frame, struct MJpegContext *m,
|
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 luma_intra_matrix[64],
|
||||||
uint16_t chroma_intra_matrix[64],
|
uint16_t chroma_intra_matrix[64],
|
||||||
int use_slices)
|
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_matrix = !lossless && !!memcmp(luma_intra_matrix,
|
||||||
chroma_intra_matrix,
|
chroma_intra_matrix,
|
||||||
sizeof(luma_intra_matrix[0]) * 64);
|
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,
|
luma_intra_matrix, chroma_intra_matrix, hsample,
|
||||||
use_slices, chroma_matrix);
|
use_slices, chroma_matrix);
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "idctdsp.h"
|
|
||||||
#include "put_bits.h"
|
#include "put_bits.h"
|
||||||
|
|
||||||
struct MJpegContext;
|
struct MJpegContext;
|
||||||
@@ -33,7 +32,8 @@ int ff_mjpeg_add_icc_profile_size(AVCodecContext *avctx, const AVFrame *frame,
|
|||||||
size_t *max_pkt_size);
|
size_t *max_pkt_size);
|
||||||
void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
|
void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
|
||||||
const AVFrame *frame, struct MJpegContext *m,
|
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 luma_intra_matrix[64],
|
||||||
uint16_t chroma_intra_matrix[64],
|
uint16_t chroma_intra_matrix[64],
|
||||||
int use_slices);
|
int use_slices);
|
||||||
|
|||||||
Reference in New Issue
Block a user