| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 "Loop filter thread creation failed"); | 927 "Loop filter thread creation failed"); |
| 928 } | 928 } |
| 929 } | 929 } |
| 930 | 930 |
| 931 if (cm->lf.filter_level) { | 931 if (cm->lf.filter_level) { |
| 932 LFWorkerData *const lf_data = (LFWorkerData*)pbi->lf_worker.data1; | 932 LFWorkerData *const lf_data = (LFWorkerData*)pbi->lf_worker.data1; |
| 933 // Be sure to sync as we might be resuming after a failed frame decode. | 933 // Be sure to sync as we might be resuming after a failed frame decode. |
| 934 winterface->sync(&pbi->lf_worker); | 934 winterface->sync(&pbi->lf_worker); |
| 935 vp9_loop_filter_data_reset(lf_data, get_frame_new_buffer(cm), cm, | 935 vp9_loop_filter_data_reset(lf_data, get_frame_new_buffer(cm), cm, |
| 936 pbi->mb.plane); | 936 pbi->mb.plane); |
| 937 vp9_loop_filter_frame_init(cm, cm->lf.filter_level); | |
| 938 } | 937 } |
| 939 | 938 |
| 940 assert(tile_rows <= 4); | 939 assert(tile_rows <= 4); |
| 941 assert(tile_cols <= (1 << 6)); | 940 assert(tile_cols <= (1 << 6)); |
| 942 | 941 |
| 943 // Note: this memset assumes above_context[0], [1] and [2] | 942 // Note: this memset assumes above_context[0], [1] and [2] |
| 944 // are allocated as part of the same buffer. | 943 // are allocated as part of the same buffer. |
| 945 vpx_memset(cm->above_context, 0, | 944 vpx_memset(cm->above_context, 0, |
| 946 sizeof(*cm->above_context) * MAX_MB_PLANE * 2 * aligned_cols); | 945 sizeof(*cm->above_context) * MAX_MB_PLANE * 2 * aligned_cols); |
| 947 | 946 |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 | 1354 |
| 1356 if (cm->frame_type == KEY_FRAME) { | 1355 if (cm->frame_type == KEY_FRAME) { |
| 1357 if (!vp9_read_sync_code(rb)) | 1356 if (!vp9_read_sync_code(rb)) |
| 1358 vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, | 1357 vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, |
| 1359 "Invalid frame sync code"); | 1358 "Invalid frame sync code"); |
| 1360 | 1359 |
| 1361 read_bitdepth_colorspace_sampling(cm, rb); | 1360 read_bitdepth_colorspace_sampling(cm, rb); |
| 1362 pbi->refresh_frame_flags = (1 << REF_FRAMES) - 1; | 1361 pbi->refresh_frame_flags = (1 << REF_FRAMES) - 1; |
| 1363 | 1362 |
| 1364 for (i = 0; i < REFS_PER_FRAME; ++i) { | 1363 for (i = 0; i < REFS_PER_FRAME; ++i) { |
| 1365 cm->frame_refs[i].idx = -1; | 1364 cm->frame_refs[i].idx = INVALID_IDX; |
| 1366 cm->frame_refs[i].buf = NULL; | 1365 cm->frame_refs[i].buf = NULL; |
| 1367 } | 1366 } |
| 1368 | 1367 |
| 1369 setup_frame_size(cm, rb); | 1368 setup_frame_size(cm, rb); |
| 1370 if (pbi->need_resync) { | 1369 if (pbi->need_resync) { |
| 1371 vpx_memset(&cm->ref_frame_map, -1, sizeof(cm->ref_frame_map)); | 1370 vpx_memset(&cm->ref_frame_map, -1, sizeof(cm->ref_frame_map)); |
| 1372 pbi->need_resync = 0; | 1371 pbi->need_resync = 0; |
| 1373 } | 1372 } |
| 1374 } else { | 1373 } else { |
| 1375 cm->intra_only = cm->show_frame ? 0 : vp9_rb_read_bit(rb); | 1374 cm->intra_only = cm->show_frame ? 0 : vp9_rb_read_bit(rb); |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1920 if (subpel_y || (sf->y_step_q4 != SUBPEL_SHIFTS)) { | 1919 if (subpel_y || (sf->y_step_q4 != SUBPEL_SHIFTS)) { |
| 1921 y0 -= VP9_INTERP_EXTEND - 1; | 1920 y0 -= VP9_INTERP_EXTEND - 1; |
| 1922 y1 += VP9_INTERP_EXTEND; | 1921 y1 += VP9_INTERP_EXTEND; |
| 1923 y_pad = 1; | 1922 y_pad = 1; |
| 1924 } | 1923 } |
| 1925 | 1924 |
| 1926 // Wait until reference block is ready. Pad 7 more pixels as last 7 | 1925 // Wait until reference block is ready. Pad 7 more pixels as last 7 |
| 1927 // pixels of each superblock row can be changed by next superblock row. | 1926 // pixels of each superblock row can be changed by next superblock row. |
| 1928 if (pbi->frame_parallel_decode) | 1927 if (pbi->frame_parallel_decode) |
| 1929 vp9_frameworker_wait(pbi->frame_worker_owner, ref_frame_buf, | 1928 vp9_frameworker_wait(pbi->frame_worker_owner, ref_frame_buf, |
| 1930 (y1 + 7) << (plane == 0 ? 0 : 1)); | 1929 MAX(0, (y1 + 7) << (plane == 0 ? 0 : 1))); |
| 1931 | 1930 |
| 1932 // Skip border extension if block is inside the frame. | 1931 // Skip border extension if block is inside the frame. |
| 1933 if (x0 < 0 || x0 > frame_width - 1 || x1 < 0 || x1 > frame_width - 1 || | 1932 if (x0 < 0 || x0 > frame_width - 1 || x1 < 0 || x1 > frame_width - 1 || |
| 1934 y0 < 0 || y0 > frame_height - 1 || y1 < 0 || y1 > frame_height - 1) { | 1933 y0 < 0 || y0 > frame_height - 1 || y1 < 0 || y1 > frame_height - 1) { |
| 1935 uint8_t *buf_ptr1 = ref_frame + y0 * pre_buf->stride + x0; | 1934 uint8_t *buf_ptr1 = ref_frame + y0 * pre_buf->stride + x0; |
| 1936 // Extend the border. | 1935 // Extend the border. |
| 1937 #if CONFIG_VP9_HIGHBITDEPTH | 1936 #if CONFIG_VP9_HIGHBITDEPTH |
| 1938 if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { | 1937 if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { |
| 1939 high_build_mc_border(buf_ptr1, | 1938 high_build_mc_border(buf_ptr1, |
| 1940 pre_buf->stride, | 1939 pre_buf->stride, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1976 frame_height); | 1975 frame_height); |
| 1977 buf_stride = x1 - x0 + 1; | 1976 buf_stride = x1 - x0 + 1; |
| 1978 buf_ptr = xd->mc_buf + y_pad * 3 * buf_stride + x_pad * 3; | 1977 buf_ptr = xd->mc_buf + y_pad * 3 * buf_stride + x_pad * 3; |
| 1979 #endif // CONFIG_VP9_HIGHBITDEPTH | 1978 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 1980 } | 1979 } |
| 1981 } else { | 1980 } else { |
| 1982 // Wait until reference block is ready. Pad 7 more pixels as last 7 | 1981 // Wait until reference block is ready. Pad 7 more pixels as last 7 |
| 1983 // pixels of each superblock row can be changed by next superblock row. | 1982 // pixels of each superblock row can be changed by next superblock row. |
| 1984 if (pbi->frame_parallel_decode) | 1983 if (pbi->frame_parallel_decode) |
| 1985 vp9_frameworker_wait(pbi->frame_worker_owner, ref_frame_buf, | 1984 vp9_frameworker_wait(pbi->frame_worker_owner, ref_frame_buf, |
| 1986 (y1 + 7) << (plane == 0 ? 0 : 1)); | 1985 MAX(0, (y1 + 7) << (plane == 0 ? 0 : 1))); |
| 1987 } | 1986 } |
| 1988 #if CONFIG_VP9_HIGHBITDEPTH | 1987 #if CONFIG_VP9_HIGHBITDEPTH |
| 1989 if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { | 1988 if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { |
| 1990 high_inter_predictor(buf_ptr, buf_stride, dst, dst_buf->stride, subpel_x, | 1989 high_inter_predictor(buf_ptr, buf_stride, dst, dst_buf->stride, subpel_x, |
| 1991 subpel_y, sf, w, h, ref, kernel, xs, ys, xd->bd); | 1990 subpel_y, sf, w, h, ref, kernel, xs, ys, xd->bd); |
| 1992 } else { | 1991 } else { |
| 1993 inter_predictor(buf_ptr, buf_stride, dst, dst_buf->stride, subpel_x, | 1992 inter_predictor(buf_ptr, buf_stride, dst, dst_buf->stride, subpel_x, |
| 1994 subpel_y, sf, w, h, ref, kernel, xs, ys); | 1993 subpel_y, sf, w, h, ref, kernel, xs, ys); |
| 1995 } | 1994 } |
| 1996 #else | 1995 #else |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2020 for (y = 0; y < num_4x4_h; ++y) | 2019 for (y = 0; y < num_4x4_h; ++y) |
| 2021 for (x = 0; x < num_4x4_w; ++x) | 2020 for (x = 0; x < num_4x4_w; ++x) |
| 2022 dec_build_inter_predictors(pbi, xd, plane, i++, bw, bh, | 2021 dec_build_inter_predictors(pbi, xd, plane, i++, bw, bh, |
| 2023 4 * x, 4 * y, 4, 4, mi_x, mi_y); | 2022 4 * x, 4 * y, 4, 4, mi_x, mi_y); |
| 2024 } else { | 2023 } else { |
| 2025 dec_build_inter_predictors(pbi, xd, plane, 0, bw, bh, | 2024 dec_build_inter_predictors(pbi, xd, plane, 0, bw, bh, |
| 2026 0, 0, bw, bh, mi_x, mi_y); | 2025 0, 0, bw, bh, mi_x, mi_y); |
| 2027 } | 2026 } |
| 2028 } | 2027 } |
| 2029 } | 2028 } |
| OLD | NEW |