FFmpeg
Macros | Functions
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)   (((a) * (1U << 16)) + 0x2000)
 
#define SOP_COL(a)   (((a) + 32) * (1U << 16))
 

Functions

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

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; \

Definition at line 43 of file mss34dsp.c.

◆ SOP_ROW

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

Definition at line 66 of file mss34dsp.c.

◆ SOP_COL

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

Definition at line 67 of file mss34dsp.c.

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().

step
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But a word about which is also called distortion Distortion can be quantified by almost any quality measurement one chooses the sum of squared differences is used but more complex methods that consider psychovisual effects can be used as well It makes no difference in this discussion First step
Definition: rate_distortion.txt:58
t0
#define t0
Definition: regdef.h:28
t1
#define t1
Definition: regdef.h:29
t7
#define t7
Definition: regdef.h:35
blk
#define blk(i)
Definition: sha.c:186
t5
#define t5
Definition: regdef.h:33
t6
#define t6
Definition: regdef.h:34
shift
static int shift(int a, int b)
Definition: bonk.c:262
t8
#define t8
Definition: regdef.h:53
t4
#define t4
Definition: regdef.h:32
t3
#define t3
Definition: regdef.h:31
U
#define U(x)
Definition: vpx_arith.h:37
t2
#define t2
Definition: regdef.h:30
t9
#define t9
Definition: regdef.h:54
int
int
Definition: ffmpeg_filter.c:409