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 |
11 #ifndef VP9_ENCODER_VP9_RDOPT_H_ | 11 #ifndef VP9_ENCODER_VP9_RDOPT_H_ |
12 #define VP9_ENCODER_VP9_RDOPT_H_ | 12 #define VP9_ENCODER_VP9_RDOPT_H_ |
13 | 13 |
14 #include "vp9/encoder/vp9_onyx_int.h" | 14 #include "vp9/encoder/vp9_onyx_int.h" |
15 | 15 |
16 #ifdef __cplusplus | 16 #ifdef __cplusplus |
17 extern "C" { | 17 extern "C" { |
18 #endif | 18 #endif |
19 | 19 |
20 #define RDDIV_BITS 7 | 20 #define RDDIV_BITS 7 |
21 | 21 |
22 #define RDCOST(RM, DM, R, D) \ | 22 #define RDCOST(RM, DM, R, D) \ |
23 (((128 + ((int64_t)R) * (RM)) >> 8) + (D << DM)) | 23 (((128 + ((int64_t)R) * (RM)) >> 8) + (D << DM)) |
24 #define QIDX_SKIP_THRESH 115 | 24 #define QIDX_SKIP_THRESH 115 |
25 | 25 |
26 #define RD_THRESH_MAX_FACT 64 | |
27 #define RD_THRESH_INC 1 | |
28 #define RD_THRESH_POW 1.25 | |
29 #define RD_MULT_EPB_RATIO 64 | |
30 | |
31 #define MV_COST_WEIGHT 108 | 26 #define MV_COST_WEIGHT 108 |
32 #define MV_COST_WEIGHT_SUB 120 | 27 #define MV_COST_WEIGHT_SUB 120 |
33 | 28 |
34 #define INVALID_MV 0x80008000 | 29 #define INVALID_MV 0x80008000 |
35 | 30 |
36 struct TileInfo; | 31 struct TileInfo; |
37 | 32 |
38 int vp9_compute_rd_mult(VP9_COMP *cpi, int qindex); | 33 int vp9_compute_rd_mult(const VP9_COMP *cpi, int qindex); |
39 | 34 |
40 void vp9_initialize_rd_consts(VP9_COMP *cpi); | 35 void vp9_initialize_rd_consts(VP9_COMP *cpi); |
41 | 36 |
42 void vp9_initialize_me_consts(VP9_COMP *cpi, int qindex); | 37 void vp9_initialize_me_consts(VP9_COMP *cpi, int qindex); |
43 | 38 |
| 39 void vp9_model_rd_from_var_lapndz(unsigned int var, unsigned int n, |
| 40 unsigned int qstep, int *rate, |
| 41 int64_t *dist); |
| 42 |
| 43 int vp9_get_switchable_rate(const MACROBLOCK *x); |
| 44 |
44 void vp9_setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x, | 45 void vp9_setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x, |
45 const TileInfo *const tile, | 46 const TileInfo *const tile, |
46 MV_REFERENCE_FRAME ref_frame, | 47 MV_REFERENCE_FRAME ref_frame, |
47 BLOCK_SIZE block_size, | 48 BLOCK_SIZE block_size, |
48 int mi_row, int mi_col, | 49 int mi_row, int mi_col, |
49 int_mv frame_nearest_mv[MAX_REF_FRAMES], | 50 int_mv frame_nearest_mv[MAX_REF_FRAMES], |
50 int_mv frame_near_mv[MAX_REF_FRAMES], | 51 int_mv frame_near_mv[MAX_REF_FRAMES], |
51 struct buf_2d yv12_mb[4][MAX_MB_PLANE]); | 52 struct buf_2d yv12_mb[4][MAX_MB_PLANE]); |
52 | 53 |
53 const YV12_BUFFER_CONFIG *vp9_get_scaled_ref_frame(const VP9_COMP *cpi, | 54 const YV12_BUFFER_CONFIG *vp9_get_scaled_ref_frame(const VP9_COMP *cpi, |
(...skipping 16 matching lines...) Expand all Loading... |
70 const struct TileInfo *const tile, | 71 const struct TileInfo *const tile, |
71 int mi_row, int mi_col, | 72 int mi_row, int mi_col, |
72 int *returnrate, | 73 int *returnrate, |
73 int64_t *returndistortion, | 74 int64_t *returndistortion, |
74 BLOCK_SIZE bsize, | 75 BLOCK_SIZE bsize, |
75 PICK_MODE_CONTEXT *ctx, | 76 PICK_MODE_CONTEXT *ctx, |
76 int64_t best_rd_so_far); | 77 int64_t best_rd_so_far); |
77 | 78 |
78 void vp9_init_me_luts(); | 79 void vp9_init_me_luts(); |
79 | 80 |
80 void vp9_set_mbmode_and_mvs(MACROBLOCKD *xd, MB_PREDICTION_MODE mode, | |
81 const MV *mv); | |
82 | |
83 void vp9_get_entropy_contexts(BLOCK_SIZE bsize, TX_SIZE tx_size, | 81 void vp9_get_entropy_contexts(BLOCK_SIZE bsize, TX_SIZE tx_size, |
84 const struct macroblockd_plane *pd, | 82 const struct macroblockd_plane *pd, |
85 ENTROPY_CONTEXT t_above[16], | 83 ENTROPY_CONTEXT t_above[16], |
86 ENTROPY_CONTEXT t_left[16]); | 84 ENTROPY_CONTEXT t_left[16]); |
87 | 85 |
88 #ifdef __cplusplus | 86 #ifdef __cplusplus |
89 } // extern "C" | 87 } // extern "C" |
90 #endif | 88 #endif |
91 | 89 |
92 #endif // VP9_ENCODER_VP9_RDOPT_H_ | 90 #endif // VP9_ENCODER_VP9_RDOPT_H_ |
OLD | NEW |