FFmpeg
Macros | Functions | Variables
mathops.h File Reference
#include <stdint.h>
#include "libavutil/common.h"
#include "config.h"

Go to the source code of this file.

Macros

#define  MAX_NEG_CROP   1024
 
#define  MUL64(a, b)   ((int64_t)(a) * (int64_t)(b))
 
#define  MULL(a, b, s)   (MUL64(a, b) >> (s))
 
#define  MAC64(d, a, b)   ((d) += MUL64(a, b))
 
#define  MLS64(d, a, b)   ((d) -= MUL64(a, b))
 
#define  MAC16(rt, ra, rb)   rt += (ra) * (rb)
 
#define  MUL16(ra, rb)   ((ra) * (rb))
 
#define  MLS16(rt, ra, rb)   ((rt) -= (ra) * (rb))
 
#define  mid_pred   mid_pred
 
#define  COPY3_IF_LT(x, y, a, b, c, d)
 
#define  MASK_ABS(mask, level)
 
#define  NEG_SSR32(a, s)   ((( int32_t)(a))>>(32-(s)))
 
#define  NEG_USR32(a, s)   (((uint32_t)(a))>>(32-(s)))
 
#define  PACK_2U8(a, b)   (((b) << 8) | (a))
 
#define  PACK_4U8(a, b, c, d)   (((d) << 24) | ((c) << 16) | ((b) << 8) | (a))
 
#define  PACK_2U16(a, b)   (((b) << 16) | (a))
 
#define  PACK_2S8(a, b)   PACK_2U8((a)&255, (b)&255)
 
#define  PACK_4S8(a, b, c, d)   PACK_4U8((a)&255, (b)&255, (c)&255, (d)&255)
 
#define  PACK_2S16(a, b)   PACK_2U16((a)&0xffff, (b)&0xffff)
 
#define  FASTDIV(a, b)   ((uint32_t)((((uint64_t)a) * ff_inverse[b]) >> 32))
 

Functions

static av_always_inline int  MULH (int a, int b)
 
static av_always_inline unsigned  UMULH (unsigned a, unsigned b)
 
static av_const int  mid_pred (int a, int b, int c)
 
static av_const int  sign_extend (int val, unsigned bits)
 
static av_const unsigned  zero_extend (unsigned val, unsigned bits)
 
static av_const unsigned int  ff_sqrt (unsigned int a)
 
static int8_t  ff_u8_to_s8 (uint8_t a)
 

Variables

const uint32_t  ff_inverse [257]
 
const uint8_t  ff_reverse [256]
 
const uint8_t  ff_sqrt_tab [256]
 
const uint8_t  ff_crop_tab [256+2 *MAX_NEG_CROP]
 
 

Macro Definition Documentation

#define MAX_NEG_CROP   1024

Definition at line 30 of file mathops.h.

Referenced by cavs_idct8_add_c(), deinterlace_line_c(), deinterlace_line_inplace_c(), filter_common(), filter_mbedge(), h_block_filter(), intra_pred_plane(), mp_yuv_to_rgb(), parse_palette_segment(), pred16x16_tm_vp8_c(), pred4x4_tm_vp8_c(), pred8x8_tm_vp8_c(), rv30_weak_loop_filter(), rv40_weak_loop_filter(), v_block_filter(), wmv2_mspel8_h_lowpass(), wmv2_mspel8_v_lowpass(), and yuv_a_to_rgba().

#define MUL64 (   a,
  b 
)    ((int64_t)(a) * (int64_t)(b))

Definition at line 53 of file mathops.h.

Referenced by decode_var_block_data(), l1_unscale(), MULH(), parcor_to_lpc(), and revert_channel_correlation().

#define MULL (   a,
  b,
  s 
)    (MUL64(a, b) >> (s))

Definition at line 57 of file mathops.h.

Referenced by long_term_filter(), lsp2poly(), and silk_is_lpc_stable().

#define MAC64 (   d,
  a,
  b 
)    ((d) += MUL64(a, b))

Definition at line 73 of file mathops.h.

Referenced by ac3_sum_square_butterfly_int32_c().

#define MLS64 (   d,
  a,
  b 
)    ((d) -= MUL64(a, b))

Definition at line 77 of file mathops.h.

