Unified · Split
| @@ -207,10 +207,10 @@ extern "C" · 206 unmodified lines | ||
| 207 | 207 | |
| 208 | 208 | // Temporal scaling parameters |
| 209 | 209 | unsigned int number_of_layers; |
| 210 | − unsigned int target_bitrate[MAX_PERIODICITY]; | |
| 211 | − unsigned int rate_decimator[MAX_PERIODICITY]; | |
| 210 | + unsigned int target_bitrate[VPX_TS_MAX_PERIODICITY]; | |
| 211 | + unsigned int rate_decimator[VPX_TS_MAX_PERIODICITY]; | |
| 212 | 212 | unsigned int periodicity; |
| 213 | − unsigned int layer_id[MAX_PERIODICITY]; | |
| 213 | + unsigned int layer_id[VPX_TS_MAX_PERIODICITY]; | |
| 214 | 214 | |
| 215 | 215 | #if CONFIG_MULTI_RES_ENCODING |
| 216 | 216 | /* Number of total resolutions encoded */ |
| @@ -57,8 +57,6 @@ · 56 unmodified lines | ||
| 57 | 57 | #define VP8_TEMPORAL_ALT_REF 1 |
| 58 | 58 | #endif |
| 59 | 59 | |
| 60 | −#define MAX_PERIODICITY 16 | |
| 61 | − | |
| 62 | 60 | #define MAX(x,y) (((x)>(y))?(x):(y)) |
| 63 | 61 | #define MIN(x,y) (((x)<(y))?(x):(y)) |
| 64 | 62 | |
| @@ -670,21 +668,21 @@ typedef struct VP8_COMP · 605 unmodified lines | ||
| 670 | 668 | |
| 671 | 669 | // Coding layer state variables |
| 672 | 670 | unsigned int current_layer; |
| 673 | − LAYER_CONTEXT layer_context[MAX_LAYERS]; | |
| 674 | − | |
| 675 | − int64_t frames_in_layer[MAX_LAYERS]; | |
| 676 | − int64_t bytes_in_layer[MAX_LAYERS]; | |
| 677 | − double sum_psnr[MAX_LAYERS]; | |
| 678 | − double sum_psnr_p[MAX_LAYERS]; | |
| 679 | − double total_error2[MAX_LAYERS]; | |
| 680 | − double total_error2_p[MAX_LAYERS]; | |
| 681 | − double sum_ssim[MAX_LAYERS]; | |
| 682 | − double sum_weights[MAX_LAYERS]; | |
| 683 | − | |
| 684 | − double total_ssimg_y_in_layer[MAX_LAYERS]; | |
| 685 | − double total_ssimg_u_in_layer[MAX_LAYERS]; | |
| 686 | − double total_ssimg_v_in_layer[MAX_LAYERS]; | |
| 687 | − double total_ssimg_all_in_layer[MAX_LAYERS]; | |
| 671 | + LAYER_CONTEXT layer_context[VPX_TS_MAX_LAYERS]; | |
| 672 | + | |
| 673 | + int64_t frames_in_layer[VPX_TS_MAX_LAYERS]; | |
| 674 | + int64_t bytes_in_layer[VPX_TS_MAX_LAYERS]; | |
| 675 | + double sum_psnr[VPX_TS_MAX_LAYERS]; | |
| 676 | + double sum_psnr_p[VPX_TS_MAX_LAYERS]; | |
| 677 | + double total_error2[VPX_TS_MAX_LAYERS]; | |
| 678 | + double total_error2_p[VPX_TS_MAX_LAYERS]; | |
| 679 | + double sum_ssim[VPX_TS_MAX_LAYERS]; | |
| 680 | + double sum_weights[VPX_TS_MAX_LAYERS]; | |
| 681 | + | |
| 682 | + double total_ssimg_y_in_layer[VPX_TS_MAX_LAYERS]; | |
| 683 | + double total_ssimg_u_in_layer[VPX_TS_MAX_LAYERS]; | |
| 684 | + double total_ssimg_v_in_layer[VPX_TS_MAX_LAYERS]; | |
| 685 | + double total_ssimg_all_in_layer[VPX_TS_MAX_LAYERS]; | |
| 688 | 686 | |
| 689 | 687 | #if CONFIG_MULTI_RES_ENCODING |
| 690 | 688 | /* Number of MBs per row at lower-resolution level */ |
| @@ -117,7 +117,7 @@ static void write_ivf_frame_header(FILE *outfile, · 116 unmodified lines | ||
| 117 | 117 | static int mode_to_num_layers[9] = {2, 2, 3, 3, 3, 3, 5, 2, 3}; |
| 118 | 118 | |
| 119 | 119 | int main(int argc, char **argv) { |
| 120 | − FILE *infile, *outfile[MAX_LAYERS]; | |
| 120 | + FILE *infile, *outfile[VPX_TS_MAX_LAYERS]; | |
| 121 | 121 | vpx_codec_ctx_t codec; |
| 122 | 122 | vpx_codec_enc_cfg_t cfg; |
| 123 | 123 | int frame_cnt = 0; |
| @@ -133,8 +133,8 @@ int main(int argc, char **argv) { · 9 unmodified lines | ||
| 133 | 133 | int frame_duration = 1; // 1 timebase tick per frame |
| 134 | 134 | |
| 135 | 135 | int layering_mode = 0; |
| 136 | − int frames_in_layer[MAX_LAYERS] = {0}; | |
| 137 | − int layer_flags[MAX_PERIODICITY] = {0}; | |
| 136 | + int frames_in_layer[VPX_TS_MAX_LAYERS] = {0}; | |
| 137 | + int layer_flags[VPX_TS_MAX_PERIODICITY] = {0}; | |
| 138 | 138 | int flag_periodicity; |
| 139 | 139 | int max_intra_size_pct; |
| 140 | 140 | |
| @@ -35,10 +35,16 @@ extern "C" { · 34 unmodified lines | ||
| 35 | 35 | /*! Temporal Scalability: Maximum length of the sequence defining frame |
| 36 | 36 | * layer membership |
| 37 | 37 | */ |
| 38 | −#define MAX_PERIODICITY 16 | |
| 38 | +#define VPX_TS_MAX_PERIODICITY 16 | |
| 39 | 39 | |
| 40 | 40 | /*! Temporal Scalability: Maximum number of coding layers */ |
| 41 | −#define MAX_LAYERS 5 | |
| 41 | +#define VPX_TS_MAX_LAYERS 5 | |
| 42 | + | |
| 43 | +/*!\deprecated Use #VPX_TS_MAX_PERIODICITY instead. */ | |
| 44 | +#define MAX_PERIODICITY VPX_TS_MAX_PERIODICITY | |
| 45 | + | |
| 46 | +/*!\deprecated Use #VPX_TS_MAX_LAYERS instead. */ | |
| 47 | +#define MAX_LAYERS VPX_TS_MAX_LAYERS | |
| 42 | 48 | |
| 43 | 49 | /*!\brief Current ABI version number |
| 44 | 50 | * |
| @@ -613,14 +619,14 @@ extern "C" { · 568 unmodified lines | ||
| 613 | 619 | * |
| 614 | 620 | * These values specify the target coding bitrate for each coding layer. |
| 615 | 621 | */ |
| 616 | − unsigned int ts_target_bitrate[MAX_LAYERS]; | |
| 622 | + unsigned int ts_target_bitrate[VPX_TS_MAX_LAYERS]; | |
| 617 | 623 | |
| 618 | 624 | /*!\brief Frame rate decimation factor for each layer |
| 619 | 625 | * |
| 620 | 626 | * These values specify the frame rate decimation factors to apply |
| 621 | 627 | * to each layer. |
| 622 | 628 | */ |
| 623 | − unsigned int ts_rate_decimator[MAX_LAYERS]; | |
| 629 | + unsigned int ts_rate_decimator[VPX_TS_MAX_LAYERS]; | |
| 624 | 630 | |
| 625 | 631 | /*!\brief Length of the sequence defining frame layer membership |
| 626 | 632 | * |
| @@ -638,7 +644,7 @@ extern "C" { · 11 unmodified lines | ||
| 638 | 644 | * and odd numbered frames to a second layer (1) with ts_periodicity=8, |
| 639 | 645 | * then ts_layer_id = (0,1,0,1,0,1,0,1). |
| 640 | 646 | */ |
| 641 | − unsigned int ts_layer_id[MAX_PERIODICITY]; | |
| 647 | + unsigned int ts_layer_id[VPX_TS_MAX_PERIODICITY]; | |
| 642 | 648 | } vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */ |
| 643 | 649 | |
| 644 | 650 | |