FFmpeg  4.0
Data Structures | Macros | Variables
intreadwrite.h File Reference
#include <stdint.h>
#include "libavutil/avconfig.h"
#include "attributes.h"
#include "bswap.h"

Go to the source code of this file.

Data Structures

union  av_alias
 
union  av_alias
 
union  av_alias
 
union  unaligned_64
 
union  unaligned_32
 
union  unaligned_16
 

Macros

#define AV_RN(s, p)   (((const union unaligned_##s *) (p))->l)
 
#define AV_WN(s, p, v)   ((((union unaligned_##s *) (p))->l) = (v))
 
#define AV_RN16(p)   AV_RN(16, p)
 
#define AV_RN32(p)   AV_RN(32, p)
 
#define AV_RN64(p)   AV_RN(64, p)
 
#define AV_WN16(p, v)   AV_WN(16, p, v)
 
#define AV_WN32(p, v)   AV_WN(32, p, v)
 
#define AV_WN64(p, v)   AV_WN(64, p, v)
 
#define AV_RB(s, p)   av_bswap##s(AV_RN##s(p))
 
#define AV_WB(s, p, v)   AV_WN##s(p, av_bswap##s(v))
 
#define AV_RL(s, p)   AV_RN##s(p)
 
#define AV_WL(s, p, v)   AV_WN##s(p, v)
 
#define AV_RB8(x)   (((const uint8_t*)(x))[0])
 
#define AV_WB8(p, d)   do { ((uint8_t*)(p))[0] = (d); } while(0)
 
#define AV_RL8(x)   AV_RB8(x)
 
#define AV_WL8(p, d)   AV_WB8(p, d)
 
#define AV_RB16(p)   AV_RB(16, p)
 
#define AV_WB16(p, v)   AV_WB(16, p, v)
 
#define AV_RL16(p)   AV_RL(16, p)
 
#define AV_WL16(p, v)   AV_WL(16, p, v)
 
#define AV_RB32(p)   AV_RB(32, p)
 
#define AV_WB32(p, v)   AV_WB(32, p, v)
 
#define AV_RL32(p)   AV_RL(32, p)
 
#define AV_WL32(p, v)   AV_WL(32, p, v)
 
#define AV_RB64(p)   AV_RB(64, p)
 
#define AV_WB64(p, v)   AV_WB(64, p, v)
 
#define AV_RL64(p)   AV_RL(64, p)
 
#define AV_WL64(p, v)   AV_WL(64, p, v)
 
#define AV_RB24(x)
 
#define AV_WB24(p, d)
 
#define AV_RL24(x)
 
#define AV_WL24(p, d)
 
#define AV_RB48(x)
 
#define AV_WB48(p, darg)
 
#define AV_RL48(x)
 
#define AV_WL48(p, darg)
 
#define AV_RNA(s, p)   (((const av_alias##s*)(p))->u##s)
 
#define AV_WNA(s, p, v)   (((av_alias##s*)(p))->u##s = (v))
 
#define AV_RN16A(p)   AV_RNA(16, p)
 
#define AV_RN32A(p)   AV_RNA(32, p)
 
#define AV_RN64A(p)   AV_RNA(64, p)
 
#define AV_WN16A(p, v)   AV_WNA(16, p, v)
 
#define AV_WN32A(p, v)   AV_WNA(32, p, v)
 
#define AV_WN64A(p, v)   AV_WNA(64, p, v)
 
#define AV_COPYU(n, d, s)   AV_WN##n(d, AV_RN##n(s));
 
#define AV_COPY16U(d, s)   AV_COPYU(16, d, s)
 
#define AV_COPY32U(d, s)   AV_COPYU(32, d, s)
 
#define AV_COPY64U(d, s)   AV_COPYU(64, d, s)
 
#define AV_COPY128U(d, s)
 
#define AV_COPY(n, d, s)   (((av_alias##n*)(d))->u##n = ((const av_alias##n*)(s))->u##n)
 
#define AV_COPY16(d, s)   AV_COPY(16, d, s)
 
#define AV_COPY32(d, s)   AV_COPY(32, d, s)
 
#define AV_COPY64(d, s)   AV_COPY(64, d, s)
 
#define AV_COPY128(d, s)
 
