FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros
intreadwrite.h File Reference
#include <stdint.h>
#include "libavutil/avconfig.h"
#include "attributes.h"
#include "bswap.h"
#include "config.h"

Go to the source code of this file.

Data Structures

union  av_alias
 
union  av_alias
 
union  av_alias
 

Macros

#define AV_RB16(x)
 
#define AV_WB16(p, darg)
 
#define AV_RL16(x)
 
#define AV_WL16(p, darg)
 
#define AV_RB32(x)
 
#define AV_WB32(p, darg)
 
#define AV_RL32(x)
 
#define AV_WL32(p, darg)
 
#define AV_RB64(x)
 
#define AV_WB64(p, darg)
 
#define AV_RL64(x)
 
#define AV_WL64(p, darg)
 
#define AV_RN(s, p)   AV_RL##s(p)
 
#define AV_WN(s, p, v)   AV_WL##s(p, 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_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)
 

Macro Definition Documentation

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

Definition at line 232 of file intreadwrite.h.

#define AV_WB16 (   p,
  darg 
)
#define AV_RL16 (   x)
Value:
((((const uint8_t*)(x))[1] << 8) | \
((const uint8_t*)(x))[0])

Definition at line 245 of file intreadwrite.h.

#define AV_WL16 (   p,
  darg 
)
#define AV_RB32 (   x)
Value:
(((uint32_t)((const uint8_t*)(x))[0] << 24) | \
(((const uint8_t*)(x))[1] << 16) | \
(((const uint8_t*)(x))[2] << 8) | \
((const uint8_t*)(x))[3])

Definition at line 258 of file intreadwrite.h.

#define AV_WB32 (   p,
  darg 
)
#define AV_RL32 (   x)
Value:
(((uint32_t)((const uint8_t*)(x))[3] << 24) | \
(((const uint8_t*)(x))[2] << 16) | \
(((const uint8_t*)(x))[1] << 8) | \
((const uint8_t*)(x))[0])

Definition at line 275 of file intreadwrite.h.

#define AV_WL32 (   p,
  darg 
)
#define AV_RB64 (   x)
Value:
(((uint64_t)((const uint8_t*)(x))[0] << 56) | \
((uint64_t)((const uint8_t*)(x))[1] << 48) | \
((uint64_t)((const uint8_t*)(x))[2] << 40) | \
((uint64_t)((const uint8_t*)(x))[3] << 32) | \
((uint64_t)((const uint8_t*)(x))[4] << 24) | \
((uint64_t)((const uint8_t*)(x))[5] << 16) | \
((uint64_t)((const uint8_t*)(x))[6] << 8) | \
(uint64_t)((const uint8_t*)(x))[7])

Definition at line 292 of file intreadwrite.h.

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

Definition at line 303 of file intreadwrite.h.

Referenced by av_des_crypt_mac(), av_sha512_final(), create_iv(), encode_frame(), ffm_write_packet(), matroska_parse_frame(), mkv_write_header(), mxf_gen_umid(), and storeframe().

#define AV_RL64 (   x)
Value:
(((uint64_t)((const uint8_t*)(x))[7] << 56) | \
((uint64_t)((const uint8_t*)(x))[6] << 48) | \
((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])

Definition at line 317 of file intreadwrite.h.

#define AV_WL64 (   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; \
((uint8_t*)(p))[6] = (d)>>48; \
((uint8_t*)(p))[7] = (d)>>56; \
} while(0)

Definition at line 328 of file intreadwrite.h.

Referenced by av_murmur3_final(), ff_asfcrypt_dec(), sbg_read_packet(), and tta_decode_init().

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

Definition at line 345 of file intreadwrite.h.

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

Definition at line 346 of file intreadwrite.h.

Referenced by libschroedinger_decode_frame().

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

Definition at line 352 of file intreadwrite.h.

Referenced by cdxl_read_probe(), fill16(), and wtvfile_open2().

#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)

Definition at line 364 of file intreadwrite.h.

Referenced by generate_missing_ref(), and rle_unpack().

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

Definition at line 372 of file intreadwrite.h.

Referenced by addkey_d(), and vp8_decode_mb_row_no_filter().

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

Definition at line 381 of file intreadwrite.h.

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

Definition at line 382 of file intreadwrite.h.

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

Definition at line 383 of file intreadwrite.h.

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

Definition at line 384 of file intreadwrite.h.

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

Definition at line 387 of file intreadwrite.h.

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

Definition at line 388 of file intreadwrite.h.

Referenced by alac_encode_init().

#define AV_RL8 (   x)    AV_RB8(x)

Definition at line 390 of file intreadwrite.h.

Referenced by libopus_decode_init(), and opus_header().

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

Definition at line 391 of file intreadwrite.h.

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

Definition at line 436 of file intreadwrite.h.

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

Definition at line 442 of file intreadwrite.h.

Referenced by decode_region(), decode_region_intra(), decode_region_masked(), decode_rle(), encode_frame(), ffm_write_packet(), fill_picture_rgb(), filter_slice(), find_expected_header(), and lag_decode_frame().

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

Definition at line 450 of file intreadwrite.h.

#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)

Definition at line 456 of file intreadwrite.h.

Referenced by cdxl_decode_ham6(), cdxl_decode_ham8(), super2xsai(), and targa_encode_frame().

#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])

Definition at line 464 of file intreadwrite.h.

Referenced by filter_slice().

#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)

Definition at line 473 of file intreadwrite.h.

Referenced by filter_slice().

#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])

Definition at line 485 of file intreadwrite.h.

#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)

Definition at line 494 of file intreadwrite.h.

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

Definition at line 510 of file intreadwrite.h.

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

Definition at line 511 of file intreadwrite.h.

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

Definition at line 514 of file intreadwrite.h.

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

#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));

Definition at line 542 of file intreadwrite.h.

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

Definition at line 545 of file intreadwrite.h.

Referenced by av_memcpy_backptr(), and copy_block2().

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

Definition at line 549 of file intreadwrite.h.

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

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

Definition at line 553 of file intreadwrite.h.

Referenced by copy_block8(), and copy_block9().

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

Definition at line 557 of file intreadwrite.h.

Referenced by copy_block16(), and copy_block17().

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

Definition at line 570 of file intreadwrite.h.

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

Definition at line 574 of file intreadwrite.h.

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

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

Definition at line 582 of file intreadwrite.h.

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

#define AV_COPY128 (   d,
  s 
)
Value:
do { \
AV_COPY64(d, s); \
AV_COPY64((char*)(d)+8, (char*)(s)+8); \
} while(0)

Definition at line 586 of file intreadwrite.h.

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

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

Definition at line 593 of file intreadwrite.h.

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

Definition at line 596 of file intreadwrite.h.

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

Definition at line 599 of file intreadwrite.h.

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

Definition at line 602 of file intreadwrite.h.

Referenced by fill_decode_caches().

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

Definition at line 610 of file intreadwrite.h.

Referenced by fill_decode_caches(), filter_mb_dir(), and vp8_decode_mb_row_no_filter().

#define AV_ZERO128 (   d)
Value:
do { \
AV_ZERO64(d); \
AV_ZERO64((char*)(d)+8); \
} while(0)

Definition at line 614 of file intreadwrite.h.

Referenced by decode_cabac_luma_residual(), decode_luma_residual(), fill_decode_caches(), fill_filter_caches_inter(), intra_predict(), svq3_decode_mb(), and write_back_motion_list().