OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // (for segment 1), prior to encoding the frame. | 48 // (for segment 1), prior to encoding the frame. |
49 int vp9_cyclic_refresh_rc_bits_per_mb(const struct VP9_COMP *cpi, int i, | 49 int vp9_cyclic_refresh_rc_bits_per_mb(const struct VP9_COMP *cpi, int i, |
50 double correction_factor); | 50 double correction_factor); |
51 | 51 |
52 // Prior to coding a given prediction block, of size bsize at (mi_row, mi_col), | 52 // Prior to coding a given prediction block, of size bsize at (mi_row, mi_col), |
53 // check if we should reset the segment_id, and update the cyclic_refresh map | 53 // check if we should reset the segment_id, and update the cyclic_refresh map |
54 // and segmentation map. | 54 // and segmentation map. |
55 void vp9_cyclic_refresh_update_segment(struct VP9_COMP *const cpi, | 55 void vp9_cyclic_refresh_update_segment(struct VP9_COMP *const cpi, |
56 MB_MODE_INFO *const mbmi, | 56 MB_MODE_INFO *const mbmi, |
57 int mi_row, int mi_col, BLOCK_SIZE bsize, | 57 int mi_row, int mi_col, BLOCK_SIZE bsize, |
58 int64_t rate, int64_t dist); | 58 int64_t rate, int64_t dist, int skip); |
59 | 59 |
60 // Update the segmentation map, and related quantities: cyclic refresh map, | 60 // Update the segmentation map, and related quantities: cyclic refresh map, |
61 // refresh sb_index, and target number of blocks to be refreshed. | 61 // refresh sb_index, and target number of blocks to be refreshed. |
62 void vp9_cyclic_refresh_update__map(struct VP9_COMP *const cpi); | 62 void vp9_cyclic_refresh_update__map(struct VP9_COMP *const cpi); |
63 | 63 |
64 // Update the actual number of blocks that were applied the segment delta q. | 64 // Update the actual number of blocks that were applied the segment delta q. |
65 void vp9_cyclic_refresh_postencode(struct VP9_COMP *const cpi); | 65 void vp9_cyclic_refresh_postencode(struct VP9_COMP *const cpi); |
66 | 66 |
67 // Set golden frame update interval, for non-svc 1 pass CBR mode. | 67 // Set golden frame update interval, for non-svc 1 pass CBR mode. |
68 void vp9_cyclic_refresh_set_golden_update(struct VP9_COMP *const cpi); | 68 void vp9_cyclic_refresh_set_golden_update(struct VP9_COMP *const cpi); |
69 | 69 |
70 // Check if we should not update golden reference, based on past refresh stats. | 70 // Check if we should not update golden reference, based on past refresh stats. |
71 void vp9_cyclic_refresh_check_golden_update(struct VP9_COMP *const cpi); | 71 void vp9_cyclic_refresh_check_golden_update(struct VP9_COMP *const cpi); |
72 | 72 |
73 // Set/update global/frame level refresh parameters. | 73 // Set/update global/frame level refresh parameters. |
74 void vp9_cyclic_refresh_update_parameters(struct VP9_COMP *const cpi); | 74 void vp9_cyclic_refresh_update_parameters(struct VP9_COMP *const cpi); |
75 | 75 |
76 // Setup cyclic background refresh: set delta q and segmentation map. | 76 // Setup cyclic background refresh: set delta q and segmentation map. |
77 void vp9_cyclic_refresh_setup(struct VP9_COMP *const cpi); | 77 void vp9_cyclic_refresh_setup(struct VP9_COMP *const cpi); |
78 | 78 |
79 int vp9_cyclic_refresh_get_rdmult(const CYCLIC_REFRESH *cr); | 79 int vp9_cyclic_refresh_get_rdmult(const CYCLIC_REFRESH *cr); |
80 | 80 |
81 static INLINE int cyclic_refresh_segment_id_boosted(int segment_id) { | 81 static INLINE int cyclic_refresh_segment_id_boosted(int segment_id) { |
82 return segment_id == CR_SEGMENT_ID_BOOST1 || | 82 return segment_id == CR_SEGMENT_ID_BOOST1 || |
83 segment_id == CR_SEGMENT_ID_BOOST2; | 83 segment_id == CR_SEGMENT_ID_BOOST2; |
84 } | 84 } |
85 | 85 |
| 86 static INLINE int cyclic_refresh_segment_id(int segment_id) { |
| 87 if (segment_id == CR_SEGMENT_ID_BOOST1) |
| 88 return CR_SEGMENT_ID_BOOST1; |
| 89 else if (segment_id == CR_SEGMENT_ID_BOOST2) |
| 90 return CR_SEGMENT_ID_BOOST2; |
| 91 else |
| 92 return CR_SEGMENT_ID_BASE; |
| 93 } |
| 94 |
86 #ifdef __cplusplus | 95 #ifdef __cplusplus |
87 } // extern "C" | 96 } // extern "C" |
88 #endif | 97 #endif |
89 | 98 |
90 #endif // VP9_ENCODER_VP9_AQ_CYCLICREFRESH_H_ | 99 #endif // VP9_ENCODER_VP9_AQ_CYCLICREFRESH_H_ |
OLD | NEW |