#define AV_SWAP(n, a, b)   FFSWAP(av_alias##n, *(av_alias##n*)(a), *(av_alias##n*)(b))
 
#define AV_SWAP64(a, b)   AV_SWAP(64, a, b)
 
#define AV_ZERO(n, d)   (((av_alias##n*)(d))->u##n = 0)
 
#define AV_ZERO16(d)   AV_ZERO(16, d)
 
#define AV_ZERO32(d)   AV_ZERO(32, d)
 
#define AV_ZERO64(d)   AV_ZERO(64, d)
 
#define AV_ZERO128(d)
 

Variables

union unaligned_64 av_alias
 

Macro Definition Documentation

◆ AV_RN

#define AV_RN (   s,
 
)    (((const union unaligned_##s *) (p))->l)

Definition at line 224 of file intreadwrite.h.

◆ AV_WN

#define AV_WN (   s,
  p,
 
)    ((((union unaligned_##s *) (p))->l) = (v))

Definition at line 225 of file intreadwrite.h.

◆ AV_RN16

#define AV_RN16 (   p)    AV_RN(16, p)

◆ AV_RN32

#define AV_RN32 (   p)    AV_RN(32, p)

◆ AV_RN64

#define AV_RN64 (   p)    AV_RN(64, p)

◆ AV_WN16

#define AV_WN16 (   p,
 
)    AV_WN(16, p, v)

◆ AV_WN32

#define AV_WN32 (   p,
 
)    AV_WN(32, p, v)

◆ AV_WN64

#define AV_WN64 (   p,
 
)    AV_WN(64, p, v)

◆ AV_RB

#define AV_RB (   s,
 
)    av_bswap##s(AV_RN##s(p))

Definition at line 389 of file intreadwrite.h.

◆ AV_WB

#define AV_WB (   s,
  p,
 
)    AV_WN##s(p, av_bswap##s(v))

Definition at line 390 of file intreadwrite.h.

◆ AV_RL

#define AV_RL (   s,
 
)    AV_RN##s(p)

Definition at line 391 of file intreadwrite.h.

◆ AV_WL

#define AV_WL (   s,
  p,
 
)    AV_WN##s(p, v)

Definition at line 392 of file intreadwrite.h.

◆ AV_RB8

#define AV_RB8 (   x)    (((const uint8_t*)(x))[0])

◆ AV_WB8

#define AV_WB8 (   p,
 
)    do { ((uint8_t*)(p))[0] = (d); } while(0)

Definition at line 396 of file intreadwrite.h.

Referenced by alac_encode_init(), mov_read_dops(), and send_packet().

◆ AV_RL8

#define AV_RL8 (   x)    AV_RB8(x)

◆ AV_WL8

#define AV_WL8 (   p,
 
)    AV_WB8(p, d)

Definition at line 399 of file intreadwrite.h.

Referenced by decode_simple_internal(), and load_ipmovie_packet().

◆ AV_RB16

#define AV_RB16 (   p)    AV_RB(16, p)

Definition at line 402 of file intreadwrite.h.

◆ AV_WB16

#define AV_WB16 (   p,
 
)    AV_WB(16, p, v)

◆ AV_RL16

#define AV_RL16 (   p)    AV_RL(16, p)

Definition at line 409 of file intreadwrite.h.

◆ AV_WL16

#define AV_WL16 (   p,
 
)    AV_WL(16, p, v)

◆ AV_RB32

#define AV_RB32 (   p)    AV_RB(32, p)

Definition at line 416 of file intreadwrite.h.

◆ AV_WB32

#define AV_WB32 (   p,
 
)    AV_WB(32, p, v)

Definition at line 419 of file intreadwrite.h.