#define MAC16 (   rt,
  ra,
  rb 
)    rt += (ra) * (rb)

Definition at line 82 of file mathops.h.

Referenced by ff_g722_apply_qmf().

#define MUL16 (   ra,
  rb 
)    ((ra) * (rb))

Definition at line 87 of file mathops.h.

#define MLS16 (   rt,
  ra,
  rb 
)    ((rt) -= (ra) * (rb))

Definition at line 91 of file mathops.h.

#define mid_pred   mid_pred

Definition at line 96 of file mathops.h.

Referenced by add_hfyu_median_pred_c(), add_hfyu_median_pred_int16_c(), add_lag_median_prediction(), correlate(), correlate_slice_buffered(), decorrelate(), direct_search(), encode_q_branch(), estimate_motion_b(), ff_estimate_p_frame_motion(), ff_h263_pred_motion(), ff_pre_estimate_p_frame_motion(), get_chroma_mv(), h263_mv4_search(), interlaced_search(), lag_pred_line_yuy2(), loco_predict(), ls_decode_line(), ls_encode_line(), motion_search(), mv_pred_median(), pred_motion(), pred_mv(), pred_pskip_motion(), pred_spatial_direct_motion(), predict(), restore_median(), restore_median_il(), rv34_pred_b_vector(), rv34_pred_mv(), rv34_pred_mv_rv3(), sub_hfyu_median_pred_c(), sub_hfyu_median_pred_int16_c(), svq1_decode_motion_vector(), vc1_mc_4mv_luma(), vc1_pred_b_mv(), vc1_pred_mv(), vc1_pred_mv_intfr(), and wmv2_pred_motion().

#define COPY3_IF_LT (   x,
  y,
  a,
  b,
  c,
  d 
)
Value:
if ((y) < (x)) {\
(x) = (y);\
(a) = (b);\
(c) = (d);\
}

Definition at line 141 of file mathops.h.

#define MASK_ABS (   mask,
  level 
)
Value:
do { \
mask = level >> 31; \
level = (level ^ mask) - mask; \
} while (0)

Definition at line 150 of file mathops.h.

Referenced by dnxhd_init_vlc(), and mpeg1_encode_block().

#define NEG_SSR32 (   a,
  s 
)    ((( int32_t)(a))>>(32-(s)))

Definition at line 157 of file mathops.h.

#define NEG_USR32 (   a,
  s 
)    (((uint32_t)(a))>>(32-(s)))

Definition at line 161 of file mathops.h.

Referenced by decode_block(), decode_block_progressive(), decode_vlc_codeword(), dnxhd_decode_dct_block(), dv_decode_ac(), and get_xbits().

#define PACK_2U8 (   a,
  b 
)    (((b) << 8) | (a))

Definition at line 176 of file mathops.h.

#define PACK_4U8 (   a,
  b,
  c,
  d 
)    (((d) << 24) | ((c) << 16) | ((b) << 8) | (a))

Definition at line 179 of file mathops.h.

Referenced by pred4x4_vertical_vp8_c().

#define PACK_2U16 (   a,
  b 
)    (((b) << 16) | (a))

Definition at line 182 of file mathops.h.

#define PACK_2S8 (   a,
  b 
)    PACK_2U8((a)&255, (b)&255)

Definition at line 187 of file mathops.h.

#define PACK_4S8 (   a,
  b,
  c,
  d 
)    PACK_4U8((a)&255, (b)&255, (c)&255, (d)&255)

Definition at line 190 of file mathops.h.

#define PACK_2S16 (   a,
  b 
)    PACK_2U16((a)&0xffff, (b)&0xffff)

Definition at line 193 of file mathops.h.

#define FASTDIV (   a,
  b 
)    ((uint32_t)((((uint64_t)a) * ff_inverse[b]) >> 32))

Definition at line 197 of file mathops.h.

Referenced by adapt_prob(), decode_blockcode(), ff_mpeg4_pred_dc(), ff_msmpeg4_pred_dc(), ff_sqrt(), get_dc(), mpeg4_decode_block(), unpack_bitstream(), and vorbis_residue_decode_internal().

Function Documentation

static av_always_inline int MULH ( int  a,
int  b 
)
static

Definition at line 61 of file mathops.h.

static av_always_inline unsigned UMULH ( unsigned  a,
unsigned  b 
)
static

