#include <ctype.h>
#include <errno.h>
#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "attributes.h"
#include "config.h"
#include "intmath.h"
#include "mem.h"
#include "internal.h"
#include "intmath.h"
Go to the source code of this file.
Defines | |
#define | RSHIFT(a, b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b)) |
#define | ROUNDED_DIV(a, b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b)) |
#define | FFABS(a) ((a) >= 0 ? (a) : (-(a))) |
#define | FFSIGN(a) ((a) > 0 ? 1 : -1) |
#define | FFMAX(a, b) ((a) > (b) ? (a) : (b)) |
#define | FFMAX3(a, b, c) FFMAX(FFMAX(a,b),c) |
#define | FFMIN(a, b) ((a) > (b) ? (b) : (a)) |
#define | FFMIN3(a, b, c) FFMIN(FFMIN(a,b),c) |
#define | FFSWAP(type, a, b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0) |
#define | FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0])) |
#define | FFALIGN(x, a) (((x)+(a)-1)&~((a)-1)) |
#define | MKTAG(a, b, c, d) (a | (b << 8) | (c << 16) | (d << 24)) |
#define | MKBETAG(a, b, c, d) (d | (c << 8) | (b << 16) | (a << 24)) |
#define | GET_UTF8(val, GET_BYTE, ERROR) |
#define | GET_UTF16(val, GET_16BIT, ERROR) |
#define | PUT_UTF8(val, tmp, PUT_BYTE) |
#define | PUT_UTF16(val, tmp, PUT_16BIT) |
Functions | |
static av_const int | av_log2_c (unsigned int v) |
static av_const int | av_log2_16bit_c (unsigned int v) |
static av_const int | av_clip (int a, int amin, int amax) |
Clips a signed integer value into the amin-amax range. | |
static av_const uint8_t | av_clip_uint8 (int a) |
Clips a signed integer value into the 0-255 range. | |
static av_const uint16_t | av_clip_uint16 (int a) |
Clips a signed integer value into the 0-65535 range. | |
static av_const int16_t | av_clip_int16 (int a) |
Clips a signed integer value into the -32768,32767 range. | |
static av_const int32_t | av_clipl_int32 (int64_t a) |
Clips a signed 64-bit integer value into the -2147483648,2147483647 range. | |
static av_const float | av_clipf (float a, float amin, float amax) |
Clips a float value into the amin-amax range. | |
static av_const int | av_ceil_log2 (int x) |
Computes ceil(log2(x)). | |
Variables | |
const uint8_t | ff_log2_tab [256] |
const uint8_t | av_reverse [256] |
Definition in file common.h.
#define FFABS | ( | a | ) | ((a) >= 0 ? (a) : (-(a))) |
Definition at line 43 of file common.h.
Referenced by add_8x8basis_TMPL(), av_reduce(), av_resample(), av_transcode(), avi_read_header(), check_mv(), codebook_sanity_check_for_rate_quarter(), compute_pkt_fields(), dct_error(), dct_max8x8_c(), dct_quantize_refine(), dct_quantize_trellis_c(), dct_single_coeff_elimination(), decode_frame_header(), decode_q_branch(), dering_TMPL(), do_a_deblock_C(), do_apply_filter(), doHorizDefFilter_C(), doHorizLowPass_C(), doVertDefFilter_TMPL(), doVertLowPass_TMPL(), dpcm_predict(), draw_line(), dv_init_enc_block(), encode_block(), estimate_stereo_mode(), ff_h264_direct_ref_list_init(), ff_init_me(), ff_jpegls_update_state_regular(), ff_mpeg1_encode_init(), ff_msmpeg4_decode_block(), ff_nelly_get_sample_bits(), filter_mb_mbaff_edgecv(), filter_mb_mbaff_edgev(), find_frame_rate_index(), flashsv_encode_frame(), funny_diamond_search(), get_diff_limited_q(), get_needed_flags(), get_qminmax(), get_sae(), get_scale_factor(), guess_mv(), gxf_seek(), h263_encode_picture_header(), h263_h_loop_filter_c(), h263_v_loop_filter_c(), h264_loop_filter_chroma_c(), h264_loop_filter_chroma_intra_c(), h264_loop_filter_luma_c(), h264_loop_filter_luma_intra_c(), h_block_filter(), hadamard8_intra8x8_c(), headroom(), horizX1Filter(), implicit_weight_table(), init(), init_uni_ac_vlc(), initFilter(), ls_decode_line(), ls_encode_line(), ls_encode_regular(), ls_get_code_runterm(), mov_find_next_sample(), mpc8_decode_frame(), mpeg1_encode_sequence_header(), mpeg4_decode_block(), nsse16_c(), nsse16_mmx(), nsse8_c(), nsse8_mmx(), packedCopyWrapper(), postProcess_TMPL(), pp_postprocess(), pred_spatial_direct_motion(), put_s(), put_symbol(), put_symbol_inline(), read_rle_sgi(), render_line(), render_slice(), reverse_dc_prediction(), rv40_adaptive_loop_filter(), rv40_weak_loop_filter(), sab_diamond_search(), search_for_quantizers_faac(), seq_unpack_rle_block(), skip_check(), sum_abs_dctelem_c(), sws_getShiftedVec(), try_8x8basis_TMPL(), update_vlc_state(), v_block_filter(), var_diamond_search(), vc1_filter_line(), vc1_pred_b_mv(), vc1_pred_mv(), vertX1Filter_TMPL(), vorbis_floor1_decode(), vp6_filter(), vsad16_c(), w_c(), wmv2_pred_motion(), and x8_loop_filter().
#define FFALIGN | ( | x, | |||
a | ) | (((x)+(a)-1)&~((a)-1)) |
Definition at line 53 of file common.h.
Referenced by avcodec_align_dimensions(), avcodec_align_dimensions2(), avcodec_default_get_buffer(), avfilter_default_get_video_buffer(), decode_frame(), decode_init(), decode_slice_header(), encode_frame(), encode_init(), ff_ivi_init_planes(), msrle_decode_frame(), pcm_bluray_decode_frame(), pp_get_context(), spdif_write_packet(), svq1_decode_frame(), vp3_decode_init(), and xsub_encode().
#define FFMAX | ( | a, | |||
b | ) | ((a) > (b) ? (a) : (b)) |
Definition at line 46 of file common.h.
Referenced by adaptive_quantization(), add_codec(), addTonalComponents(), adjust_frame_information(), allocate_buffers(), apply_tns(), asf_write_packet(), av_d2q(), av_estimate_timings_from_pts(), av_fast_malloc(), av_fast_realloc(), av_resample(), av_resample_init(), av_seek_frame_binary(), av_transcode(), avcodec_align_dimensions(), avcodec_default_get_buffer(), avi_read_header(), avi_read_packet(), avi_read_seek(), avi_write_counters(), bidir_refine(), bink_decode_plane(), bit_allocation(), build_feed_streams(), build_filter(), build_table(), calc_input_response(), calc_lowcomp(), calc_lowcomp1(), cavs_decode_frame(), cdg_scroll(), compute_pkt_fields2(), compute_target_time(), copy(), copy_backptr(), copy_chapters(), create_vorbis_context(), dct_error(), dct_max8x8_c(), decode(), decode_audio_block(), decode_chunks(), decode_frame(), decode_lspf(), decode_p_frame(), decode_scale_factors(), decode_var_block_data(), decodeChannelSoundUnit(), decorrelation(), direct_search(), dnxhd_encode_rdo(), dnxhd_find_qscale(), do_a_deblock_C(), do_audio_out(), doHorizDefFilter_C(), doVertDefFilter_TMPL(), encode_block(), encode_picture(), epzs_motion_search_internal(), ff_ac3_bit_alloc_calc_bap(), ff_ac3_bit_alloc_calc_mask(), ff_ac3_bit_alloc_calc_psd(), ff_ac3_parse_header(), ff_acelp_reorder_lsf(), ff_acelp_update_past_gain(), ff_emulated_edge_mc(), ff_gen_syncpoint_search(), ff_get_best_fcode(), ff_init_me(), ff_jpegls_init_state(), ff_jpegls_reset_coding_parameters(), ff_jpegls_update_state_regular(), ff_mjpeg_decode_dqt(), ff_nelly_get_sample_bits(), ff_pca(), ff_probe_input_buffer(), ff_set_min_dist_lsf(), ff_timefilter_update(), ffm_seek1(), findCode(), flac_decode_frame(), flv_write_packet(), full_search(), get_exponent_dynamic(), get_floor_average(), get_limits(), get_new_centroids(), get_quant_quality(), get_video_frame(), get_visual_weight(), guess_mv(), gxf_seek(), h_block_filter(), horizX1Filter(), http_start_receive_data(), init_dequantizer(), init_exp(), init_offset(), initFilter(), is_intra_more_likely(), kalman_smoothen(), libopenjpeg_decode_frame(), main(), match_format(), matroska_parse_block(), matroska_read_seek(), median4(), mkv_write_ass_blocks(), mkv_write_packet(), modify_qscale(), mov_read_ctts(), mov_write_esds_tag(), MPV_encode_picture(), output_packet(), paint_mouse_pointer(), postProcess_TMPL(), pp_postprocess(), ps_tableinit(), psy_3gpp_analyze(), put_codebook_header(), quantize_lpc_coefs(), queue_picture(), read_header(), read_sbr_grid(), read_seek(), read_var_block_data(), residue_encode(), rv34_gen_vlc(), sbr_hf_calc_npatches(), sbr_make_f_derived(), sbr_x_gen(), search_for_ms(), search_for_quantizers_anmr(), search_for_quantizers_faac(), search_for_quantizers_twoloop(), select_input_picture(), shorten_decode_frame(), skip_check(), sp5x_decode_frame(), stabilize_lsps(), start_frame(), sws_diffVec(), sws_getContext(), sws_sumVec(), try_decode_frame(), umh_search(), url_read_complete(), v_block_filter(), var_diamond_search(), vertX1Filter_TMPL(), video_refresh_timer(), wmv2_pred_motion(), write_header(), x8_ac_compensation(), x8_loop_filter(), x8_setup_spatial_compensation(), yop_read_seek(), and zmbv_me().
#define FFMAX3 | ( | a, | |||
b, | |||||
c | ) | FFMAX(FFMAX(a,b),c) |
Definition at line 47 of file common.h.
Referenced by avcodec_align_dimensions(), decode_slice_header(), encode_picture(), ff_mjpeg_decode_frame(), ff_mpeg4_get_video_packet_prefix_length(), iv_decode_frame(), and mjpegb_decode_frame().
#define FFMIN | ( | a, | |||
b | ) | ((a) > (b) ? (b) : (a)) |
Definition at line 48 of file common.h.
Referenced by aac_encode_frame(), ac3_decode_frame(), add_metadata(), aiff_read_packet(), ape_decode_frame(), apply_pitch_filters(), apply_tns(), array_min_int16(), asf_read_header(), av_fifo_generic_read(), av_fifo_generic_write(), av_reduce(), av_resample(), av_resample_init(), avfilter_insert_pad(), avfilter_merge_formats(), avfilter_poll_frame(), avi_read_header(), aw_parse_coords(), bidir_refine(), build_filter(), build_table(), cdg_scroll(), chomp6(), chroma_4mv_motion_lowres(), chrRangeToJpeg_TMPL(), cin_decode_lzss(), cin_decode_rle(), cinaudio_decode_frame(), clean_index(), commit_bitstream_and_slice_buffer(), copy_and_dup(), copy_bits(), copy_chapters(), count_pixels(), dct_quantize_trellis_c(), decode_block(), decode_block_refinement(), decode_frame(), decode_frame_byterun1(), decode_frame_ilbm(), decode_header(), decode_lspf(), decode_mb_i(), decode_prediction(), decode_rgb_frame(), decode_rle(), decode_slice_header(), decode_subframe(), decodeTonalComponents(), dering_TMPL(), direct_search(), dnxhd_encode_rdo(), dnxhd_find_qscale(), do_a_deblock_C(), do_rematrixing(), do_video_out(), doHorizDefFilter_C(), doVertDefFilter_TMPL(), dxa_read_packet(), encode_exp(), encode_ext_header(), encode_frame(), encode_init(), encode_scalar(), encode_superframe(), epzs_motion_search_internal(), ff_aac_ac3_parse(), ff_ac3_bit_alloc_calc_bap(), ff_ac3_bit_alloc_calc_mask(), ff_ac3_bit_alloc_calc_psd(), ff_acelp_reorder_lsf(), ff_amf_get_field_value(), ff_amf_tag_contents(), ff_draw_horiz_band(), ff_eac3_apply_spectral_extension(), ff_emulated_edge_mc(), ff_estimate_p_frame_motion(), ff_find_start_code(), ff_get_best_fcode(), ff_init_long_region(), ff_init_me(), ff_interleave_new_audio_packet(), ff_ivi_init_tiles(), ff_jpegls_reset_coding_parameters(), ff_jpegls_update_state_regular(), ff_pca(), ff_probe_input_buffer(), ff_region_offset2size(), ff_rtmp_packet_read(), ff_rtmp_packet_write(), ff_rtp_send_aac(), ff_rtp_send_h263(), ff_sipr_decode_frame_16k(), ff_spatial_idwt_buffered_slice(), ff_spatial_idwt_slice(), ff_url_split(), ff_vorbis_floor1_render_list(), ffm_seek1(), fill_rectangle(), find_optimal_param(), flac_decode_frame(), floor_encode(), full_search(), get_exponent_dynamic(), get_floor_average(), get_limits(), get_max_p_order(), get_new_centroids(), get_str(), get_symbol(), get_symbol_inline(), get_visual_weight(), gif_image_write_image(), guess_mv(), hpel_motion_lowres(), hScale_altivec_real(), http_read(), http_receive_data(), huffman_decode(), init_poc(), initFilter(), interleave_buffer(), inverse_channel_transform(), iv_decode_frame(), kalman_smoothen(), lsf_decode_fp(), main(), matroska_read_header(), median4(), mjpegb_decode_frame(), mkv_write_ass_blocks(), mkv_write_packet(), mov2textsub(), mov_build_index(), mov_read_default(), mov_read_dref(), mov_write_chpl_tag(), mov_write_uuidprof_tag(), mp_decode_frame(), mp_read_changes_map(), mpc8_get_mask(), mpeg4_decode_sprite_trajectory(), mpeg4_encode_gop_header(), mpeg_decode_slice(), mpeg_motion_lowres(), mpegaudio_parse(), mszh_decomp(), ogg_buffer_data(), op(), paint_mouse_pointer(), pcm_decode_frame(), pitch_sharpening(), postProcess_TMPL(), pred_intra_mode(), predict_slice(), predict_slice_buffered(), psy_3gpp_analyze(), psy_3gpp_init(), put_bitstream_info(), put_buffer(), put_symbol(), put_symbol_inline(), pva_read_timestamp(), qcp_read_header(), qtrle_encode_line(), quantize_bands(), read_access_unit(), read_dcs(), read_packet(), read_seek(), read_ttag(), read_var_block_data(), render_slice(), rm_assemble_video_frame(), rtp_check_and_send_back_rr(), rtp_send_samples(), rv30_decode_init(), rv34_gen_vlc(), save_bits(), sbr_gain_calc(), sbr_make_f_master(), search_for_ms(), search_for_quantizers_anmr(), search_for_quantizers_faac(), search_for_quantizers_fast(), search_for_quantizers_twoloop(), seq_unpack_rle_block(), shorten_decode_frame(), spatial_compensation_1(), spatial_compensation_9(), stabilize_lsps(), stream_component_open(), sub_left_prediction_bgr32(), svq3_decode_mb(), svq3_get_ue_golomb(), synth_frame(), synthesis(), truespeech_decode_frame(), umh_search(), unpack(), unpack_coeffs(), var_diamond_search(), vc1_filter_line(), video_audio_display(), voc_get_packet(), vorbis_decode_init(), vp5_parse_coeff(), vp6_parse_coeff_huffman(), vp8_init(), vqf_read_header(), wavpack_decode_frame(), wiener_denoise(), write_packet(), x8_get_prediction(), x8_loop_filter(), x8_setup_spatial_compensation(), xan_wc3_output_pixel_run(), xsub_encode_rle(), yop_read_seek(), and zmbv_me().
#define FFMIN3 | ( | a, | |||
b, | |||||
c | ) | FFMIN(FFMIN(a,b),c) |
Definition at line 49 of file common.h.
Referenced by decode_frame_byterun1(), mov_read_udta_string(), pred_spatial_direct_motion(), and xan_wc3_copy_pixel_run().
#define FFSIGN | ( | a | ) | ((a) > 0 ? 1 : -1) |
Definition at line 44 of file common.h.
Referenced by alac_linear_predictor(), do_a_deblock_C(), doHorizDefFilter_C(), doVertDefFilter_TMPL(), ff_ivi_decode_blocks(), horizX1Filter(), mulawinv(), sign_only(), and vertX1Filter_TMPL().
#define FFSWAP | ( | type, | |||
a, | |||||
b | ) | do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0) |
Definition at line 51 of file common.h.
Referenced by adpcm_decode_frame(), at1_imdct(), at1_imdct_block(), av_aes_init(), av_rc4_crypt(), av_rc4_init(), avcodec_default_release_buffer(), cinvideo_decode_frame(), cmv_decode_frame(), compute_pkt_fields(), compute_pkt_fields2(), decode_band(), decode_bytes_and_gain(), decode_frame(), decodeFrame(), draw_line(), encode_frame(), eval_coefs(), eval_refl(), ff_acelp_reorder_lsf(), ff_ccitt_unpack(), ff_celp_lp_synthesis_filterf(), ff_fft_calc_3dn2(), ff_h264_fill_default_ref_list(), ff_huff_build_tree(), ff_sort_nearly_sorted_floats(), fft(), getChannelWeights(), IMLT(), mp3_header_compress(), mp3_header_decompress(), png_choose_filter(), png_handle_row(), postfilter(), ra144_decode_frame(), raw_decode(), read_tree(), rm_ac3_swap_bytes(), roq_decode_frame(), roq_encode_video(), switch_buffers(), tgv_decode_frame(), twin_decode_frame(), vmdvideo_decode_frame(), vp56_decode_frame(), and xan_decode_frame().
#define GET_UTF16 | ( | val, | |||
GET_16BIT, | |||||
ERROR | ) |
Value:
val = GET_16BIT;\ {\ unsigned int hi = val - 0xD800;\ if (hi < 0x800) {\ val = GET_16BIT - 0xDC00;\ if (val > 0x3FFU || hi > 0x3FFU)\ ERROR\ val += (hi<<10) + 0x10000;\ }\ }\
val | is the output and should be of type uint32_t. It holds the converted UCS-4 character and should be a left value. | |
GET_16BIT | gets two bytes of UTF-16 encoded data converted to native endianness. It can be a function or a statement whose return value or evaluated value is of type uint16_t. It will be executed up to 2 times. | |
ERROR | action that should be taken when an invalid UTF-16 surrogate is returned from GET_BYTE. It should be a statement that jumps out of the macro, like exit(), goto, return, break, or continue. |
Definition at line 224 of file common.h.
Referenced by get_str16_nolen(), mov_read_chapters(), and read_ttag().
#define GET_UTF8 | ( | val, | |||
GET_BYTE, | |||||
ERROR | ) |
Value:
val= GET_BYTE;\ {\ int ones= 7 - av_log2(val ^ 255);\ if(ones==1)\ ERROR\ val&= 127>>ones;\ while(--ones > 0){\ int tmp= GET_BYTE - 128;\ if(tmp>>6)\ ERROR\ val= (val<<6) + tmp;\ }\ }
val | is the output and should be of type uint32_t. It holds the converted UCS-4 character and should be a left value. | |
GET_BYTE | gets UTF-8 encoded bytes from any proper source. It can be a function or a statement whose return value or evaluated value is of type uint8_t. It will be executed up to 4 times for values in the valid UTF-8 range, and up to 7 times in the general case. | |
ERROR | action that should be taken when an invalid UTF-8 byte is returned from GET_BYTE. It should be a statement that jumps out of the macro, like exit(), goto, return, break, or continue. |
Definition at line 197 of file common.h.
Referenced by ascii_to_wc(), ff_put_str16_nolen(), get_utf8(), and utf8len().
#define MKBETAG | ( | a, | |||
b, | |||||
c, | |||||
d | ) | (d | (c << 8) | (b << 16) | (a << 24)) |
Definition at line 182 of file common.h.
Referenced by alac_encode_init(), ff_mpeg4audio_get_config(), flac_decode_frame(), mjpegb_decode_frame(), nsv_resync(), parse_config_ALS(), probe(), qdm2_decode_init(), read_desc_chunk(), read_header(), read_specific_config(), swf_read_header(), and sync().
#define MKTAG | ( | a, | |||
b, | |||||
c, | |||||
d | ) | (a | (b << 8) | (c << 16) | (d << 24)) |
Definition at line 181 of file common.h.
Referenced by aiff_read_header(), aiff_write_header(), amr_read_header(), ape_read_header(), asf_read_header(), au_read_header(), avi_load_index(), avi_read_header(), bfi_probe(), bfi_read_packet(), daud_header(), decode_frame(), decode_frame_byterun1(), decode_init(), decode_wave_header(), dxa_read_header(), dxa_read_packet(), encode_frame(), ff_flac_is_extradata_valid(), ff_mjpeg_decode_init(), ff_mjpeg_decode_sos(), ff_mov_init_hinting(), ff_rm_read_mdpr_codecdata(), ffm_read_header(), ffm_write_header(), flac_decode_frame(), flac_read_header(), get_codec_data(), ipod_get_codec_tag(), mmf_read_header(), mov_create_chapter_track(), mov_get_codec_tag(), mov_get_dv_codec_tag(), mov_probe(), mov_read_cmov(), mov_read_default(), mov_read_dref(), mov_read_hdlr(), mov_read_meta(), mov_read_stco(), mov_read_stsd(), mov_read_stsz(), mov_read_udta_string(), mov_read_wide(), mov_write_audio_tag(), mov_write_hdlr_tag(), mov_write_header(), mov_write_minf_tag(), mov_write_moov_tag(), mov_write_stbl_tag(), mov_write_stsd_tag(), mov_write_trailer(), mov_write_trak_tag(), mov_write_video_tag(), mp4_get_codec_tag(), mpc_read_header(), msnwc_tcp_probe(), msnwc_tcp_read_header(), nsv_parse_NSVf_header(), nsv_read_chunk(), parse_ffconfig(), png_write_row(), qcp_read_packet(), r3d_probe(), r3d_read_header(), r3d_read_packet(), raw_decode(), raw_init_decoder(), rdt_load_mdpr(), rm_read_header(), rm_read_index(), siff_parse_vbv1(), siff_read_header(), smacker_read_header(), sol_read_header(), thp_probe(), vfw_codecid(), vfw_pixfmt(), vfw_read_header(), vid_probe(), vp3_decode_init(), vqf_probe(), vqf_read_header(), wv_read_block_header(), and xsub_encoder_init().
#define PUT_UTF16 | ( | val, | |||
tmp, | |||||
PUT_16BIT | ) |
Value:
{\ uint32_t in = val;\ if (in < 0x10000) {\ tmp = in;\ PUT_16BIT\ } else {\ tmp = 0xD800 | ((in - 0x10000) >> 10);\ PUT_16BIT\ tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\ PUT_16BIT\ }\ }\
val | is an input-only argument and should be of type uint32_t. It holds a UCS-4 encoded Unicode character that is to be converted to UTF-16. If val is given as a function it is executed only once. | |
tmp | is a temporary variable and should be of type uint16_t. It represents an intermediate value during conversion that is to be output by PUT_16BIT. | |
PUT_16BIT | writes the converted UTF-16 data to any proper destination in desired endianness. It could be a function or a statement, and uses tmp as the input byte. For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be executed 1 or 2 times depending on input character. |
Definition at line 286 of file common.h.
Referenced by ff_put_str16_nolen().
#define PUT_UTF8 | ( | val, | |||
tmp, | |||||
PUT_BYTE | ) |
Value:
{\ int bytes, shift;\ uint32_t in = val;\ if (in < 0x80) {\ tmp = in;\ PUT_BYTE\ } else {\ bytes = (av_log2(in) + 4) / 5;\ shift = (bytes - 1) * 6;\ tmp = (256 - (256 >> bytes)) | (in >> shift);\ PUT_BYTE\ while (shift >= 6) {\ shift -= 6;\ tmp = 0x80 | ((in >> shift) & 0x3f);\ PUT_BYTE\ }\ }\ }
val | is an input-only argument and should be of type uint32_t. It holds a UCS-4 encoded Unicode character that is to be converted to UTF-8. If val is given as a function it is executed only once. | |
tmp | is a temporary variable and should be of type uint8_t. It represents an intermediate value during conversion that is to be output by PUT_BYTE. | |
PUT_BYTE | writes the converted UTF-8 bytes to any proper destination. It could be a function or a statement, and uses tmp as the input byte. For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be executed up to 4 times for values in the valid UTF-8 range and up to 7 times in the general case, depending on the length of the converted Unicode character. |
Definition at line 252 of file common.h.
Referenced by get_str16_nolen(), mov_read_chapters(), mov_read_mac_string(), read_ttag(), and write_utf8().
#define ROUNDED_DIV | ( | a, | |||
b | ) | (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b)) |
Definition at line 42 of file common.h.
Referenced by add_peak(), decide_ac_pred(), decode_ppc(), decode_vop_header(), draw_arrow(), ff_convert_matrix(), initFilter(), mpeg4_decode_sprite_trajectory(), mpeg4_pred_ac(), and vect_division().
#define RSHIFT | ( | a, | |||
b | ) | ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b)) |
Definition at line 40 of file common.h.
Referenced by get_amv(), unpack_vectors(), and vp56_decode_4mv().
static av_const int av_ceil_log2 | ( | int | x | ) | [inline, static] |
Computes ceil(log2(x)).
x | value used to compute ceil(log2(x)) |
Definition at line 176 of file common.h.
Referenced by read_channel_data(), read_specific_config(), read_var_block_data(), and wmavoice_decode_init().
static av_const int av_clip | ( | int | a, | |
int | amin, | |||
int | amax | |||
) | [inline, static] |
Clips a signed integer value into the amin-amax range.
a | value to clip | |
amin | minimum value of the clip range | |
amax | maximum value of the clip range |
Definition at line 107 of file common.h.
Referenced by AC3_encode_init(), adpcm_ct_expand_nibble(), adpcm_decode_frame(), adpcm_sbpro_expand_nibble(), adpcm_yamaha_expand_nibble(), alac_encode_init(), av_log_default_callback(), bgmc_lut_getp(), bit_allocation(), blend_subrect(), build_filter(), build_qp_table(), calc_input_response(), categorize(), choose_vlc_set(), chroma_4mv_motion(), dec_delay3_2nd(), decode(), decode_frame(), decode_gain_and_index(), decode_init(), decode_pitch_lag_1_6(), decode_subband_slice_buffered(), dequantize_slice_buffered(), direct_search(), do_audio_out(), draw_arrow(), draw_line(), encode_block(), encode_frame(), encode_init(), encode_mb_internal(), eval_expr(), ff_ac3_bit_alloc_calc_bap(), ff_decode_pitch_lag(), ff_er_add_slice(), ff_gmc_c(), ff_init_qscale_tab(), ff_ivi_decode_blocks(), ff_mspel_motion(), ff_nelly_get_sample_bits(), ff_vbv_update(), filter_mb_mbaff_edgecv(), filter_mb_mbaff_edgev(), flac_encode_init(), g726_decode(), get_qminmax(), get_scale_factor(), gmc1_motion(), gmc_c(), h263_encode_picture_header(), h263_h_loop_filter_c(), h263_v_loop_filter_c(), h264_loop_filter_chroma_c(), h264_loop_filter_luma_c(), hpel_motion(), implicit_weight_table(), init_dequantizer(), init_pass2(), loop_filter_c1(), loop_filter_l1(), ls_decode_line(), ls_encode_line(), mp_decode_frame_helper(), mp_decode_line(), MPV_motion_internal(), png_enc_init(), quantize_and_encode_band_cost(), quantize_lpc_coefs(), read_channel_data(), read_var_block_data(), round_sample(), rv30_weak_loop_filter(), rv40_adaptive_loop_filter(), search_for_quantizers_faac(), search_for_quantizers_fast(), search_for_quantizers_twoloop(), sum_bits(), svq3_mc_dir(), svq3_mc_dir_part(), synth_block_fcb_acb(), synth_frame(), truespeech_synth(), update_qscale(), value_string(), vc1_interp_mc(), vc1_mc_1mv(), vc1_mc_4mv_chroma(), vc1_mc_4mv_luma(), vc1_pred_b_mv(), vp5_parse_coeff_models(), and vp6_parse_coeff_models().
static av_const int16_t av_clip_int16 | ( | int | a | ) | [inline, static] |
Clips a signed integer value into the -32768,32767 range.
a | value to clip |
Definition at line 141 of file common.h.
Referenced by adpcm_ct_expand_nibble(), adpcm_decode_frame(), adpcm_ima_expand_nibble(), adpcm_ms_expand_nibble(), adpcm_yamaha_expand_nibble(), adx_decode(), atrac3_decode_frame(), av_audio_convert(), av_resample(), cinaudio_decode_frame(), do_apply_filter(), dpcm_decode_frame(), ff_acelp_high_pass_filter(), ff_acelp_interpolate(), ff_acelp_weighted_vector_sum(), ff_iir_filter(), ff_mpa_synth_filter(), ra144_decode_frame(), saturate_output_float(), vmdaudio_decode_audio(), wma_decode_frame(), and xa_decode().
static av_const uint16_t av_clip_uint16 | ( | int | a | ) | [inline, static] |
Clips a signed integer value into the 0-65535 range.
a | value to clip |
Definition at line 130 of file common.h.
Referenced by yuv2yuvX16inC_template().
static av_const uint8_t av_clip_uint8 | ( | int | a | ) | [inline, static] |
Clips a signed integer value into the 0-255 range.
a | value to clip |
Definition at line 119 of file common.h.
Referenced by av_audio_convert(), comp(), encode_picture(), ff_ivi_output_plane(), ff_ivi_recompose53(), ff_vp3_h_loop_filter_c(), ff_vp3_v_loop_filter_c(), ff_vp6_filter_diag4_c(), ff_yuv2rgb_c_init_tables(), filter_mb_mbaff_edgecv(), filter_mb_mbaff_edgev(), h264_loop_filter_chroma_c(), h264_loop_filter_luma_c(), ir2_decode_plane(), ir2_decode_plane_inter(), loop_filter_c1(), loop_filter_l1(), p8idct(), rv34_add_4x4_block(), search_for_quantizers_anmr(), search_for_quantizers_faac(), sws_scale(), tgq_dconly(), tm2_apply_deltas(), tm2_decode_blocks(), unsharpen(), vc1_h_overlap_c(), vc1_parse_frame_header(), vc1_parse_frame_header_adv(), vc1_v_overlap_c(), vp6_filter_hv4(), x8_decode_intra_mb(), yuv2nv12XinC(), and yuv2yuvXinC().
static av_const float av_clipf | ( | float | a, | |
float | amin, | |||
float | amax | |||
) | [inline, static] |
Clips a float value into the amin-amax range.
a | value to clip | |
amin | minimum value of the clip range | |
amax | maximum value of the clip range |
Definition at line 165 of file common.h.
Referenced by decode(), decode_audio_block(), decorrelation(), fixed_gain_smooth(), mulawinv(), pitch_sharpening(), synth_block_fcb_acb(), and vector_clipf_c().
static av_const int32_t av_clipl_int32 | ( | int64_t | a | ) | [inline, static] |
Clips a signed 64-bit integer value into the -2147483648,2147483647 range.
a | value to clip |
Definition at line 152 of file common.h.
Referenced by av_audio_convert().
static av_const int av_log2_16bit_c | ( | unsigned int | v | ) | [inline, static] |
static av_const int av_log2_c | ( | unsigned int | v | ) | [inline, static] |
const uint8_t av_reverse[256] |
Definition at line 53 of file mathematics.c.
Referenced by asv2_get_bits(), asv2_put_bits(), bitswap_32(), decode_frame(), fft(), inv_bits(), ir2_decode_frame(), pcm_decode_frame(), pcm_encode_frame(), tiff_unpack_strip(), and wnv1_get_code().
const uint8_t ff_log2_tab[256] |
Definition at line 42 of file mathematics.c.
Referenced by av_log2_16bit_c(), av_log2_c(), ff_ps_read_data(), put_xsub_rle(), and seq_decode_op1().