Referenced by a64multi_encode_frame(), a64multi_encode_init(), aa_read_header(), alac_encode_init(), alloc_and_copy(), apng_read_header(), apng_write_chunk(), apng_write_trailer(), apply_color_indexing_transform(), auxiliary_info_add_subsample(), av_blowfish_crypt(), av_encryption_info_add_side_data(), av_encryption_init_info_add_side_data(), av_hash_final(), AV_RL24(), av_sha512_final(), av_sha_final(), avui_encode_init(), create_iv(), decipher(), decklink_autodetect(), decode_entropy_coded_image(), dnxhd_encode_picture(), dnxhd_write_header(), dv_read_header(), dv_write_pack(), dyn_packet_buf_write(), encipher(), encode_apng(), encode_codebook(), encode_frame(), encode_headers(), encode_mode(), encode_parse_info(), expect_tag(), ff_avc_write_annexb_extradata(), ff_opus_rc_put_raw(), ff_rtmp_packet_write(), ff_srtp_decrypt(), ff_srtp_encrypt(), ff_videotoolbox_h264_decode_slice(), ffat_init_encoder(), fill_parse_info_header(), filter_frame(), find_expected_header(), flush_packet(), get_qt_codec(), hevc_extradata_to_annexb(), hevc_mp4toannexb_filter(), inv_predict_0(), main(), matroska_parse_prores(), matroska_parse_tracks(), mov_create_dvd_sub_decoder_specific_info(), mov_create_timecode_track(), mov_read_atom_into_extradata(), mov_read_wave(), mp3_header_decompress(), mp3_update_xing(), mpegts_write_packet_internal(), mux_frames(), parse_playlist(), prompeg_write_fec(), prores_encode_picture(), put_bits(), put_bits32(), qdm2_parse_config(), read_kuki_chunk(), redspark_probe(), redspark_read_header(), rtmp_send_hs_packet(), rtmp_server_handshake(), send_picture(), sunrast_encode_frame(), super2xsai(), svq3_parse_packet(), tea_crypt_ecb(), update_size(), utvideo_encode_init(), vc2hq_handle_frame_fragment(), write32_internal(), xmv_fetch_video_packet(), xmv_read_extradata(), and xtea_crypt_ecb().

◆ AV_RL32

#define AV_RL32 (   p)    AV_RL(32, p)

Definition at line 423 of file intreadwrite.h.

◆ AV_WL32

#define AV_WL32 (   p,
 
)    AV_WL(32, p, v)

Definition at line 426 of file intreadwrite.h.

Referenced by add_event(), add_metadata(), ape_read_packet(), apng_read_header(), av_image_copy_to_buffer(), av_lfg_init(), av_md5_final(), av_ripemd_final(), AV_RL24(), avi_read_tag(), celt_header(), compress_color(), decode_simple_internal(), draw_curves(), draw_dot(), dxt1_block_internal(), dxt3_block_internal(), dxt5_block_internal(), dxv_decompress_cgo(), dxv_decompress_cocg(), dxv_decompress_dxt1(), dxv_decompress_dxt5(), dxv_decompress_yo(), encode_frame(), encode_init(), end_ebml_master_crc32(), ff_alloc_a53_sei(), ff_read_riff_info(), ff_side_data_set_encoder_stats(), filter_frame(), libopus_encode(), main(), matroska_parse_frame(), matroska_parse_wavpack(), merge_superframe(), mkv_strip_wavpack(), mov_read_atom_into_extradata(), mov_read_dops(), mp3_update_xing(), mp3lame_encode_frame(), ogg_build_speex_headers(), ogg_read_packet(), oma_read_header(), opus_encode_frame(), parse_vtrk(), png_write_chunk(), put_bits(), put_bits32(), put_bits_le(), read_frame_internal(), read_header(), read_packet(), read_sm_data(), request_frame(), rgtc_block_internal(), rm_assemble_video_frame(), rm_read_audio_stream_info(), rtmpe9_sig(), rtp_asf_fix_header(), sbg_read_packet(), send_command_packet(), set_codec_str(), set_spdif(), smush_read_header(), super2xsai(), svq3_decode_slice_header(), targa_encode_frame(), tf_h(), tf_h0(), tf_RS(), twofish_decrypt(), twofish_encrypt(), udp_get_file_handle(), udp_write(), utvideo_encode_init(), v410_encode_frame(), vorbis_encode_frame(), vorbis_header(), wavpack_encode_block(), webp_decode_frame(), write32_internal(), write_extradata(), and xtea_le_crypt_ecb().

◆ AV_RB64

#define AV_RB64 (   p)    AV_RB(64, p)

Definition at line 430 of file intreadwrite.h.

◆ AV_WB64

#define AV_WB64 (   p,
 
)    AV_WB(64, p, v)

◆ AV_RL64

#define AV_RL64 (   p)    AV_RL(64, p)

Definition at line 437 of file intreadwrite.h.