Definition at line 67 of file mathops.h.

Referenced by pRNG().

static av_const int mid_pred ( int  a,
int  b,
int  c 
)
inlinestatic

Definition at line 97 of file mathops.h.

static av_const int sign_extend ( int  val,
unsigned  bits 
)
inlinestatic

Definition at line 125 of file mathops.h.

Referenced by adpcm_decode_frame(), alac_linear_predictor(), cinaudio_decode_frame(), decode_band_numwavs(), decode_channel_sf_idx(), decode_qu_spectra(), decode_tones_amplitude(), decode_tones_frequency(), dpcm_decode_frame(), ebml_read_sint(), ff_h263_decode_motion(), ff_h263_encode_motion(), flic_decode_frame_15_16BPP(), flic_decode_frame_8BPP(), generate_joint_tables(), get_sbits_long(), libopus_decode_init(), lpc_prediction(), matroska_parse_block(), mpeg1_encode_motion(), mpeg_decode_motion(), on2avc_decode_pairs(), on2avc_decode_quads(), paf_audio_decode(), smka_decode_frame(), svq1_decode_motion_vector(), tscc2_decode_mb(), tta_decode_frame(), xa_decode(), and xan_wc3_decode_frame().

static av_const unsigned zero_extend ( unsigned  val,
unsigned  bits 
)
inlinestatic

Definition at line 134 of file mathops.h.

static av_const unsigned int ff_sqrt ( unsigned int  a )
inlinestatic

Definition at line 200 of file mathops.h.

Referenced by calc_cpl_coord(), dpcm_predict(), draw_arrow(), encode_q_branch(), ff_estimate_p_frame_motion(), ff_t_sqrt(), fixed_sqrt(), get_visual_weight(), opus_rc_trimodel(), and square_root().

static int8_t ff_u8_to_s8 ( uint8_t  a )
inlinestatic

Definition at line 220 of file mathops.h.

Referenced by color_transform_delta().

Variable Documentation

const uint32_t ff_inverse[257]

Definition at line 27 of file mathtables.c.

Referenced by dct_quantize_TMPL(), ff_msmpeg4_pred_dc(), and setup_classifs().

const uint8_t ff_reverse[256]

Definition at line 74 of file mathtables.c.

Referenced by asv2_get_bits(), asv2_put_bits(), bitswap_32(), decode_frame(), deinvert_buffer(), dsd2pcm_translate(), encode_frame(), fft(), inv_bits(), ir2_decode_frame(), pcm_decode_frame(), pcm_encode_frame(), s302m_decode_frame(), s302m_encode2_frame(), tiff_unpack_fax(), tiff_unpack_strip(), webp_get_vlc(), wnv1_get_code(), xbm_decode_frame(), and xbm_encode_frame().

const uint8_t ff_sqrt_tab[256]

Definition at line 63 of file mathtables.c.

Referenced by ff_sqrt().

const uint8_t ff_crop_tab[256+2 *MAX_NEG_CROP]

Definition at line 96 of file mathtables.c.

const uint8_t ff_zigzag_direct[64]

Definition at line 117 of file mathtables.c.

Referenced by decode_dct(), decode_gop_header(), decode_i_block(), decode_init(), decode_scaling_list(), decode_vol_header(), decode_vop_header(), dnxhd_init_qmat(), dnxhd_init_vlc(), dv_init_enc_block(), dvvideo_decode_init(), encode_picture(), ff_cavs_init(), ff_dct_encode_init_x86(), ff_mjpeg_decode_init(), ff_mpv_idct_init(), ff_rtjpeg_init(), ff_vp56_init_context(), ff_write_quant_matrix(), fic_decode_block(), fill_quantization_matrices(), fill_scaling_lists(), init_scan_tables(), jpg_decode_block(), jpg_init(), ljpeg_encode_init(), load_matrix(), mpeg_decode_picture_coding_extension(), mss4_decode_dct(), tgq_decode_init(), tqi_decode_init(), vaapi_mpeg2_start_frame(), vaapi_mpeg4_start_frame(), and vp3_decode_init().


Generated on Sun Sep 14 2014 18:56:20 for FFmpeg by   doxygen 1.8.2

AltStyle によって変換されたページ (->オリジナル) /