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34, 46, 43 },
189 const int b4_stride = h->
mb_width * 4 + 1;
190 const int b4_array_size = b4_stride * h->
mb_height * 4;
241 int h_chroma_shift, v_chroma_shift;
243 &h_chroma_shift, &v_chroma_shift);
247 0x80, FF_CEIL_RSHIFT(h->
avctx->
width, h_chroma_shift));
249 0x80, FF_CEIL_RSHIFT(h->
avctx->
width, h_chroma_shift));
267 for (i = 0; i < 2; i++) {
280 return (ret < 0) ? ret :
AVERROR(ENOMEM);
300 if (i == H264_MAX_PICTURE_COUNT)
317 for (i = 0; i < 6; i++) {
319 for (j = 0; j < i; j++)
328 for (q = 0; q < max_qp + 1; q++) {
331 for (x = 0; x < 64; x++)
343 for (i = 0; i < 6; i++) {
345 for (j = 0; j < i; j++)
354 for (q = 0; q < max_qp + 1; q++) {
357 for (x = 0; x < 16; x++)
374 for (i = 0; i < 6; i++)
375 for (x = 0; x < 16; x++)
378 for (i = 0; i < 6; i++)
379 for (x = 0; x < 64; x++)
409 #define IN_RANGE(a, b, size) (((a) >= (b)) && ((a) < ((b) + (size))))
411 #define REBASE_PICTURE(pic, new_ctx, old_ctx) \
412 (((pic) && (pic) >= (old_ctx)->DPB && \
413 (pic) < (old_ctx)->DPB + H264_MAX_PICTURE_COUNT) ? \
414 &(new_ctx)->DPB[(pic) - (old_ctx)->DPB] : NULL)
422 for (i = 0; i <
count; i++) {
423 assert((
IN_RANGE(from[i], old_base,
sizeof(*old_base)) ||
435 for (i = 0; i <
count; i++) {
436 if (to[i] && !from[i]) {
438 }
else if (from[i] && !to[i]) {
445 memcpy(to[i], from[i], size);
451 #define copy_fields(to, from, start_field, end_field) \
452 memcpy(&(to)->start_field, &(from)->start_field, \
453 (char *)&(to)->end_field - (char *)&(to)->start_field)
462 int context_reinitialized = 0;
469 (h->
width != h1->width ||
470 h->
height != h1->height ||
484 h->
width = h1->width;
493 (
void **)h1->sps_buffers,
498 (
void **)h1->pps_buffers,
507 context_reinitialized = 1;
510 h264_set_parameter_from_sps(h);
533 memcpy(h, h1, offsetof(
H264Context, intra_pcm_ptr));
534 memcpy(&h->
cabac, &h1->cabac,
541 memset(&h->
er, 0,
sizeof(h->
er));
542 memset(&h->
mb, 0,
sizeof(h->
mb));
565 for (i = 0; i < 2; i++) {
570 if (h1->context_initialized) {
609 if (h1->DPB && h1->DPB[i].f.buf[0] &&
616 if (h1->cur_pic.f.buf[0]) {
631 (
void **)h1->sps_buffers,
636 (
void **)h1->pps_buffers,
643 copy_fields(h, h1, dequant4_buffer, dequant4_coeff);
645 for (i = 0; i < 6; i++)
647 (h1->dequant4_coeff[i] - h1->dequant4_buffer[0]);
649 for (i = 0; i < 6; i++)
651 (h1->dequant8_coeff[i] - h1->dequant8_buffer[0]);
668 if (context_reinitialized)
738 if (CONFIG_ERROR_RESILIENCE) {
745 if (CONFIG_ERROR_RESILIENCE) {
753 for (i = 0; i < 16; i++) {
757 for (i = 0; i < 16; i++) {
781 int linesize,
int uvlinesize,
791 src_cb -= uvlinesize;
792 src_cr -= uvlinesize;
798 AV_COPY128(top_border, src_y + 15 * linesize);
800 AV_COPY128(top_border + 16, src_y + 15 * linesize + 16);
804 AV_COPY128(top_border + 32, src_cb + 15 * uvlinesize);
805 AV_COPY128(top_border + 48, src_cb + 15 * uvlinesize + 16);
806 AV_COPY128(top_border + 64, src_cr + 15 * uvlinesize);
807 AV_COPY128(top_border + 80, src_cr + 15 * uvlinesize + 16);
809 AV_COPY128(top_border + 16, src_cb + 15 * uvlinesize);
810 AV_COPY128(top_border + 32, src_cr + 15 * uvlinesize);
812 }
else if (chroma422) {
814 AV_COPY128(top_border + 32, src_cb + 15 * uvlinesize);
815 AV_COPY128(top_border + 48, src_cr + 15 * uvlinesize);
817 AV_COPY64(top_border + 16, src_cb + 15 * uvlinesize);
818 AV_COPY64(top_border + 24, src_cr + 15 * uvlinesize);
822 AV_COPY128(top_border + 32, src_cb + 7 * uvlinesize);
823 AV_COPY128(top_border + 48, src_cr + 7 * uvlinesize);
825 AV_COPY64(top_border + 16, src_cb + 7 * uvlinesize);
826 AV_COPY64(top_border + 24, src_cr + 7 * uvlinesize);
840 AV_COPY128(top_border, src_y + 16 * linesize);
842 AV_COPY128(top_border + 16, src_y + 16 * linesize + 16);
847 AV_COPY128(top_border + 32, src_cb + 16 * linesize);
848 AV_COPY128(top_border + 48, src_cb + 16 * linesize + 16);
849 AV_COPY128(top_border + 64, src_cr + 16 * linesize);
850 AV_COPY128(top_border + 80, src_cr + 16 * linesize + 16);
852 AV_COPY128(top_border + 16, src_cb + 16 * linesize);
853 AV_COPY128(top_border + 32, src_cr + 16 * linesize);
855 }
else if (chroma422) {
857 AV_COPY128(top_border + 32, src_cb + 16 * uvlinesize);
858 AV_COPY128(top_border + 48, src_cr + 16 * uvlinesize);
860 AV_COPY64(top_border + 16, src_cb + 16 * uvlinesize);
861 AV_COPY64(top_border + 24, src_cr + 16 * uvlinesize);
865 AV_COPY128(top_border + 32, src_cb + 8 * uvlinesize);
866 AV_COPY128(top_border + 48, src_cr + 8 * uvlinesize);
868 AV_COPY64(top_border + 16, src_cb + 8 * uvlinesize);
869 AV_COPY64(top_border + 24, src_cr + 8 * uvlinesize);
882 int ref0, ref1, i, cur_poc, ref_start, ref_count0, ref_count1;
884 for (i = 0; i < 2; i++) {
916 for (ref0 = ref_start; ref0 < ref_count0; ref0++) {
918 for (ref1 = ref_start; ref1 < ref_count1; ref1++) {
922 int td = av_clip_int8(poc1 - poc0);
924 int tb = av_clip_int8(cur_poc - poc0);
925 int tx = (16384 + (
FFABS(td) >> 1)) /
td;
926 int dist_scale_factor = (tb * tx + 32) >> 8;
927 if (dist_scale_factor >= -64 && dist_scale_factor <= 128)
928 w = 64 - dist_scale_factor;
947 for (i = 0; i < 16; i++) {
948 #define TRANSPOSE(x) ((x) >> 2) | (((x) << 2) & 0xF)
953 for (i = 0; i < 64; i++) {
954 #define TRANSPOSE(x) ((x) >> 3) | (((x) & 7) << 3)
1008 #define HWACCEL_MAX (CONFIG_H264_DXVA2_HWACCEL + \
1009 CONFIG_H264_VAAPI_HWACCEL + \
1010 (CONFIG_H264_VDA_HWACCEL * 2) + \
1011 CONFIG_H264_VDPAU_HWACCEL)
1062 #if CONFIG_H264_VDPAU_HWACCEL
1080 #if CONFIG_H264_DXVA2_HWACCEL
1083 #if CONFIG_H264_VAAPI_HWACCEL
1086 #if CONFIG_H264_VDA_HWACCEL
1107 if (choices[i] == h->
avctx->
pix_fmt && !force_callback)
1123 if (!crop_present &&
1130 if (width <= 0 || height <= 0) {
1157 int nb_slices = (HAVE_THREADS &&
1193 " reducing to %d\n", nb_slices, max_slices);
1194 nb_slices = max_slices;
1282 unsigned int first_mb_in_slice;
1283 unsigned int pps_id;
1285 unsigned int slice_type, tmp, i, j;
1286 int last_pic_structure, last_pic_droppable;
1288 int needs_reinit = 0;
1289 int field_pic_flag, bottom_field_flag;
1291 int frame_num, picture_structure, droppable;
1299 if (first_mb_in_slice == 0) {
1315 if (slice_type > 9) {
1317 "slice type %d too large at %d %d\n",
1321 if (slice_type > 4) {
1356 "non-existing PPS %u referenced\n",
1362 "PPS change from %d to %d forbidden\n",
1371 "non-existing SPS %u referenced\n",
1384 "SPS changed in the middle of the frame\n");
1454 (must_reinit || needs_reinit)) {
1457 "changing width %d -> %d / height %d -> %d on "
1478 "h264_slice_header_init() failed\n");
1485 "Cannot (re-)initialize context during parallel decoding.\n");
1495 "h264_slice_header_init() failed\n");
1528 if (field_pic_flag) {
1537 if (last_pic_structure != picture_structure ||
1538 last_pic_droppable != droppable) {
1540 "Changing field mode (%d -> %d) between slices is not allowed\n",
1545 "unset cur_pic_ptr on slice %d\n",
1563 if (unwrap_prev_frame_num > h->
frame_num)
1564 unwrap_prev_frame_num -= max_frame_num;
1568 if (unwrap_prev_frame_num < 0)
1569 unwrap_prev_frame_num += max_frame_num;
1616 "Invalid field mode combination %d/%d\n",
1621 }
else if (last_pic_droppable != h->
droppable) {
1623 "Found reference and non-reference fields in the same frame, which");
1750 first_mb_in_slice >= h->
mb_num) {
1820 for (i = 0; i < 2; i++) {
1884 "deblocking_filter_idc %u out of range\n", tmp);
1899 "deblocking filter parameters %d %d out of range\n",
1926 "Cannot parallelize slice decoding with deblocking filter type 1, decoding such frames in sequential order\n"
1927 "To parallelize slice decoding you need video encoded with disable_deblocking_filter_idc set to 2 (deblock only edges that do not cross slices).\n"
1928 "Setting the flags2 libavcodec option to +fast (-flags2 +fast) will disable deblocking across slices and enable parallel slice decoding "
1929 "but will generate non-standard-compliant output.\n");
1934 "Deblocking switched inside frame.\n");
1959 for (j = 0; j < 2; j++) {
1962 for (i = 0; i < 16; i++) {
1964 if (j < h->list_count && i < h->ref_count[j] &&
1983 for (i = 0; i < 16; i++)
1986 ref2frm[18 + 1] = -1;
1987 for (i = 16; i < 48; i++)
1988 ref2frm[i + 4] = 4 * id_list[(i - 16) >> 1] +
1999 "slice:%d %s mb:%d %c%s%s pps:%u frame:%d poc:%d/%d ref:%d/%d qp:%d loop:%d:%d:%d weight:%d%s %s\n",
2040 int mb_type,
int top_xy,
2043 int left_type[LEFT_MBS],
2044 int mb_xy,
int list)
2051 const int b_xy = h->
mb2b_xy[top_xy] + 3 * b_stride;
2052 const int b8_xy = 4 * top_xy + 2;
2055 ref_cache[0 - 1 * 8] =
2056 ref_cache[1 - 1 * 8] = ref2frm[list][h->
cur_pic.
ref_index[list][b8_xy + 0]];
2057 ref_cache[2 - 1 * 8] =
2058 ref_cache[3 - 1 * 8] = ref2frm[list][h->
cur_pic.
ref_index[list][b8_xy + 1]];
2067 const int b8_xy = 4 * left_xy[
LTOP] + 1;
2074 ref_cache[-1 + 8] = ref2frm[list][h->
cur_pic.
ref_index[list][b8_xy + 2 * 0]];
2075 ref_cache[-1 + 16] =
2076 ref_cache[-1 + 24] = ref2frm[list][h->
cur_pic.
ref_index[list][b8_xy + 2 * 1]];
2084 ref_cache[-1 + 16] =
2102 uint32_t ref01 = (
pack16to32(ref2frm[list][ref[0]], ref2frm[list][ref[1]]) & 0x00FF00FF) * 0x0101;
2103 uint32_t ref23 = (
pack16to32(ref2frm[list][ref[2]], ref2frm[list][ref[3]]) & 0x00FF00FF) * 0x0101;
2104 AV_WN32A(&ref_cache[0 * 8], ref01);
2105 AV_WN32A(&ref_cache[1 * 8], ref01);
2106 AV_WN32A(&ref_cache[2 * 8], ref23);
2107 AV_WN32A(&ref_cache[3 * 8], ref23);
2112 AV_COPY128(mv_dst + 8 * 0, mv_src + 0 * b_stride);
2113 AV_COPY128(mv_dst + 8 * 1, mv_src + 1 * b_stride);
2114 AV_COPY128(mv_dst + 8 * 2, mv_src + 2 * b_stride);
2115 AV_COPY128(mv_dst + 8 * 3, mv_src + 3 * b_stride);
2125 const int mb_xy = h->
mb_xy;
2136 left_xy[
LBOT] = left_xy[
LTOP] = mb_xy - 1;
2141 if (left_mb_field_flag != curr_mb_field_flag)
2144 if (curr_mb_field_flag)
2147 if (left_mb_field_flag != curr_mb_field_flag)
2161 if (qp <= qp_thresh &&
2162 (left_xy[
LTOP] < 0 ||
2168 if ((left_xy[
LTOP] < 0 ||
2183 left_type[
LTOP] = left_type[
LBOT] = 0;
2188 left_type[
LTOP] = left_type[
LBOT] = 0;
2198 top_type, left_type, mb_xy, 0);
2201 top_type, left_type, mb_xy, 1);
2205 AV_COPY32(&nnz_cache[4 + 8 * 1], &nnz[0]);
2206 AV_COPY32(&nnz_cache[4 + 8 * 2], &nnz[4]);
2207 AV_COPY32(&nnz_cache[4 + 8 * 3], &nnz[8]);
2208 AV_COPY32(&nnz_cache[4 + 8 * 4], &nnz[12]);
2213 AV_COPY32(&nnz_cache[4 + 8 * 0], &nnz[3 * 4]);
2216 if (left_type[
LTOP]) {
2218 nnz_cache[3 + 8 * 1] = nnz[3 + 0 * 4];
2219 nnz_cache[3 + 8 * 2] = nnz[3 + 1 * 4];
2220 nnz_cache[3 + 8 * 3] = nnz[3 + 2 * 4];
2221 nnz_cache[3 + 8 * 4] = nnz[3 + 3 * 4];
2228 nnz_cache[4 + 8 * 0] =
2229 nnz_cache[5 + 8 * 0] = (h->
cbp_table[top_xy] & 0x4000) >> 12;
2230 nnz_cache[6 + 8 * 0] =
2231 nnz_cache[7 + 8 * 0] = (h->
cbp_table[top_xy] & 0x8000) >> 12;
2234 nnz_cache[3 + 8 * 1] =
2235 nnz_cache[3 + 8 * 2] = (h->
cbp_table[left_xy[
LTOP]] & 0x2000) >> 12;
2238 nnz_cache[3 + 8 * 3] =
2239 nnz_cache[3 + 8 * 4] = (h->
cbp_table[left_xy[
LBOT]] & 0x8000) >> 12;
2243 nnz_cache[
scan8[0]] =
2244 nnz_cache[scan8[1]] =
2245 nnz_cache[scan8[2]] =
2246 nnz_cache[scan8[3]] = (h->
cbp & 0x1000) >> 12;
2248 nnz_cache[scan8[0 + 4]] =
2249 nnz_cache[scan8[1 + 4]] =
2250 nnz_cache[scan8[2 + 4]] =
2251 nnz_cache[scan8[3 + 4]] = (h->
cbp & 0x2000) >> 12;
2253 nnz_cache[scan8[0 + 8]] =
2254 nnz_cache[scan8[1 + 8]] =
2255 nnz_cache[scan8[2 + 8]] =
2256 nnz_cache[scan8[3 + 8]] = (h->
cbp & 0x4000) >> 12;
2258 nnz_cache[scan8[0 + 12]] =
2259 nnz_cache[scan8[1 + 12]] =
2260 nnz_cache[scan8[2 + 12]] =
2261 nnz_cache[scan8[3 + 12]] = (h->
cbp & 0x8000) >> 12;
2270 uint8_t *dest_y, *dest_cb, *dest_cr;
2271 int linesize, uvlinesize, mb_x, mb_y;
2278 for (mb_x = start_x; mb_x < end_x; mb_x++)
2279 for (mb_y = end_mb_y -
FRAME_MBAFF(h); mb_y <= end_mb_y; mb_y++) {
2293 ((mb_x << pixel_shift) + mb_y * h->
linesize) * 16;
2295 (mb_x << pixel_shift) * (8 <<
CHROMA444(h)) +
2298 (mb_x << pixel_shift) * (8 <<
CHROMA444(h)) +
2323 linesize, uvlinesize);
2326 dest_cr, linesize, uvlinesize);
2358 if ((top + height) >= pic_height)
2359 height += deblock_border;
2360 top -= deblock_border;
2363 if (top >= pic_height || (top + height) < 0)
2366 height =
FFMIN(height, pic_height - top);
2382 int endx,
int endy,
int status)
2384 if (CONFIG_ERROR_RESILIENCE) {
2394 int lf_x_start = h->
mb_x;
2450 if (h->
mb_x >= lf_x_start)
2468 h->
mb_x = lf_x_start = 0;
2483 if (h->
mb_x > lf_x_start)
2507 "error while decoding MB %d %d\n", h->
mb_x, h->
mb_y);
2515 h->
mb_x = lf_x_start = 0;
2549 if (h->
mb_x > lf_x_start)
2581 if (context_count == 1) {
2585 for (i = 1; i < context_count; i++) {
2587 if (CONFIG_ERROR_RESILIENCE) {
2594 NULL, context_count,
sizeof(
void *));
2602 if (CONFIG_ERROR_RESILIENCE) {
2603 for (i = 1; i < context_count; i++)