◆ AV_WL64

#define AV_WL64 (   p,
 
)    AV_WL(64, p, v)

◆ AV_RB24

#define AV_RB24 (   x)
Value:
((((const uint8_t*)(x))[0] << 16) | \
(((const uint8_t*)(x))[1] << 8) | \
((const uint8_t*)(x))[2])
uint8_t

Definition at line 444 of file intreadwrite.h.

◆ AV_WB24

#define AV_WB24 (   p,
 
)

◆ AV_RL24

#define AV_RL24 (   x)
Value:
((((const uint8_t*)(x))[2] << 16) | \
(((const uint8_t*)(x))[1] << 8) | \
((const uint8_t*)(x))[0])
uint8_t

Definition at line 458 of file intreadwrite.h.

◆ AV_WL24

#define AV_WL24 (   p,
 
)
Value:
do { \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[2] = (d)>>16; \
} while(0)
uint8_t

Definition at line 464 of file intreadwrite.h.

Referenced by cdxl_decode_ham6(), cdxl_decode_ham8(), flic_decode_frame_24BPP(), merge_superframe(), request_frame(), super2xsai(), targa_encode_frame(), and update_md5_sum().

◆ AV_RB48

#define AV_RB48 (   x)
Value:
(((uint64_t)((const uint8_t*)(x))[0] << 40) | \
((uint64_t)((const uint8_t*)(x))[1] << 32) | \
((uint64_t)((const uint8_t*)(x))[2] << 24) | \
((uint64_t)((const uint8_t*)(x))[3] << 16) | \
((uint64_t)((const uint8_t*)(x))[4] << 8) | \
(uint64_t)((const uint8_t*)(x))[5])
uint8_t

Definition at line 472 of file intreadwrite.h.

Referenced by filter_frame(), hflip_b48_c(), interleave_cols_to_any(), and transpose_block_48_c().

◆ AV_WB48

#define AV_WB48 (   p,
  darg 
)
Value:
do { \
uint64_t d = (darg); \
((uint8_t*)(p))[5] = (d); \
((uint8_t*)(p))[4] = (d)>>8; \
((uint8_t*)(p))[3] = (d)>>16; \
((uint8_t*)(p))[2] = (d)>>24; \
((uint8_t*)(p))[1] = (d)>>32; \
((uint8_t*)(p))[0] = (d)>>40; \
} while(0)
uint8_t

Definition at line 481 of file intreadwrite.h.

Referenced by filter_frame(), hflip_b48_c(), interleave_cols_to_any(), and transpose_block_48_c().

◆ AV_RL48

#define AV_RL48 (   x)
Value:
(((uint64_t)((const uint8_t*)(x))[5] << 40) | \
((uint64_t)((const uint8_t*)(x))[4] << 32) | \
((uint64_t)((const uint8_t*)(x))[3] << 24) | \
((uint64_t)((const uint8_t*)(x))[2] << 16) | \
((uint64_t)((const uint8_t*)(x))[1] << 8) | \
(uint64_t)((const uint8_t*)(x))[0])
uint8_t

Definition at line 493 of file intreadwrite.h.

◆ AV_WL48

#define AV_WL48 (   p,
  darg 
)
Value:
do { \
uint64_t d = (darg); \
((uint8_t*)(p))[0] = (d); \
((uint8_t*)(p))[1] = (d)>>8; \
((uint8_t*)(p))[2] = (d)>>16; \
((uint8_t*)(p))[3] = (d)>>24; \
((uint8_t*)(p))[4] = (d)>>32; \
((uint8_t*)(p))[5] = (d)>>40; \
} while(0)
uint8_t

Definition at line 502 of file intreadwrite.h.

◆ AV_RNA

