51 0 + 0 * 4, 0 + 1 * 4, 1 + 0 * 4, 0 + 2 * 4,
52 0 + 3 * 4, 1 + 1 * 4, 1 + 2 * 4, 1 + 3 * 4,
53 2 + 0 * 4, 2 + 1 * 4, 2 + 2 * 4, 2 + 3 * 4,
54 3 + 0 * 4, 3 + 1 * 4, 3 + 2 * 4, 3 + 3 * 4,
58 0 + 0 * 8, 0 + 1 * 8, 0 + 2 * 8, 1 + 0 * 8,
59 1 + 1 * 8, 0 + 3 * 8, 0 + 4 * 8, 1 + 2 * 8,
60 2 + 0 * 8, 1 + 3 * 8, 0 + 5 * 8, 0 + 6 * 8,
61 0 + 7 * 8, 1 + 4 * 8, 2 + 1 * 8, 3 + 0 * 8,
62 2 + 2 * 8, 1 + 5 * 8, 1 + 6 * 8, 1 + 7 * 8,
63 2 + 3 * 8, 3 + 1 * 8, 4 + 0 * 8, 3 + 2 * 8,
64 2 + 4 * 8, 2 + 5 * 8, 2 + 6 * 8, 2 + 7 * 8,
65 3 + 3 * 8, 4 + 1 * 8, 5 + 0 * 8, 4 + 2 * 8,
66 3 + 4 * 8, 3 + 5 * 8, 3 + 6 * 8, 3 + 7 * 8,
67 4 + 3 * 8, 5 + 1 * 8, 6 + 0 * 8, 5 + 2 * 8,
68 4 + 4 * 8, 4 + 5 * 8, 4 + 6 * 8, 4 + 7 * 8,
69 5 + 3 * 8, 6 + 1 * 8, 6 + 2 * 8, 5 + 4 * 8,
70 5 + 5 * 8, 5 + 6 * 8, 5 + 7 * 8, 6 + 3 * 8,
71 7 + 0 * 8, 7 + 1 * 8, 6 + 4 * 8, 6 + 5 * 8,
72 6 + 6 * 8, 6 + 7 * 8, 7 + 2 * 8, 7 + 3 * 8,
73 7 + 4 * 8, 7 + 5 * 8, 7 + 6 * 8, 7 + 7 * 8,
77 0 + 0 * 8, 1 + 1 * 8, 2 + 0 * 8, 0 + 7 * 8,
78 2 + 2 * 8, 2 + 3 * 8, 2 + 4 * 8, 3 + 3 * 8,
79 3 + 4 * 8, 4 + 3 * 8, 4 + 4 * 8, 5 + 3 * 8,
80 5 + 5 * 8, 7 + 0 * 8, 6 + 6 * 8, 7 + 4 * 8,
81 0 + 1 * 8, 0 + 3 * 8, 1 + 3 * 8, 1 + 4 * 8,
82 1 + 5 * 8, 3 + 1 * 8, 2 + 5 * 8, 4 + 1 * 8,
83 3 + 5 * 8, 5 + 1 * 8, 4 + 5 * 8, 6 + 1 * 8,
84 5 + 6 * 8, 7 + 1 * 8, 6 + 7 * 8, 7 + 5 * 8,
85 0 + 2 * 8, 0 + 4 * 8, 0 + 5 * 8, 2 + 1 * 8,
86 1 + 6 * 8, 4 + 0 * 8, 2 + 6 * 8, 5 + 0 * 8,
87 3 + 6 * 8, 6 + 0 * 8, 4 + 6 * 8, 6 + 2 * 8,
88 5 + 7 * 8, 6 + 4 * 8, 7 + 2 * 8, 7 + 6 * 8,
89 1 + 0 * 8, 1 + 2 * 8, 0 + 6 * 8, 3 + 0 * 8,
90 1 + 7 * 8, 3 + 2 * 8, 2 + 7 * 8, 4 + 2 * 8,
91 3 + 7 * 8, 5 + 2 * 8, 4 + 7 * 8, 5 + 4 * 8,
92 6 + 3 * 8, 6 + 5 * 8, 7 + 3 * 8, 7 + 7 * 8,
97 0 + 0 * 8, 1 + 1 * 8, 1 + 2 * 8, 2 + 2 * 8,
98 4 + 1 * 8, 0 + 5 * 8, 3 + 3 * 8, 7 + 0 * 8,
99 3 + 4 * 8, 1 + 7 * 8, 5 + 3 * 8, 6 + 3 * 8,
100 2 + 7 * 8, 6 + 4 * 8, 5 + 6 * 8, 7 + 5 * 8,
101 1 + 0 * 8, 2 + 0 * 8, 0 + 3 * 8, 3 + 1 * 8,
102 3 + 2 * 8, 0 + 6 * 8, 4 + 2 * 8, 6 + 1 * 8,
103 2 + 5 * 8, 2 + 6 * 8, 6 + 2 * 8, 5 + 4 * 8,
104 3 + 7 * 8, 7 + 3 * 8, 4 + 7 * 8, 7 + 6 * 8,
105 0 + 1 * 8, 3 + 0 * 8, 0 + 4 * 8, 4 + 0 * 8,
106 2 + 3 * 8, 1 + 5 * 8, 5 + 1 * 8, 5 + 2 * 8,
107 1 + 6 * 8, 3 + 5 * 8, 7 + 1 * 8, 4 + 5 * 8,
108 4 + 6 * 8, 7 + 4 * 8, 5 + 7 * 8, 6 + 7 * 8,
109 0 + 2 * 8, 2 + 1 * 8, 1 + 3 * 8, 5 + 0 * 8,
110 1 + 4 * 8, 2 + 4 * 8, 6 + 0 * 8, 4 + 3 * 8,
111 0 + 7 * 8, 4 + 4 * 8, 7 + 2 * 8, 3 + 6 * 8,
112 5 + 5 * 8, 6 + 5 * 8, 6 + 6 * 8, 7 + 7 * 8,
164 const int b4_stride = h->
mb_width * 4 + 1;
165 const int b4_array_size = b4_stride * h->
mb_height * 4;
210 int h_chroma_shift, v_chroma_shift;
212 &h_chroma_shift, &v_chroma_shift);
216 0x80, AV_CEIL_RSHIFT(pic->
f->
width, h_chroma_shift));
218 0x80, AV_CEIL_RSHIFT(pic->
f->
width, h_chroma_shift));
236 for (i = 0; i < 2; i++) {
258 return (ret < 0) ? ret :
AVERROR(ENOMEM);
273 #define IN_RANGE(a, b, size) (((void*)(a) >= (void*)(b)) && ((void*)(a) < (void*)((b) + (size)))) 275 #define REBASE_PICTURE(pic, new_ctx, old_ctx) \ 276 (((pic) && (pic) >= (old_ctx)->DPB && \ 277 (pic) < (old_ctx)->DPB + H264_MAX_PICTURE_COUNT) ? \ 278 &(new_ctx)->DPB[(pic) - (old_ctx)->DPB] : NULL) 286 for (i = 0; i <
count; i++) {
312 (h->
width != h1->width ||
313 h->
height != h1->height ||
343 if (h1->ps.pps_ref) {
348 if (need_reinit || !inited) {
349 h->
width = h1->width;
383 if (h1->DPB[i].f->buf[0] &&
390 if (h1->cur_pic.f->buf[0]) {
404 memcpy(&h->
poc, &h1->poc,
sizeof(h->
poc));
414 memcpy(h->
mmco, h1->mmco,
sizeof(h->
mmco));
436 if (h1->sei.unregistered.nb_buf_ref) {
438 h1->sei.unregistered.nb_buf_ref,
443 for (i = 0; i < h1->sei.unregistered.nb_buf_ref; i++) {
516 if (CONFIG_ERROR_RESILIENCE) {
528 if (CONFIG_ERROR_RESILIENCE && h->
enable_er) {
534 for (i = 0; i < 16; i++) {
538 for (i = 0; i < 16; i++) {
570 int linesize,
int uvlinesize,
580 src_cb -= uvlinesize;
581 src_cr -= uvlinesize;
587 AV_COPY128(top_border, src_y + 15 * linesize);
589 AV_COPY128(top_border + 16, src_y + 15 * linesize + 16);
593 AV_COPY128(top_border + 32, src_cb + 15 * uvlinesize);
594 AV_COPY128(top_border + 48, src_cb + 15 * uvlinesize + 16);
595 AV_COPY128(top_border + 64, src_cr + 15 * uvlinesize);
596 AV_COPY128(top_border + 80, src_cr + 15 * uvlinesize + 16);
598 AV_COPY128(top_border + 16, src_cb + 15 * uvlinesize);
599 AV_COPY128(top_border + 32, src_cr + 15 * uvlinesize);
601 }
else if (chroma422) {
603 AV_COPY128(top_border + 32, src_cb + 15 * uvlinesize);
604 AV_COPY128(top_border + 48, src_cr + 15 * uvlinesize);
606 AV_COPY64(top_border + 16, src_cb + 15 * uvlinesize);
607 AV_COPY64(top_border + 24, src_cr + 15 * uvlinesize);
611 AV_COPY128(top_border + 32, src_cb + 7 * uvlinesize);
612 AV_COPY128(top_border + 48, src_cr + 7 * uvlinesize);
614 AV_COPY64(top_border + 16, src_cb + 7 * uvlinesize);
615 AV_COPY64(top_border + 24, src_cr + 7 * uvlinesize);
629 AV_COPY128(top_border, src_y + 16 * linesize);
631 AV_COPY128(top_border + 16, src_y + 16 * linesize + 16);
636 AV_COPY128(top_border + 32, src_cb + 16 * linesize);
637 AV_COPY128(top_border + 48, src_cb + 16 * linesize + 16);
638 AV_COPY128(top_border + 64, src_cr + 16 * linesize);
639 AV_COPY128(top_border + 80, src_cr + 16 * linesize + 16);
641 AV_COPY128(top_border + 16, src_cb + 16 * linesize);
642 AV_COPY128(top_border + 32, src_cr + 16 * linesize);
644 }
else if (chroma422) {
646 AV_COPY128(top_border + 32, src_cb + 16 * uvlinesize);
647 AV_COPY128(top_border + 48, src_cr + 16 * uvlinesize);
649 AV_COPY64(top_border + 16, src_cb + 16 * uvlinesize);
650 AV_COPY64(top_border + 24, src_cr + 16 * uvlinesize);
654 AV_COPY128(top_border + 32, src_cb + 8 * uvlinesize);
655 AV_COPY128(top_border + 48, src_cr + 8 * uvlinesize);
657 AV_COPY64(top_border + 16, src_cb + 8 * uvlinesize);
658 AV_COPY64(top_border + 24, src_cr + 8 * uvlinesize);
671 int ref0, ref1,
i, cur_poc, ref_start, ref_count0, ref_count1;
673 for (i = 0; i < 2; i++) {
705 for (ref0 = ref_start; ref0 < ref_count0; ref0++) {
707 for (ref1 = ref_start; ref1 < ref_count1; ref1++) {
714 int tx = (16384 + (
FFABS(td) >> 1)) /
td;
715 int dist_scale_factor = (tb * tx + 32) >> 8;
716 if (dist_scale_factor >= -64 && dist_scale_factor <= 128)
717 w = 64 - dist_scale_factor;
736 for (i = 0; i < 16; i++) {
737 #define TRANSPOSE(x) ((x) >> 2) | (((x) << 2) & 0xF) 742 for (i = 0; i < 64; i++) {
743 #define TRANSPOSE(x) ((x) >> 3) | (((x) & 7) << 3) 769 #define HWACCEL_MAX (CONFIG_H264_DXVA2_HWACCEL + \ 770 (CONFIG_H264_D3D11VA_HWACCEL * 2) + \ 771 CONFIG_H264_NVDEC_HWACCEL + \ 772 CONFIG_H264_VAAPI_HWACCEL + \ 773 CONFIG_H264_VIDEOTOOLBOX_HWACCEL + \ 774 CONFIG_H264_VDPAU_HWACCEL) 825 #if CONFIG_H264_VDPAU_HWACCEL 828 #if CONFIG_H264_NVDEC_HWACCEL 844 #if CONFIG_H264_DXVA2_HWACCEL 847 #if CONFIG_H264_D3D11VA_HWACCEL 851 #if CONFIG_H264_VAAPI_HWACCEL 854 #if CONFIG_H264_VIDEOTOOLBOX_HWACCEL 1018 int needs_reinit = 0, must_reinit,
ret;
1104 "changing width %d -> %d / height %d -> %d on " 1126 "h264_slice_header_init() failed\n");
1323 sizeof(uint32_t)*4);
1327 tc_sd = (uint32_t*)tcside->
data;
1330 for (
int i = 0;
i < tc_sd[0];
i++) {
1352 int i, pics, out_of_order, out_idx;
1362 for (i = 0; 1; i++) {
1374 out_of_order =
FFMAX(out_of_order, 1);
1383 av_log(h->
avctx, loglevel,
"Increasing reorder buffer to %d\n", out_of_order);
1451 const H2645NAL *nal,
int first_slice)
1456 int last_pic_structure, last_pic_droppable,
ret;
1487 unwrap_prev_frame_num -= max_frame_num;
1491 if (unwrap_prev_frame_num < 0)
1492 unwrap_prev_frame_num += max_frame_num;
1539 "Invalid field mode combination %d/%d\n",
1544 }
else if (last_pic_droppable != h->
droppable) {
1546 "Found reference and non-reference fields in the same frame, which");
1742 unsigned int slice_type,
tmp,
i;
1743 int field_pic_flag, bottom_field_flag;
1745 int picture_structure;
1753 if (slice_type > 9) {
1755 "slice type %d too large at %d\n",
1759 if (slice_type > 4) {
1782 "non-existing PPS %u referenced\n",
1808 if (field_pic_flag) {
1852 picture_structure, h->
avctx);
1865 for (i = 0; i < 2; i++) {
1874 picture_structure, h->
avctx);
1918 "deblocking_filter_idc %u out of range\n", tmp);
1928 if (slice_alpha_c0_offset_div2 > 6 ||
1929 slice_alpha_c0_offset_div2 < -6 ||
1930 slice_beta_offset_div2 > 6 ||
1931 slice_beta_offset_div2 < -6) {
1933 "deblocking filter parameters %d %d out of range\n",
1934 slice_alpha_c0_offset_div2, slice_beta_offset_div2);
2026 for (j = 0; j < 2; j++) {
2029 for (i = 0; i < 16; i++) {
2031 if (j < sl->list_count && i < sl->ref_count[j] &&
2050 for (i = 0; i < 16; i++)
2053 ref2frm[18 + 1] = -1;
2054 for (i = 16; i < 48; i++)
2055 ref2frm[i + 4] = 4 * id_list[(i - 16) >> 1] +
2061 "slice:%d %s mb:%d %c%s%s frame:%d poc:%d/%d ref:%d/%d qp:%d loop:%d:%d:%d weight:%d%s %s\n",
2119 memcpy(&tmp_ctx, h->
slice_ctx,
sizeof(tmp_ctx));
2120 memcpy(h->
slice_ctx, sl,
sizeof(tmp_ctx));
2121 memcpy(sl, &tmp_ctx,
sizeof(tmp_ctx));
2175 "SPS changed in the middle of the frame\n");
2188 "Changing field mode (%d -> %d) between slices is not allowed\n",
2193 "unset cur_pic_ptr on slice %d\n",
2228 int mb_type,
int top_xy,
2231 int left_type[LEFT_MBS],
2232 int mb_xy,
int list)
2239 const int b_xy = h->
mb2b_xy[top_xy] + 3 * b_stride;
2240 const int b8_xy = 4 * top_xy + 2;
2243 ref_cache[0 - 1 * 8] =
2245 ref_cache[2 - 1 * 8] =
2255 const int b8_xy = 4 * left_xy[
LTOP] + 1;
2263 ref_cache[-1 + 16] =
2272 ref_cache[-1 + 16] =
2290 uint32_t ref01 = (
pack16to32(ref2frm[ref[0]], ref2frm[ref[1]]) & 0x00FF00FF) * 0x0101;
2291 uint32_t ref23 = (
pack16to32(ref2frm[ref[2]], ref2frm[ref[3]]) & 0x00FF00FF) * 0x0101;
2292 AV_WN32A(&ref_cache[0 * 8], ref01);
2293 AV_WN32A(&ref_cache[1 * 8], ref01);
2294 AV_WN32A(&ref_cache[2 * 8], ref23);
2295 AV_WN32A(&ref_cache[3 * 8], ref23);
2300 AV_COPY128(mv_dst + 8 * 0, mv_src + 0 * b_stride);
2301 AV_COPY128(mv_dst + 8 * 1, mv_src + 1 * b_stride);
2302 AV_COPY128(mv_dst + 8 * 2, mv_src + 2 * b_stride);
2303 AV_COPY128(mv_dst + 8 * 3, mv_src + 3 * b_stride);
2312 const int mb_xy = sl->
mb_xy;
2320 left_xy[
LBOT] = left_xy[
LTOP] = mb_xy - 1;
2325 if (left_mb_field_flag != curr_mb_field_flag)
2328 if (curr_mb_field_flag)
2331 if (left_mb_field_flag != curr_mb_field_flag)
2345 if (qp <= qp_thresh &&
2346 (left_xy[
LTOP] < 0 ||
2352 if ((left_xy[
LTOP] < 0 ||
2367 left_type[
LTOP] = left_type[
LBOT] = 0;
2372 left_type[
LTOP] = left_type[
LBOT] = 0;
2382 top_type, left_type, mb_xy, 0);
2385 top_type, left_type, mb_xy, 1);
2389 AV_COPY32(&nnz_cache[4 + 8 * 1], &nnz[0]);
2390 AV_COPY32(&nnz_cache[4 + 8 * 2], &nnz[4]);
2391 AV_COPY32(&nnz_cache[4 + 8 * 3], &nnz[8]);
2392 AV_COPY32(&nnz_cache[4 + 8 * 4], &nnz[12]);
2397 AV_COPY32(&nnz_cache[4 + 8 * 0], &nnz[3 * 4]);
2400 if (left_type[
LTOP]) {
2402 nnz_cache[3 + 8 * 1] = nnz[3 + 0 * 4];
2403 nnz_cache[3 + 8 * 2] = nnz[3 + 1 * 4];
2404 nnz_cache[3 + 8 * 3] = nnz[3 + 2 * 4];
2405 nnz_cache[3 + 8 * 4] = nnz[3 + 3 * 4];
2412 nnz_cache[4 + 8 * 0] =
2413 nnz_cache[5 + 8 * 0] = (h->
cbp_table[top_xy] & 0x4000) >> 12;
2414 nnz_cache[6 + 8 * 0] =
2415 nnz_cache[7 + 8 * 0] = (h->
cbp_table[top_xy] & 0x8000) >> 12;
2418 nnz_cache[3 + 8 * 1] =
2419 nnz_cache[3 + 8 * 2] = (h->
cbp_table[left_xy[
LTOP]] & 0x2000) >> 12;
2422 nnz_cache[3 + 8 * 3] =
2423 nnz_cache[3 + 8 * 4] = (h->
cbp_table[left_xy[
LBOT]] & 0x8000) >> 12;
2427 nnz_cache[
scan8[0]] =
2428 nnz_cache[scan8[1]] =
2429 nnz_cache[scan8[2]] =
2430 nnz_cache[scan8[3]] = (sl->
cbp & 0x1000) >> 12;
2432 nnz_cache[scan8[0 + 4]] =
2433 nnz_cache[scan8[1 + 4]] =
2434 nnz_cache[scan8[2 + 4]] =
2435 nnz_cache[scan8[3 + 4]] = (sl->
cbp & 0x2000) >> 12;
2437 nnz_cache[scan8[0 + 8]] =
2438 nnz_cache[scan8[1 + 8]] =
2439 nnz_cache[scan8[2 + 8]] =
2440 nnz_cache[scan8[3 + 8]] = (sl->
cbp & 0x4000) >> 12;
2442 nnz_cache[scan8[0 + 12]] =
2443 nnz_cache[scan8[1 + 12]] =
2444 nnz_cache[scan8[2 + 12]] =
2445 nnz_cache[scan8[3 + 12]] = (sl->
cbp & 0x8000) >> 12;
2454 uint8_t *dest_y, *dest_cb, *dest_cr;
2455 int linesize, uvlinesize, mb_x, mb_y;
2465 for (mb_x = start_x; mb_x < end_x; mb_x++)
2466 for (mb_y = end_mb_y -
FRAME_MBAFF(h); mb_y <= end_mb_y; mb_y++) {
2478 ((mb_x << pixel_shift) + mb_y * sl->
linesize) * 16;
2480 (mb_x << pixel_shift) * (8 <<
CHROMA444(h)) +
2483 (mb_x << pixel_shift) * (8 <<
CHROMA444(h)) +
2508 linesize, uvlinesize);
2511 dest_cr, linesize, uvlinesize);
2543 if ((top + height) >= pic_height)
2544 height += deblock_border;
2545 top -= deblock_border;
2548 if (top >= pic_height || (top + height) < 0)
2551 height =
FFMIN(height, pic_height - top);
2567 int startx,
int starty,
2568 int endx,
int endy,
int status)
2573 if (CONFIG_ERROR_RESILIENCE) {
2584 int lf_x_start = sl->
mb_x;
2659 if (sl->
mb_x >= lf_x_start)
2677 sl->
mb_x = lf_x_start = 0;
2692 if (sl->
mb_x > lf_x_start)
2726 "error while decoding MB %d %d\n", sl->
mb_x, sl->
mb_y);
2734 sl->
mb_x = lf_x_start = 0;
2768 if (sl->
mb_x > lf_x_start)
2807 if (context_count == 1) {
2818 for (i = 0; i < context_count; i++) {
2823 if (CONFIG_ERROR_RESILIENCE) {
2829 for (j = 0; j < context_count; j++) {
2833 if (i == j || slice_idx2 < slice_idx)
2835 next_slice_idx =
FFMIN(next_slice_idx, slice_idx2);
2846 if (CONFIG_ERROR_RESILIENCE) {
2847 for (i = 1; i < context_count; i++)
2854 for (i = 0; i < context_count; i++) {
2864 j == y_end - 1 ? x_end : h->
mb_width);
#define AV_STEREO3D_FLAG_INVERT
Inverted views, Right/Bottom represents the left view.
int video_signal_type_present_flag
struct H264Context * h264
#define AV_EF_AGGRESSIVE
consider things that a sane encoder should not do as an error
av_cold void ff_videodsp_init(VideoDSPContext *ctx, int bpc)
int ff_thread_can_start_frame(AVCodecContext *avctx)
const struct AVCodec * codec
discard all frames except keyframes
static void init_dimensions(H264Context *h)
int long_ref
1->long term reference 0->short term reference
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int sei_recovery_frame_cnt
int ff_h264_queue_decode_slice(H264Context *h, const H2645NAL *nal)
Submit a slice for decoding.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
This structure describes decoded (raw) audio or video data.
int recovery_frame_cnt
recovery_frame_cnt
int16_t mv_cache[2][5 *8][2]
Motion vector cache.
enum AVStereo3DView view
Determines which views are packed.
#define AV_PIX_FMT_YUV444P14
static int get_se_golomb(GetBitContext *gb)
read signed exp golomb code.
int edge_emu_buffer_allocated
int coded_width
Bitstream width / height, may be different from width/height e.g.
static void decode_finish_row(const H264Context *h, H264SliceContext *sl)
Draw edges and report progress for the last MB row.
uint8_t field_scan8x8_q0[64]
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AV_LOG_WARNING
Something somehow does not look correct.
int ff_h264_build_ref_list(H264Context *h, H264SliceContext *sl)
int chroma_qp_index_offset[2]
AVBufferRef * sps_list[MAX_SPS_COUNT]
const uint8_t * bytestream_end
static av_always_inline int get_chroma_qp(const PPS *pps, int t, int qscale)
Get the chroma qp.
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
hardware decoding through Videotoolbox
H264ChromaContext h264chroma
int luma_weight_flag[2]
7.4.3.2 luma_weight_lX_flag
MMCO mmco[MAX_MMCO_COUNT]
memory management control operations buffer.
static void implicit_weight_table(const H264Context *h, H264SliceContext *sl, int field)
Initialize implicit_weight table.
#define avpriv_request_sample(...)
enum AVColorRange color_range
MPEG vs JPEG YUV range.
int bitstream_restriction_flag
H264SEIAlternativeTransfer alternative_transfer
Timecode which conforms to SMPTE ST 12-1.
AVBufferRef * mb_type_buf
int repeat_pict
When decoding, this signals how much the picture must be delayed.
int bipred_scratchpad_allocated
Views are next to each other, but when upscaling apply a checkerboard pattern.
#define DELAYED_PIC_REF
Value of Picture.reference when Picture is not a reference picture, but is held for delayed output...
Frame contains only the right view.
#define AV_PIX_FMT_GBRP10
#define VP_START
< current MB is the first after a resync marker
AVBufferPool * mb_type_pool
int ff_h264_init_poc(int pic_field_poc[2], int *pic_poc, const SPS *sps, H264POCContext *pc, int picture_structure, int nal_ref_idc)
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
int16_t(*[2] motion_val)[2]
void ff_h264_flush_change(H264Context *h)
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
H264Picture * delayed_pic[MAX_DELAYED_PIC_COUNT+2]
int is_avc
Used to parse AVC variant of H.264.
av_cold void ff_h264_pred_init(H264PredContext *h, int codec_id, const int bit_depth, int chroma_format_idc)
Set the intra prediction function pointers.
AVBufferPool * ref_index_pool
uint8_t zigzag_scan8x8_cavlc[64]
#define AV_PIX_FMT_YUV420P12
av_cold void ff_h264chroma_init(H264ChromaContext *c, int bit_depth)
H264SEIDisplayOrientation display_orientation
int current_frame_is_frame0_flag
#define FF_ARRAY_ELEMS(a)
static const uint8_t zigzag_scan8x8_cavlc[64+1]
discard all non intra frames
Views are next to each other.
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
uint32_t num_units_in_tick
static const uint8_t field_scan[16+1]
const struct AVHWAccel * hwaccel
Hardware accelerator in use.
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before ff_thread_await_progress() has been called on them.reget_buffer() and buffer age optimizations no longer work.*The contents of buffers must not be written to after ff_thread_report_progress() has been called on them.This includes draw_edges().Porting codecs to frame threading
H264Picture * long_ref[32]
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB)
void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip)
Flip the input matrix horizontally and/or vertically.
unsigned int ref_count[2]
num_ref_idx_l0/1_active_minus1 + 1
#define IN_RANGE(a, b, size)
#define REBASE_PICTURE(pic, new_ctx, old_ctx)
MMCO mmco[MAX_MMCO_COUNT]
void av_display_rotation_set(int32_t matrix[9], double angle)
Initialize a transformation matrix describing a pure counterclockwise rotation by the specified angle...
Frame contains only the left view.
int ff_h264_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
enum AVDiscard skip_frame
Skip decoding for selected frames.
int ff_h264_execute_decode_slices(H264Context *h)
Call decode_slice() for each context.
int ff_h264_sei_process_picture_timing(H264SEIPictureTiming *h, const SPS *sps, void *logctx)
Parse the contents of a picture timing message given an active SPS.
unsigned int crop_top
frame_cropping_rect_top_offset
#define USES_LIST(a, list)
void ff_color_frame(AVFrame *frame, const int color[4])
#define av_assert0(cond)
assert() equivalent, that is always enabled.
const uint8_t * bytestream
int ref2frm[MAX_SLICES][2][64]
reference to frame number lists, used in the loop filter, the first 2 are for -2,-1 ...
int deblocking_filter_parameters_present
deblocking_filter_parameters_present_flag
static double cb(void *priv, double x, double y)
4: bottom field, top field, in that order
static enum AVPixelFormat non_j_pixfmt(enum AVPixelFormat a)
unsigned int crop_left
frame_cropping_rect_left_offset
int gaps_in_frame_num_allowed_flag
int slice_alpha_c0_offset
Stereo 3D type: this structure describes how two videos are packed within a single video surface...
void ff_h264_set_erpic(ERPicture *dst, H264Picture *src)
int field_picture
whether or not picture was encoded in separate fields
int bit_depth_chroma
bit_depth_chroma_minus8 + 8
void ff_h264_hl_decode_mb(const H264Context *h, H264SliceContext *sl)
#define FF_DEBUG_PICT_INFO
enum AVColorPrimaries color_primaries
int frame_num_offset
for POC type 2
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
int chroma_weight_flag[2]
7.4.3.2 chroma_weight_lX_flag
Multithreading support functions.
int cabac
entropy_coding_mode_flag
unsigned int crop_right
frame_cropping_rect_right_offset
uint8_t(*[2] top_borders)[(16 *3)*2]
int frame_recovered
Initial frame has been completely recovered.
Structure to hold side data for an AVFrame.
#define PICT_BOTTOM_FIELD
int transform_bypass
qpprime_y_zero_transform_bypass_flag
static int get_bits_count(const GetBitContext *s)
void ff_h264_filter_mb(const H264Context *h, H264SliceContext *sl, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize)
char av_get_picture_type_char(enum AVPictureType pict_type)
Return a single letter to describe the given picture type pict_type.
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
int ff_set_sar(AVCodecContext *avctx, AVRational sar)
Check that the provided sample aspect ratio is valid and set it on the codec context.
int redundant_pic_cnt_present
redundant_pic_cnt_present_flag
#define AV_LOG_VERBOSE
Detailed information.
AVDictionary * metadata
metadata.
int interlaced_frame
The content of the picture is interlaced.
Video is not stereoscopic (and metadata has to be there).
AVBufferRef * qscale_table_buf
static int h264_export_frame_props(H264Context *h)
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
#define AV_PIX_FMT_YUV422P12
#define FRAME_RECOVERED_SEI
Sufficient number of frames have been decoded since a SEI recovery point, so all the following frames...
#define AV_CODEC_FLAG_GRAY
Only decode/encode grayscale.
int recovered
picture at IDR or recovery point + recovery count
Active Format Description data consisting of a single byte as specified in ETSI TS 101 154 using AVAc...
int ff_h264_decode_ref_pic_list_reordering(H264SliceContext *sl, void *logctx)
enum AVChromaLocation chroma_sample_location
This defines the location of chroma samples.
int last_pocs[MAX_DELAYED_PIC_COUNT]
void ff_h264_direct_ref_list_init(const H264Context *const h, H264SliceContext *sl)
static int h264_frame_start(H264Context *h)
H.264 common definitions.
void ff_h264_draw_horiz_band(const H264Context *h, H264SliceContext *sl, int y, int height)
int timecode_cnt
Number of timecode in use.
static int get_bits_left(GetBitContext *gb)
H.264 parameter set handling.
H264Picture DPB[H264_MAX_PICTURE_COUNT]
enum AVColorTransferCharacteristic color_trc
int mb_aff
mb_adaptive_frame_field_flag
int chroma_log2_weight_denom
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int has_b_frames
Size of the frame reordering buffer in the decoder.
int flags
Additional information about the frame packing.
int preferred_transfer_characteristics
static int get_ue_golomb(GetBitContext *gb)
Read an unsigned Exp-Golomb code in the range 0 to 8190.
static int alloc_scratch_buffers(H264SliceContext *sl, int linesize)
int poc_type
pic_order_cnt_type
void ff_er_add_slice(ERContext *s, int startx, int starty, int endx, int endy, int status)
Add a slice.
#define PTRDIFF_SPECIFIER
int ff_h264_decode_ref_pic_marking(H264SliceContext *sl, GetBitContext *gb, const H2645NAL *nal, void *logctx)
int ff_h264_get_profile(const SPS *sps)
Compute profile from profile_idc and constraint_set?_flags.
discard all bidirectional frames
H264_SEI_FpaType arrangement_type
void * hwaccel_picture_private
hardware accelerator private data
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this field
int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor.
Views are packed per line, as if interlaced.
int active_thread_type
Which multithreading methods are in use by the codec.
static const uint8_t field_scan8x8[64+1]
const uint8_t ff_zigzag_scan[16+1]
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
ATSC A53 Part 4 Closed Captions.
int deblocking_filter
disable_deblocking_filter_idc with 1 <-> 0
uint8_t(*[2] mvd_table)[2]
int prev_interlaced_frame
Complement sei_pic_struct SEI_PIC_STRUCT_TOP_BOTTOM and SEI_PIC_STRUCT_BOTTOM_TOP indicate interlaced...
int flags
AV_CODEC_FLAG_*.
static int fill_filter_caches(const H264Context *h, H264SliceContext *sl, int mb_type)
simple assert() macros that are a bit more flexible than ISO C assert().
int weighted_pred
weighted_pred_flag
#define AV_PIX_FMT_YUV444P10
int direct_spatial_mv_pred
H264SEIUnregistered unregistered
int frame_num
frame_num (raw frame_num from slice header)
const uint8_t ff_h264_golomb_to_pict_type[5]
int valid_recovery_point
Are the SEI recovery points looking valid.
int ff_h264_get_slice_type(const H264SliceContext *sl)
Reconstruct bitstream slice_type.
uint8_t active_format_description
int delta_pic_order_always_zero_flag
void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], const uint8_t *src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height)
Copy image in src_data to dst_data.
int slice_type_nos
S free slice type (SI/SP are remapped to I/P)
uint8_t zigzag_scan8x8[64]
AVBufferRef * hwaccel_priv_buf
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
int av_reallocp_array(void *ptr, size_t nmemb, size_t size)
Allocate, reallocate, or free an array through a pointer to a pointer.
AVStereo3D * av_stereo3d_create_side_data(AVFrame *frame)
Allocate a complete AVFrameSideData and add it to the frame.
uint8_t * error_status_table
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before as well as code calling up to before the decode process starts Call have so the codec calls ff_thread_report set FF_CODEC_CAP_ALLOCATE_PROGRESS in AVCodec caps_internal and use ff_thread_get_buffer() to allocate frames.The frames must then be freed with ff_thread_release_buffer().Otherwise decode directly into the user-supplied frames.Call ff_thread_report_progress() after some part of the current picture has decoded.A good place to put this is where draw_horiz_band() is called-add this if it isn't called anywhere
Views are alternated temporally.
void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size)
Allocate a buffer, reusing the given one if large enough.
int ff_h264_parse_ref_count(int *plist_count, int ref_count[2], GetBitContext *gb, const PPS *pps, int slice_type_nos, int picture_structure, void *logctx)
int nal_length_size
Number of bytes used for nal length (1, 2 or 4)
useful rectangle filling function
#define AV_PIX_FMT_YUV422P9
int refs
number of reference frames
int prev_poc_msb
poc_msb of the last reference pic for POC type 0
#define ss(width, name, subs,...)
AVBufferRef * motion_val_buf[2]
int ref_frame_count
num_ref_frames
enum AVPixelFormat * pix_fmts
array of supported pixel formats, or NULL if unknown, array is terminated by -1
enum AVPictureType pict_type
Picture type of the frame.
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
H264_SEI_PicStructType pic_struct
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
int ct_type
Bit set of clock types for fields/frames in picture timing SEI message.
void av_fast_mallocz(void *ptr, unsigned int *size, size_t min_size)
Allocate and clear a buffer, reusing the given one if large enough.
uint16_t * slice_table
slice_table_base + 2*mb_stride + 1
static void copy_picture_range(H264Picture **to, H264Picture **from, int count, H264Context *new_base, H264Context *old_base)
static int h264_field_start(H264Context *h, const H264SliceContext *sl, const H2645NAL *nal, int first_slice)
uint8_t field_scan8x8_cavlc[64]
int colour_description_present_flag
unsigned int first_mb_addr
static void er_add_slice(H264SliceContext *sl, int startx, int starty, int endx, int endy, int status)
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
AVFrameSideData * av_frame_new_side_data_from_buf(AVFrame *frame, enum AVFrameSideDataType type, AVBufferRef *buf)
Add a new side data to a frame from an existing AVBufferRef.
int width
picture width / height.
int long_ref_count
number of actual long term references
#define AV_FRAME_FLAG_CORRUPT
The frame data may be corrupted, e.g.
void ff_thread_report_progress(ThreadFrame *f, int n, int field)
Notify later decoding threads when part of their reference picture is ready.
static int h264_init_ps(H264Context *h, const H264SliceContext *sl, int first_slice)
int luma_log2_weight_denom
int ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size)
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
char * av_timecode_make_smpte_tc_string2(char *buf, AVRational rate, uint32_t tcsmpte, int prevent_df, int skip_field)
Get the timecode string from the SMPTE timecode format.
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
#define FF_THREAD_SLICE
Decode more than one part of a single frame at once.
Context Adaptive Binary Arithmetic Coder inline functions.
int init_qp
pic_init_qp_minus26 + 26
H.264 / AVC / MPEG-4 part10 codec.
enum AVChromaLocation chroma_location
H264SliceContext * slice_ctx
int direct_8x8_inference_flag
static int h264_select_output_frame(H264Context *h)
#define AV_EF_EXPLODE
abort decoding on minor error detection
int ticks_per_frame
For some codecs, the time base is closer to the field rate than the frame rate.
int top_borders_allocated[2]
static void fill_rectangle(int x, int y, int w, int h)
#define FIELD_OR_MBAFF_PICTURE(h)
int ref_idc
H.264 only, nal_ref_idc.
static void init_scan_tables(H264Context *h)
initialize scan tables
static int av_unused get_cabac_terminate(CABACContext *c)
int quincunx_sampling_flag
#define AV_PIX_FMT_YUV444P9
#define AV_PIX_FMT_GBRP14
HW acceleration through CUDA.
static int init_table_pools(H264Context *h)
uint8_t * edge_emu_buffer
static unsigned get_ue_golomb_long(GetBitContext *gb)
Read an unsigned Exp-Golomb code in the range 0 to UINT32_MAX-1.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
int pic_order_present
pic_order_present_flag
uint8_t zigzag_scan_q0[16]
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
int bit_depth_luma
luma bit depth from sps to detect changes
int chroma_format_idc
chroma format from sps to detect changes
int timing_info_present_flag
int coded_picture_number
picture number in bitstream order
enum AVStereo3DType type
How views are packed within the video.
Views are packed in a checkerboard-like structure per pixel.
uint8_t zigzag_scan8x8_q0[64]
#define AV_PIX_FMT_YUV420P14
5: top field, bottom field, top field repeated, in that order
Libavcodec external API header.
#define MAX_DELAYED_PIC_COUNT
Views are on top of each other.
This side data contains a 3x3 transformation matrix describing an affine transformation that needs to...
AVBufferRef * pps_list[MAX_PPS_COUNT]
static int get_ue_golomb_31(GetBitContext *gb)
read unsigned exp golomb code, constraint to a max of 31.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
H264Picture * short_ref[32]
int ff_h264_decode_mb_cabac(const H264Context *h, H264SliceContext *sl)
Decode a macroblock.
#define AV_CODEC_FLAG2_FAST
Allow non spec compliant speedup tricks.
int field_poc[2]
top/bottom POC
int recovery_frame
recovery_frame is the frame_num at which the next frame should be fully constructed.
main external API structure.
User data unregistered metadata associated with a video frame.
int qp_thresh
QP threshold to skip loopfilter.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining list
uint8_t * data
The data buffer.
H264SEITimeCode timecode[3]
Maximum three timecodes in a pic_timing SEI.
static int h264_slice_header_parse(const H264Context *h, H264SliceContext *sl, const H2645NAL *nal)
H264SEIA53Caption a53_caption
int implicit_weight[48][48][2]
static const uint8_t scan8[16 *3+3]
AVBufferRef * av_buffer_allocz(int size)
Same as av_buffer_alloc(), except the returned buffer will be initialized to zero.
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
static const uint8_t field_scan8x8_cavlc[64+1]
static unsigned int get_bits1(GetBitContext *s)
#define AV_PIX_FMT_YUV420P10
AVCodecContext * owner[2]
int prev_frame_num
frame_num of the last pic for POC type 1/2
#define FF_CODEC_PROPERTY_CLOSED_CAPTIONS
static int FUNC() pps(CodedBitstreamContext *ctx, RWContext *rw, H264RawPPS *current)
AVFrameSideData * av_frame_new_side_data(AVFrame *frame, enum AVFrameSideDataType type, int size)
Add a new side data to a frame.
uint8_t non_zero_count_cache[15 *8]
non zero coeff count cache.
void av_buffer_pool_uninit(AVBufferPool **ppool)
Mark the pool as being available for freeing.
enum AVColorSpace colorspace
YUV colorspace type.
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface.
static av_always_inline uint32_t pack16to32(unsigned a, unsigned b)
int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src)
A reference counted buffer type.
int pixel_shift
0 for 8-bit H.264, 1 for high-bit-depth H.264
they must not be accessed directly The fifo field contains the frames that are queued in the input for processing by the filter The status_in and status_out fields contains the queued status(EOF or error) of the link
int mmco_reset
MMCO_RESET set this 1.
int content_interpretation_type
H264Picture * cur_pic_ptr
const uint8_t ff_zigzag_direct[64]
static int h264_slice_header_init(H264Context *h)
static int FUNC() sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
int mb_mbaff
mb_aff_frame && mb_field_decoding_flag
#define AV_PIX_FMT_YUV420P9
#define FF_COMPLIANCE_STRICT
Strictly conform to all the things in the spec no matter what consequences.
H264SEIPictureTiming picture_timing
int log2_max_poc_lsb
log2_max_pic_order_cnt_lsb_minus4
H264SEIRecoveryPoint recovery_point
ptrdiff_t mb_linesize
may be equal to s->linesize or s->linesize * 2, for mbaff
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer. ...
int16_t slice_row[MAX_SLICES]
to detect when MAX_SLICES is too low
static enum AVPixelFormat pix_fmts[]
3: top field, bottom field, in that order
static int alloc_picture(H264Context *h, H264Picture *pic)
int block_offset[2 *(16 *3)]
block_offset[ 0..23] for frame macroblocks block_offset[24..47] for field macroblocks ...
#define AV_PIX_FMT_YUV422P14
#define AV_PIX_FMT_GBRP12
int transform_8x8_mode
transform_8x8_mode_flag
#define AV_PIX_FMT_YUV422P10
static int h264_slice_init(H264Context *h, H264SliceContext *sl, const H2645NAL *nal)
int pic_struct_present_flag
#define AV_PIX_FMT_YUV444P12
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int prev_poc_lsb
poc_lsb of the last reference pic for POC type 0
static void release_unused_pictures(H264Context *h, int remove_current)
int ff_h264_alloc_tables(H264Context *h)
Allocate tables.
Hardware surfaces for Direct3D11.
Narrow or limited range content.
static int av_cmp_q(AVRational a, AVRational b)
Compare two rationals.
discard all non reference
int anticlockwise_rotation
int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup)
AVBufferPool * qscale_table_pool
H264Picture * next_output_pic
AVBufferPool * motion_val_pool
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
common internal api header.
AVBufferPool * av_buffer_pool_init(int size, AVBufferRef *(*alloc)(int size))
Allocate and initialize a buffer pool.
static int ref[MAX_W *MAX_W]
static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
int log2_max_frame_num
log2_max_frame_num_minus4 + 4
const char * av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
H264SEIFramePacking frame_packing
H.264 / AVC / MPEG-4 part10 motion vector prediction.
AVBufferRef * av_buffer_ref(AVBufferRef *buf)
Create a new reference to an AVBuffer.
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Views are packed per column.
int cur_chroma_format_idc
int8_t * intra4x4_pred_mode
unsigned properties
Properties of the stream that gets decoded.
enum AVDiscard skip_loop_filter
Skip loop filtering for selected frames.
static void predict_field_decoding_flag(const H264Context *h, H264SliceContext *sl)
int ff_h264_decode_mb_cavlc(const H264Context *h, H264SliceContext *sl)
Decode a macroblock.
int bit_depth_luma
bit_depth_luma_minus8 + 8
uint32_t av_timecode_get_smpte(AVRational rate, int drop, int hh, int mm, int ss, int ff)
Convert sei info to SMPTE 12M binary representation.
void ff_h264_free_tables(H264Context *h)
static av_always_inline void backup_mb_border(const H264Context *h, H264SliceContext *sl, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize, int simple)
uint8_t zigzag_scan8x8_cavlc_q0[64]
int8_t ref_cache[2][5 *8]
#define AV_CODEC_FLAG_OUTPUT_CORRUPT
Output even those frames that might be corrupted.
int top_field_first
If the content is interlaced, is top field displayed first.
int frame_priv_data_size
Size of per-frame hardware accelerator private data.
int key_frame
1 -> keyframe, 0-> not
static int find_unused_picture(H264Context *h)
int current_slice
current slice number, used to initialize slice_num of each thread/context
int ff_h264_execute_ref_pic_marking(H264Context *h)
Execute the reference picture marking (memory management control operations).
static const uint8_t * align_get_bits(GetBitContext *s)
int ff_h264_pred_weight_table(GetBitContext *gb, const SPS *sps, const int *ref_count, int slice_type_nos, H264PredWeightTable *pwt, int picture_structure, void *logctx)
int mb_width
pic_width_in_mbs_minus1 + 1
int flags2
AV_CODEC_FLAG2_*.
H264Ref ref_list[2][48]
0..15: frame refs, 16..47: mbaff field refs.
uint8_t field_scan8x8_cavlc_q0[64]
AVBufferRef * ref_index_buf[2]
av_cold void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, const int chroma_format_idc)
int frame_number
Frame counter, set by libavcodec.
void ff_er_frame_start(ERContext *s)
#define AV_CODEC_FLAG2_SHOW_ALL
Show all frames before the first keyframe.
uint8_t(*[2] mvd_table)[2]
uint8_t field_scan8x8[64]
static av_always_inline void fill_filter_caches_inter(const H264Context *h, H264SliceContext *sl, int mb_type, int top_xy, int left_xy[LEFT_MBS], int top_type, int left_type[LEFT_MBS], int mb_xy, int list)
int prev_frame_num_offset
for POC type 2
HW decoding through Direct3D11 via old API, Picture.data[3] contains a ID3D11VideoDecoderOutputView p...
int8_t * intra4x4_pred_mode
AVBufferRef * av_buffer_pool_get(AVBufferPool *pool)
Allocate a new AVBuffer, reusing an old buffer from the pool when available.
static int decode_slice(struct AVCodecContext *avctx, void *arg)
void ff_h264_direct_dist_scale_factor(const H264Context *const h, H264SliceContext *sl)
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
int ff_h264_slice_context_init(H264Context *h, H264SliceContext *sl)
Init context Allocate buffers which are not shared amongst multiple threads.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
static double cr(void *priv, double x, double y)
uint8_t field_scan_q0[16]
int mb_field_decoding_flag
uint8_t(* non_zero_count)[48]
static void loop_filter(const H264Context *h, H264SliceContext *sl, int start_x, int end_x)
int(* execute)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size)
The codec may call this to execute several independent things.
unsigned int crop_bottom
frame_cropping_rect_bottom_offset
uint8_t * bipred_scratchpad
void ff_h264_unref_picture(H264Context *h, H264Picture *pic)
AVPixelFormat
Pixel format.
av_cold void ff_h264qpel_init(H264QpelContext *c, int bit_depth)
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
int strict_std_compliance
strictly follow the standard (MPEG-4, ...).
void ff_h264_filter_mb_fast(const H264Context *h, H264SliceContext *sl, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize)
#define FRAME_RECOVERED_IDR
We have seen an IDR, so all the following frames in coded order are correctly decodable.
6: bottom field, top field, bottom field repeated, in that order
int av_buffer_replace(AVBufferRef **pdst, AVBufferRef *src)
Ensure dst refers to the same data as src.
Context Adaptive Binary Arithmetic Coder.
#define AV_TIMECODE_STR_SIZE
FF_DISABLE_DEPRECATION_WARNINGS enum AVPixelFormat ff_thread_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
Wrapper around get_format() for frame-multithreaded codecs.
#define H264_MAX_PICTURE_COUNT
#define AV_CEIL_RSHIFT(a, b)
void ff_h264_init_cabac_states(const H264Context *h, H264SliceContext *sl)
int short_ref_count
number of actual short term references
enum AVColorSpace colorspace