FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
mss34dsp.c File Reference
#include <stdint.h>
#include "libavutil/common.h"
#include "mss34dsp.h"

Go to the source code of this file.

Macros

#define DCT_TEMPLATE(blk, step, SOP, shift)
 
#define SOP_ROW(a)   ((a) << 16) + 0x2000
 
#define SOP_COL(a)   ((a + 32) << 16)
 

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, int stride, int *block)
 Transform and output DCT block.
 

Variables

static const uint8_t luma_quant [64]
 
static const uint8_t chroma_quant [64]
 

Macro Definition Documentation

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

Definition at line 64 of file mss34dsp.c.

Referenced by ff_mss34_dct_put().

#define SOP_ROW (   a)    ((a) << 16) + 0x2000

Definition at line 87 of file mss34dsp.c.

Referenced by ff_mss34_dct_put().

#define SOP_COL (   a)    ((a + 32) << 16)

Definition at line 88 of file mss34dsp.c.

Referenced by ff_mss34_dct_put().

Function Documentation

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 48 of file mss34dsp.c.

Referenced by mss4_decode_frame(), and reset_coders().

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

Transform and output DCT block.

Parameters
dstoutput plane
strideoutput plane stride
blockblock to transform and output

Definition at line 90 of file mss34dsp.c.

Referenced by decode_dct_block(), and mss4_decode_dct_block().

Variable Documentation

const uint8_t luma_quant[64]
static
Initial value:
= {
16, 11, 10, 16, 24, 40, 51, 61,
12, 12, 14, 19, 26, 58, 60, 55,
14, 13, 16, 24, 40, 57, 69, 56,
14, 17, 22, 29, 51, 87, 80, 62,
18, 22, 37, 56, 68, 109, 103, 77,
24, 35, 55, 64, 81, 104, 113, 92,
49, 64, 78, 87, 103, 121, 120, 101,
72, 92, 95, 98, 112, 100, 103, 99
}

Definition at line 26 of file mss34dsp.c.

Referenced by ff_mss34_gen_quant_mat().

const uint8_t chroma_quant[64]
static
Initial value:
= {
17, 18, 24, 47, 99, 99, 99, 99,
18, 21, 26, 66, 99, 99, 99, 99,
24, 26, 56, 99, 99, 99, 99, 99,
47, 66, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99,
99, 99, 99, 99, 99, 99, 99, 99
}

Definition at line 37 of file mss34dsp.c.

Referenced by ff_mss34_gen_quant_mat().