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