FFmpeg
Loading...
Searching...
No Matches
mss34dsp.c File Reference
#include <stdint.h>
#include "libavutil/common.h"
#include "mss34dsp.h"
#include "jpegquanttables.h"

Go to the source code of this file.

Macros

#define DCT_TEMPLATE(blk, step, SOP, shift)
 
#define SOP_ROW(a)
 
#define SOP_COL(a)
 

Functions

void ff_mss34_gen_quant_mat (uint16_t *qmat, int quality, int luma)
 Generate quantisation matrix for given quality.
 
void ff_mss34_dct_put (uint8_t *dst, ptrdiff_t stride, int *block)
 Transform and output DCT block.
 

Macro Definition Documentation

◆ DCT_TEMPLATE

#define DCT_TEMPLATE ( blk,
step,
SOP,
shift )
Value:
const unsigned t0 =-39409U * blk[7 * step] - 58980U * blk[1 * step]; \
const unsigned t1 = 39410U * blk[1 * step] - 58980U * blk[7 * step]; \
const unsigned t2 =-33410U * blk[5 * step] -167963U * blk[3 * step]; \
const unsigned t3 = 33410U * blk[3 * step] -167963U * blk[5 * step]; \
const unsigned t4 = blk[3 * step] + blk[7 * step]; \
const unsigned t5 = blk[1 * step] + blk[5 * step]; \
const unsigned t6 = 77062U * t4 + 51491U * t5; \
const unsigned t7 = 77062U * t5 - 51491U * t4; \
const unsigned t8 = 35470U * blk[2 * step] - 85623U * blk[6 * step]; \
const unsigned t9 = 35470U * blk[6 * step] + 85623U * blk[2 * step]; \
const unsigned tA = SOP(blk[0 * step] - blk[4 * step]); \
const unsigned tB = SOP(blk[0 * step] + blk[4 * step]); \
\
blk[0 * step] = (int)( t1 + t6 + t9 + tB) >> shift; \
blk[1 * step] = (int)( t3 + t7 + t8 + tA) >> shift; \
blk[2 * step] = (int)( t2 + t6 - t8 + tA) >> shift; \
blk[3 * step] = (int)( t0 + t7 - t9 + tB) >> shift; \
blk[4 * step] = (int)(-(t0 + t7) - t9 + tB) >> shift; \
blk[5 * step] = (int)(-(t2 + t6) - t8 + tA) >> shift; \
blk[6 * step] = (int)(-(t3 + t7) + t8 + tA) >> shift; \
blk[7 * step] = (int)(-(t1 + t6) + t9 + tB) >> shift; \
static int shift(int a, int b)
Definition bonk.c:261
#define blk(i)
Definition sha.c:55

Definition at line 43 of file mss34dsp.c.

Referenced by ff_mss34_dct_put().

◆ SOP_ROW

#define SOP_ROW ( a)
Value:
(((a) * (1U << 16)) + 0x2000)
int a

Definition at line 66 of file mss34dsp.c.

Referenced by ff_mss34_dct_put().

◆ SOP_COL

#define SOP_COL ( a)
Value:
(((a) + 32) * (1U << 16))

Definition at line 67 of file mss34dsp.c.

Referenced by ff_mss34_dct_put().

Function Documentation

◆ ff_mss34_gen_quant_mat()

void ff_mss34_gen_quant_mat ( uint16_t * qmat,
int quality,
int luma )

Generate quantisation matrix for given quality.

Parameters
qmatdestination matrix
qualityquality setting (1-100)
lumagenerate quantisation matrix for luma or chroma

Definition at line 27 of file mss34dsp.c.

Referenced by mss4_decode_frame(), and reset_coders().

◆ ff_mss34_dct_put()

void ff_mss34_dct_put ( uint8_t * dst,
ptrdiff_t stride,
int * block )

Transform and output DCT block.

Parameters
dstoutput plane
strideoutput plane stride
blockblock to transform and output

Definition at line 69 of file mss34dsp.c.

Referenced by decode_dct_block(), and mss4_decode_dct_block().