28 #ifndef AVCODEC_H264_H
29 #define AVCODEC_H264_H
42 #define MAX_SPS_COUNT 32
43 #define MAX_PPS_COUNT 256
45 #define MAX_MMCO_COUNT 66
47 #define MAX_DELAYED_PIC_COUNT 16
49 #define MAX_MBPAIR_SIZE (256*1024) // a tighter bound could be calculated if someone cares about a few bytes
53 #define ALLOW_INTERLACE
63 #ifdef ALLOW_INTERLACE
64 #define MB_MBAFF(h) h->mb_mbaff
65 #define MB_FIELD(h) h->mb_field_decoding_flag
66 #define FRAME_MBAFF(h) h->mb_aff_frame
67 #define FIELD_PICTURE(h) (h->picture_structure != PICT_FRAME)
75 #define FRAME_MBAFF(h) 0
76 #define FIELD_PICTURE(h) 0
78 #define IS_INTERLACED(mb_type) 0
84 #define FIELD_OR_MBAFF_PICTURE(h) (FRAME_MBAFF(h) || FIELD_PICTURE(h))
87 #define CABAC(h) h->pps.cabac
90 #define CHROMA(h) (h->sps.chroma_format_idc)
91 #define CHROMA422(h) (h->sps.chroma_format_idc == 2)
92 #define CHROMA444(h) (h->sps.chroma_format_idc == 3)
94 #define EXTENDED_SAR 255
96 #define MB_TYPE_REF0 MB_TYPE_ACPRED // dirty but it fits in 16 bit
97 #define MB_TYPE_8x8DCT 0x01000000
98 #define IS_REF0(a) ((a) & MB_TYPE_REF0)
99 #define IS_8x8DCT(a) ((a) & MB_TYPE_8x8DCT)
101 #define QP_MAX_NUM (51 + 6*6) // The maximum supported qp
365 #define LIST_NOT_USED -1 // FIXME rename?
366 #define PART_NOT_AVAILABLE -2
671 #define FRAME_RECOVERED_IDR (1 << 0)
676 #define FRAME_RECOVERED_SEI (1 << 1)
736 int *dst_length,
int *consumed,
int length);
859 #define LUMA_DC_BLOCK_INDEX 48
860 #define CHROMA_DC_BLOCK_INDEX 49
864 4 + 1 * 8, 5 + 1 * 8, 4 + 2 * 8, 5 + 2 * 8,
865 6 + 1 * 8, 7 + 1 * 8, 6 + 2 * 8, 7 + 2 * 8,
866 4 + 3 * 8, 5 + 3 * 8, 4 + 4 * 8, 5 + 4 * 8,
867 6 + 3 * 8, 7 + 3 * 8, 6 + 4 * 8, 7 + 4 * 8,
868 4 + 6 * 8, 5 + 6 * 8, 4 + 7 * 8, 5 + 7 * 8,
869 6 + 6 * 8, 7 + 6 * 8, 6 + 7 * 8, 7 + 7 * 8,
870 4 + 8 * 8, 5 + 8 * 8, 4 + 9 * 8, 5 + 9 * 8,
871 6 + 8 * 8, 7 + 8 * 8, 6 + 9 * 8, 7 + 9 * 8,
872 4 + 11 * 8, 5 + 11 * 8, 4 + 12 * 8, 5 + 12 * 8,
873 6 + 11 * 8, 7 + 11 * 8, 6 + 12 * 8, 7 + 12 * 8,
874 4 + 13 * 8, 5 + 13 * 8, 4 + 14 * 8, 5 + 14 * 8,
875 6 + 13 * 8, 7 + 13 * 8, 6 + 14 * 8, 7 + 14 * 8,
876 0 + 0 * 8, 0 + 5 * 8, 0 + 10 * 8
882 return (b & 0xFFFF) + (a << 16);
884 return (a & 0xFFFF) + (b << 16);
891 return (b & 0xFF) + (a << 8);
893 return (a & 0xFF) + (b << 8);
910 const int index8 =
scan8[
n];
915 tprintf(h->
avctx,
"mode:%d %d min:%d\n", left, top, min);
929 i4x4[4] = i4x4_cache[7 + 8 * 3];
930 i4x4[5] = i4x4_cache[7 + 8 * 2];
931 i4x4[6] = i4x4_cache[7 + 8 * 1];
940 AV_COPY32(&nnz[ 0], &nnz_cache[4 + 8 * 1]);
941 AV_COPY32(&nnz[ 4], &nnz_cache[4 + 8 * 2]);
942 AV_COPY32(&nnz[ 8], &nnz_cache[4 + 8 * 3]);
943 AV_COPY32(&nnz[12], &nnz_cache[4 + 8 * 4]);
944 AV_COPY32(&nnz[16], &nnz_cache[4 + 8 * 6]);
945 AV_COPY32(&nnz[20], &nnz_cache[4 + 8 * 7]);
946 AV_COPY32(&nnz[32], &nnz_cache[4 + 8 * 11]);
947 AV_COPY32(&nnz[36], &nnz_cache[4 + 8 * 12]);
950 AV_COPY32(&nnz[24], &nnz_cache[4 + 8 * 8]);
951 AV_COPY32(&nnz[28], &nnz_cache[4 + 8 * 9]);
952 AV_COPY32(&nnz[40], &nnz_cache[4 + 8 * 13]);
953 AV_COPY32(&nnz[44], &nnz_cache[4 + 8 * 14]);
960 int mb_type,
int list)
964 AV_COPY128(mv_dst + 0 * b_stride, mv_src + 8 * 0);
965 AV_COPY128(mv_dst + 1 * b_stride, mv_src + 8 * 1);
966 AV_COPY128(mv_dst + 2 * b_stride, mv_src + 8 * 2);
967 AV_COPY128(mv_dst + 3 * b_stride, mv_src + 8 * 3);
976 AV_COPY16(mvd_dst + 3 + 3, mvd_src + 3 + 8 * 0);
977 AV_COPY16(mvd_dst + 3 + 2, mvd_src + 3 + 8 * 1);
978 AV_COPY16(mvd_dst + 3 + 1, mvd_src + 3 + 8 * 2);
985 ref_index[0 + 0 * 2] = ref_cache[
scan8[0]];
986 ref_index[1 + 0 * 2] = ref_cache[scan8[4]];
987 ref_index[0 + 1 * 2] = ref_cache[scan8[8]];
988 ref_index[1 + 1 * 2] = ref_cache[scan8[12]];
996 const int b8_xy = 4 * h->
mb_xy;
1022 0x0001000100010001ULL));
1026 0x0001000100010001ULL));