#define AV_RNA (   s,
 
)    (((const av_alias##s*)(p))->u##s)

Definition at line 518 of file intreadwrite.h.

◆ AV_WNA

#define AV_WNA (   s,
  p,
 
)    (((av_alias##s*)(p))->u##s = (v))

Definition at line 519 of file intreadwrite.h.

◆ AV_RN16A

#define AV_RN16A (   p)    AV_RNA(16, p)

Definition at line 522 of file intreadwrite.h.

Referenced by dctcoef_get(), decode_coeffs(), inter_recon(), and intra_recon().

◆ AV_RN32A

#define AV_RN32A (   p)    AV_RNA(32, p)

◆ AV_RN64A

#define AV_RN64A (   p)    AV_RNA(64, p)

◆ AV_WN16A

#define AV_WN16A (   p,
 
)    AV_WNA(16, p, v)

◆ AV_WN32A

#define AV_WN32A (   p,
 
)    AV_WNA(32, p, v)

◆ AV_WN64A

#define AV_WN64A (   p,
 
)    AV_WNA(64, p, v)

◆ AV_COPYU

#define AV_COPYU (   n,
  d,
  s 
)    AV_WN##n(d, AV_RN##n(s));

Definition at line 550 of file intreadwrite.h.

◆ AV_COPY16U

#define AV_COPY16U (   d,
  s 
)    AV_COPYU(16, d, s)

Definition at line 553 of file intreadwrite.h.

Referenced by av_memcpy_backptr(), and copy_block2().

◆ AV_COPY32U

#define AV_COPY32U (   d,
  s 
)    AV_COPYU(32, d, s)

Definition at line 557 of file intreadwrite.h.

Referenced by av_memcpy_backptr(), copy(), copy_block4(), and dxtory_decode_v1_410().

◆ AV_COPY64U

#define AV_COPY64U (   d,
  s 
)    AV_COPYU(64, d, s)

Definition at line 561 of file intreadwrite.h.

Referenced by copy_block8(), copy_block9(), and copy_CTB().

◆ AV_COPY128U

#define AV_COPY128U (   d,
  s 
)
Value:
do { \
AV_COPY64U(d, s); \
AV_COPY64U((char *)(d) + 8, (const char *)(s) + 8); \
} while(0)
const char * s
Definition: avisynth_c.h:768

Definition at line 565 of file intreadwrite.h.

Referenced by copy_block16(), copy_block17(), fill_in_adpcm_bufer(), and get_pixels_16_c().

◆ AV_COPY

#define AV_COPY (   n,
  d,
  s 
)    (((av_alias##n*)(d))->u##n = ((const av_alias##n*)(s))->u##n)

Definition at line 578 of file intreadwrite.h.

◆ AV_COPY16

#define AV_COPY16 (   d,
  s 
)    AV_COPY(16, d, s)

◆ AV_COPY32

#define AV_COPY32 (   d,
  s 
)    AV_COPY(32, d, s)

◆ AV_COPY64

#define AV_COPY64 (   d,
  s 
)    AV_COPY(64, d, s)

Definition at line 590 of file intreadwrite.h.

Referenced by backup_mb_border(), fill_decode_caches(), and write_back_motion_list().

◆ AV_COPY128

#define AV_COPY128 (   d,
  s 
)
Value:
do { \
AV_COPY64(d, s); \
AV_COPY64((char*)(d)+8, (char*)(s)+8); \
} while(0)
const char * s
Definition: avisynth_c.h:768

Definition at line 594 of file intreadwrite.h.

Referenced by backup_mb_border(), copy_CTB(), fill_decode_caches(), fill_filter_caches_inter(), parse_frame_data(), parse_x96_frame_data(), and write_back_motion_list().

◆ AV_SWAP

#define AV_SWAP (   n,
  a,
  b 
)    FFSWAP(av_alias##n, *(av_alias##n*)(a), *(av_alias##n*)(b))

Definition at line 601 of file intreadwrite.h.

◆ AV_SWAP64

#define AV_SWAP64 (   a,
  b 
)    AV_SWAP(64, a, b)

Definition at line 604 of file intreadwrite.h.

◆ AV_ZERO

#define AV_ZERO (   n,
 
)    (((av_alias##n*)(d))->u##n = 0)

Definition at line 607 of file intreadwrite.h.

◆ AV_ZERO16

#define AV_ZERO16 (   d)    AV_ZERO(16, d)

Definition at line 610 of file intreadwrite.h.

Referenced by derive_spatial_merge_candidates(), and fill_decode_caches().

◆ AV_ZERO32

#define AV_ZERO32 (   d)    AV_ZERO(32, d)

◆ AV_ZERO64

#define AV_ZERO64 (   d)    AV_ZERO(64, d)

◆ AV_ZERO128

#define AV_ZERO128 (   d)

Variable Documentation

◆ av_alias