diff options
Diffstat (limited to 'vp8/common')
71 files changed, 16974 insertions, 18096 deletions
diff --git a/vp8/common/alloccommon.c b/vp8/common/alloccommon.c index 5c7aa2e5e..7495d5e42 100644 --- a/vp8/common/alloccommon.c +++ b/vp8/common/alloccommon.c @@ -21,224 +21,204 @@ extern void vp8_init_scan_order_mask(); -static void update_mode_info_border( VP8_COMMON *cpi, MODE_INFO *mi_base ) -{ - int stride = cpi->mode_info_stride; - int i; - - // Clear down top border row - vpx_memset(mi_base, 0, sizeof(MODE_INFO) * cpi->mode_info_stride); - - // Clear left border column - for (i = 1; i < cpi->mb_rows+1; i++) - { - vpx_memset(&mi_base[i*stride], 0, sizeof(MODE_INFO)); - } +static void update_mode_info_border(VP8_COMMON *cpi, MODE_INFO *mi_base) { + int stride = cpi->mode_info_stride; + int i; + + // Clear down top border row + vpx_memset(mi_base, 0, sizeof(MODE_INFO) * cpi->mode_info_stride); + + // Clear left border column + for (i = 1; i < cpi->mb_rows + 1; i++) { + vpx_memset(&mi_base[i * stride], 0, sizeof(MODE_INFO)); + } } -static void update_mode_info_in_image( VP8_COMMON *cpi, MODE_INFO *mi ) -{ - int i, j; - - // For each in image mode_info element set the in image flag to 1 - for (i = 0; i < cpi->mb_rows; i++) - { - for (j = 0; j < cpi->mb_cols; j++) - { - mi->mbmi.mb_in_image = 1; - mi++; // Next element in the row - } - - mi++; // Step over border element at start of next row +static void update_mode_info_in_image(VP8_COMMON *cpi, MODE_INFO *mi) { + int i, j; + + // For each in image mode_info element set the in image flag to 1 + for (i = 0; i < cpi->mb_rows; i++) { + for (j = 0; j < cpi->mb_cols; j++) { + mi->mbmi.mb_in_image = 1; + mi++; // Next element in the row } + + mi++; // Step over border element at start of next row + } } -void vp8_de_alloc_frame_buffers(VP8_COMMON *oci) -{ - int i; +void vp8_de_alloc_frame_buffers(VP8_COMMON *oci) { + int i; - for (i = 0; i < NUM_YV12_BUFFERS; i++) - vp8_yv12_de_alloc_frame_buffer(&oci->yv12_fb[i]); + for (i = 0; i < NUM_YV12_BUFFERS; i++) + vp8_yv12_de_alloc_frame_buffer(&oci->yv12_fb[i]); - vp8_yv12_de_alloc_frame_buffer(&oci->temp_scale_frame); - vp8_yv12_de_alloc_frame_buffer(&oci->post_proc_buffer); + vp8_yv12_de_alloc_frame_buffer(&oci->temp_scale_frame); + vp8_yv12_de_alloc_frame_buffer(&oci->post_proc_buffer); - vpx_free(oci->above_context); - vpx_free(oci->mip); - vpx_free(oci->prev_mip); + vpx_free(oci->above_context); + vpx_free(oci->mip); + vpx_free(oci->prev_mip); - oci->above_context = 0; - oci->mip = 0; - oci->prev_mip = 0; + oci->above_context = 0; + oci->mip = 0; + oci->prev_mip = 0; } -int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height) -{ - int i; +int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height) { + int i; - vp8_de_alloc_frame_buffers(oci); + vp8_de_alloc_frame_buffers(oci); - /* our internal buffers are always multiples of 16 */ - if ((width & 0xf) != 0) - width += 16 - (width & 0xf); + /* our internal buffers are always multiples of 16 */ + if ((width & 0xf) != 0) + width += 16 - (width & 0xf); - if ((height & 0xf) != 0) - height += 16 - (height & 0xf); + if ((height & 0xf) != 0) + height += 16 - (height & 0xf); - for (i = 0; i < NUM_YV12_BUFFERS; i++) - { - oci->fb_idx_ref_cnt[i] = 0; - oci->yv12_fb[i].flags = 0; - if (vp8_yv12_alloc_frame_buffer(&oci->yv12_fb[i], width, height, VP8BORDERINPIXELS) < 0) - { - vp8_de_alloc_frame_buffers(oci); - return 1; - } + for (i = 0; i < NUM_YV12_BUFFERS; i++) { + oci->fb_idx_ref_cnt[i] = 0; + oci->yv12_fb[i].flags = 0; + if (vp8_yv12_alloc_frame_buffer(&oci->yv12_fb[i], width, height, VP8BORDERINPIXELS) < 0) { + vp8_de_alloc_frame_buffers(oci); + return 1; } + } - oci->new_fb_idx = 0; - oci->lst_fb_idx = 1; - oci->gld_fb_idx = 2; - oci->alt_fb_idx = 3; + oci->new_fb_idx = 0; + oci->lst_fb_idx = 1; + oci->gld_fb_idx = 2; + oci->alt_fb_idx = 3; - oci->fb_idx_ref_cnt[0] = 1; - oci->fb_idx_ref_cnt[1] = 1; - oci->fb_idx_ref_cnt[2] = 1; - oci->fb_idx_ref_cnt[3] = 1; + oci->fb_idx_ref_cnt[0] = 1; + oci->fb_idx_ref_cnt[1] = 1; + oci->fb_idx_ref_cnt[2] = 1; + oci->fb_idx_ref_cnt[3] = 1; - if (vp8_yv12_alloc_frame_buffer(&oci->temp_scale_frame, width, 16, VP8BORDERINPIXELS) < 0) - { - vp8_de_alloc_frame_buffers(oci); - return 1; - } + if (vp8_yv12_alloc_frame_buffer(&oci->temp_scale_frame, width, 16, VP8BORDERINPIXELS) < 0) { + vp8_de_alloc_frame_buffers(oci); + return 1; + } - if (vp8_yv12_alloc_frame_buffer(&oci->post_proc_buffer, width, height, VP8BORDERINPIXELS) < 0) - { - vp8_de_alloc_frame_buffers(oci); - return 1; - } + if (vp8_yv12_alloc_frame_buffer(&oci->post_proc_buffer, width, height, VP8BORDERINPIXELS) < 0) { + vp8_de_alloc_frame_buffers(oci); + return 1; + } - oci->mb_rows = height >> 4; - oci->mb_cols = width >> 4; - oci->MBs = oci->mb_rows * oci->mb_cols; - oci->mode_info_stride = oci->mb_cols + 1; - oci->mip = vpx_calloc((oci->mb_cols + 1) * (oci->mb_rows + 1), sizeof(MODE_INFO)); + oci->mb_rows = height >> 4; + oci->mb_cols = width >> 4; + oci->MBs = oci->mb_rows * oci->mb_cols; + oci->mode_info_stride = oci->mb_cols + 1; + oci->mip = vpx_calloc((oci->mb_cols + 1) * (oci->mb_rows + 1), sizeof(MODE_INFO)); - if (!oci->mip) - { - vp8_de_alloc_frame_buffers(oci); - return 1; - } + if (!oci->mip) { + vp8_de_alloc_frame_buffers(oci); + return 1; + } - oci->mi = oci->mip + oci->mode_info_stride + 1; + oci->mi = oci->mip + oci->mode_info_stride + 1; - /* allocate memory for last frame MODE_INFO array */ + /* allocate memory for last frame MODE_INFO array */ - oci->prev_mip = vpx_calloc((oci->mb_cols + 1) * (oci->mb_rows + 1), sizeof(MODE_INFO)); + oci->prev_mip = vpx_calloc((oci->mb_cols + 1) * (oci->mb_rows + 1), sizeof(MODE_INFO)); - if (!oci->prev_mip) - { - vp8_de_alloc_frame_buffers(oci); - return 1; - } + if (!oci->prev_mip) { + vp8_de_alloc_frame_buffers(oci); + return 1; + } - oci->prev_mi = oci->prev_mip + oci->mode_info_stride + 1; + oci->prev_mi = oci->prev_mip + oci->mode_info_stride + 1; - oci->above_context = vpx_calloc(sizeof(ENTROPY_CONTEXT_PLANES) * oci->mb_cols, 1); + oci->above_context = vpx_calloc(sizeof(ENTROPY_CONTEXT_PLANES) * oci->mb_cols, 1); - if (!oci->above_context) - { - vp8_de_alloc_frame_buffers(oci); - return 1; - } + if (!oci->above_context) { + vp8_de_alloc_frame_buffers(oci); + return 1; + } - update_mode_info_border(oci, oci->mip); - update_mode_info_in_image(oci, oci->mi); + update_mode_info_border(oci, oci->mip); + update_mode_info_in_image(oci, oci->mi); - return 0; + return 0; } -void vp8_setup_version(VP8_COMMON *cm) -{ - if (cm->version & 0x4) - { - if (!CONFIG_EXPERIMENTAL) - vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, - "Bitstream was created by an experimental " - "encoder"); - cm->experimental = 1; - } - - switch (cm->version & 0x3) - { +void vp8_setup_version(VP8_COMMON *cm) { + if (cm->version & 0x4) { + if (!CONFIG_EXPERIMENTAL) + vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM, + "Bitstream was created by an experimental " + "encoder"); + cm->experimental = 1; + } + + switch (cm->version & 0x3) { case 0: - cm->no_lpf = 0; - cm->filter_type = NORMAL_LOOPFILTER; - cm->use_bilinear_mc_filter = 0; - cm->full_pixel = 0; - break; + cm->no_lpf = 0; + cm->filter_type = NORMAL_LOOPFILTER; + cm->use_bilinear_mc_filter = 0; + cm->full_pixel = 0; + break; case 1: - cm->no_lpf = 0; - cm->filter_type = SIMPLE_LOOPFILTER; - cm->use_bilinear_mc_filter = 1; - cm->full_pixel = 0; - break; + cm->no_lpf = 0; + cm->filter_type = SIMPLE_LOOPFILTER; + cm->use_bilinear_mc_filter = 1; + cm->full_pixel = 0; + break; case 2: case 3: - cm->no_lpf = 1; - cm->filter_type = NORMAL_LOOPFILTER; - cm->use_bilinear_mc_filter = 1; - cm->full_pixel = 0; - break; - // Full pel only code deprecated in experimental code base - //case 3: - // cm->no_lpf = 1; - // cm->filter_type = SIMPLE_LOOPFILTER; - // cm->use_bilinear_mc_filter = 1; - // cm->full_pixel = 1; - // break; - } + cm->no_lpf = 1; + cm->filter_type = NORMAL_LOOPFILTER; + cm->use_bilinear_mc_filter = 1; + cm->full_pixel = 0; + break; + // Full pel only code deprecated in experimental code base + // case 3: + // cm->no_lpf = 1; + // cm->filter_type = SIMPLE_LOOPFILTER; + // cm->use_bilinear_mc_filter = 1; + // cm->full_pixel = 1; + // break; + } } -void vp8_create_common(VP8_COMMON *oci) -{ - vp8_machine_specific_config(oci); - - vp8_init_mbmode_probs(oci); - - vp8_default_bmode_probs(oci->fc.bmode_prob); - - oci->txfm_mode = ONLY_4X4; - oci->mb_no_coeff_skip = 1; - oci->comp_pred_mode = HYBRID_PREDICTION; - oci->no_lpf = 0; - oci->filter_type = NORMAL_LOOPFILTER; - oci->use_bilinear_mc_filter = 0; - oci->full_pixel = 0; - oci->clr_type = REG_YUV; - oci->clamp_type = RECON_CLAMP_REQUIRED; - - /* Initialise reference frame sign bias structure to defaults */ - vpx_memset(oci->ref_frame_sign_bias, 0, sizeof(oci->ref_frame_sign_bias)); - - /* Default disable buffer to buffer copying */ - oci->copy_buffer_to_gf = 0; - oci->copy_buffer_to_arf = 0; - oci->kf_ymode_probs_update = 0; +void vp8_create_common(VP8_COMMON *oci) { + vp8_machine_specific_config(oci); + + vp8_init_mbmode_probs(oci); + + vp8_default_bmode_probs(oci->fc.bmode_prob); + + oci->txfm_mode = ONLY_4X4; + oci->mb_no_coeff_skip = 1; + oci->comp_pred_mode = HYBRID_PREDICTION; + oci->no_lpf = 0; + oci->filter_type = NORMAL_LOOPFILTER; + oci->use_bilinear_mc_filter = 0; + oci->full_pixel = 0; + oci->clr_type = REG_YUV; + oci->clamp_type = RECON_CLAMP_REQUIRED; + + /* Initialise reference frame sign bias structure to defaults */ + vpx_memset(oci->ref_frame_sign_bias, 0, sizeof(oci->ref_frame_sign_bias)); + + /* Default disable buffer to buffer copying */ + oci->copy_buffer_to_gf = 0; + oci->copy_buffer_to_arf = 0; + oci->kf_ymode_probs_update = 0; } -void vp8_remove_common(VP8_COMMON *oci) -{ - vp8_de_alloc_frame_buffers(oci); +void vp8_remove_common(VP8_COMMON *oci) { + vp8_de_alloc_frame_buffers(oci); } -void vp8_initialize_common() -{ - vp8_coef_tree_initialize(); +void vp8_initialize_common() { + vp8_coef_tree_initialize(); - vp8_entropy_mode_init(); + vp8_entropy_mode_init(); - vp8_entropy_mv_init(); + vp8_entropy_mv_init(); - vp8_init_scan_order_mask(); + vp8_init_scan_order_mask(); } diff --git a/vp8/common/arm/arm_systemdependent.c b/vp8/common/arm/arm_systemdependent.c index 72f044ab6..5fd5f5b1b 100644 --- a/vp8/common/arm/arm_systemdependent.c +++ b/vp8/common/arm/arm_systemdependent.c @@ -19,98 +19,94 @@ #include "vp8/common/idct.h" #include "vp8/common/onyxc_int.h" -void vp8_arch_arm_common_init(VP8_COMMON *ctx) -{ +void vp8_arch_arm_common_init(VP8_COMMON *ctx) { #if CONFIG_RUNTIME_CPU_DETECT - VP8_COMMON_RTCD *rtcd = &ctx->rtcd; - int flags = arm_cpu_caps(); - rtcd->flags = flags; + VP8_COMMON_RTCD *rtcd = &ctx->rtcd; + int flags = arm_cpu_caps(); + rtcd->flags = flags; - /* Override default functions with fastest ones for this CPU. */ + /* Override default functions with fastest ones for this CPU. */ #if HAVE_ARMV5TE - if (flags & HAS_EDSP) - { - } + if (flags & HAS_EDSP) { + } #endif // The commented functions need to be re-written for vpx. #if HAVE_ARMV6 - if (flags & HAS_MEDIA) - { - rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_armv6; - rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_armv6; - rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_armv6; - rtcd->subpix.sixtap4x4 = vp8_sixtap_predict_armv6; + if (flags & HAS_MEDIA) { + rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_armv6; + rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_armv6; + rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_armv6; + rtcd->subpix.sixtap4x4 = vp8_sixtap_predict_armv6; - rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_armv6; - rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_armv6; - rtcd->subpix.bilinear8x4 = vp8_bilinear_predict8x4_armv6; - rtcd->subpix.bilinear4x4 = vp8_bilinear_predict4x4_armv6; + rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_armv6; + rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_armv6; + rtcd->subpix.bilinear8x4 = vp8_bilinear_predict8x4_armv6; + rtcd->subpix.bilinear4x4 = vp8_bilinear_predict4x4_armv6; - //rtcd->idct.idct1 = vp8_short_idct4x4llm_1_v6; - //rtcd->idct.idct16 = vp8_short_idct4x4llm_v6_dual; - //rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_v6; - //rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_v6; + // rtcd->idct.idct1 = vp8_short_idct4x4llm_1_v6; + // rtcd->idct.idct16 = vp8_short_idct4x4llm_v6_dual; + // rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_v6; + // rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_v6; - rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_armv6; - rtcd->loopfilter.normal_b_v = vp8_loop_filter_bv_armv6; - rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_armv6; - rtcd->loopfilter.normal_b_h = vp8_loop_filter_bh_armv6; - rtcd->loopfilter.simple_mb_v = - vp8_loop_filter_simple_vertical_edge_armv6; - rtcd->loopfilter.simple_b_v = vp8_loop_filter_bvs_armv6; - rtcd->loopfilter.simple_mb_h = - vp8_loop_filter_simple_horizontal_edge_armv6; - rtcd->loopfilter.simple_b_h = vp8_loop_filter_bhs_armv6; + rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_armv6; + rtcd->loopfilter.normal_b_v = vp8_loop_filter_bv_armv6; + rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_armv6; + rtcd->loopfilter.normal_b_h = vp8_loop_filter_bh_armv6; + rtcd->loopfilter.simple_mb_v = + vp8_loop_filter_simple_vertical_edge_armv6; + rtcd->loopfilter.simple_b_v = vp8_loop_filter_bvs_armv6; + rtcd->loopfilter.simple_mb_h = + vp8_loop_filter_simple_horizontal_edge_armv6; + rtcd->loopfilter.simple_b_h = vp8_loop_filter_bhs_armv6; - rtcd->recon.copy16x16 = vp8_copy_mem16x16_v6; - rtcd->recon.copy8x8 = vp8_copy_mem8x8_v6; - rtcd->recon.copy8x4 = vp8_copy_mem8x4_v6; - rtcd->recon.recon = vp8_recon_b_armv6; - rtcd->recon.recon2 = vp8_recon2b_armv6; - rtcd->recon.recon4 = vp8_recon4b_armv6; - } + rtcd->recon.copy16x16 = vp8_copy_mem16x16_v6; + rtcd->recon.copy8x8 = vp8_copy_mem8x8_v6; + rtcd->recon.copy8x4 = vp8_copy_mem8x4_v6; + rtcd->recon.recon = vp8_recon_b_armv6; + rtcd->recon.recon2 = vp8_recon2b_armv6; + rtcd->recon.recon4 = vp8_recon4b_armv6; + } #endif #if HAVE_ARMV7 - if (flags & HAS_NEON) - { - rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_neon; - rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_neon; - rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_neon; - rtcd->subpix.sixtap4x4 = vp8_sixtap_predict_neon; + if (flags & HAS_NEON) { + rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_neon; + rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_neon; + rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_neon; + rtcd->subpix.sixtap4x4 = vp8_sixtap_predict_neon; - rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_neon; - rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_neon; - rtcd->subpix.bilinear8x4 = vp8_bilinear_predict8x4_neon; - rtcd->subpix.bilinear4x4 = vp8_bilinear_predict4x4_neon; + rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_neon; + rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_neon; + rtcd->subpix.bilinear8x4 = vp8_bilinear_predict8x4_neon; + rtcd->subpix.bilinear4x4 = vp8_bilinear_predict4x4_neon; - //rtcd->idct.idct1 = vp8_short_idct4x4llm_1_neon; - //rtcd->idct.idct16 = vp8_short_idct4x4llm_neon; - //rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_neon; - //rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_neon; + // rtcd->idct.idct1 = vp8_short_idct4x4llm_1_neon; + // rtcd->idct.idct16 = vp8_short_idct4x4llm_neon; + // rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_neon; + // rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_neon; - rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_neon; - rtcd->loopfilter.normal_b_v = vp8_loop_filter_bv_neon; - rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_neon; - rtcd->loopfilter.normal_b_h = vp8_loop_filter_bh_neon; - rtcd->loopfilter.simple_mb_v = vp8_loop_filter_mbvs_neon; - rtcd->loopfilter.simple_b_v = vp8_loop_filter_bvs_neon; - rtcd->loopfilter.simple_mb_h = vp8_loop_filter_mbhs_neon; - rtcd->loopfilter.simple_b_h = vp8_loop_filter_bhs_neon; + rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_neon; + rtcd->loopfilter.normal_b_v = vp8_loop_filter_bv_neon; + rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_neon; + rtcd->loopfilter.normal_b_h = vp8_loop_filter_bh_neon; + rtcd->loopfilter.simple_mb_v = vp8_loop_filter_mbvs_neon; + rtcd->loopfilter.simple_b_v = vp8_loop_filter_bvs_neon; + rtcd->loopfilter.simple_mb_h = vp8_loop_filter_mbhs_neon; + rtcd->loopfilter.simple_b_h = vp8_loop_filter_bhs_neon; - rtcd->recon.copy16x16 = vp8_copy_mem16x16_neon; - rtcd->recon.copy8x8 = vp8_copy_mem8x8_neon; - rtcd->recon.copy8x4 = vp8_copy_mem8x4_neon; - rtcd->recon.recon = vp8_recon_b_neon; - rtcd->recon.recon2 = vp8_recon2b_neon; - rtcd->recon.recon4 = vp8_recon4b_neon; - rtcd->recon.recon_mb = vp8_recon_mb_neon; - rtcd->recon.build_intra_predictors_mby = - vp8_build_intra_predictors_mby_neon; - rtcd->recon.build_intra_predictors_mby_s = - vp8_build_intra_predictors_mby_s_neon; - } + rtcd->recon.copy16x16 = vp8_copy_mem16x16_neon; + rtcd->recon.copy8x8 = vp8_copy_mem8x8_neon; + rtcd->recon.copy8x4 = vp8_copy_mem8x4_neon; + rtcd->recon.recon = vp8_recon_b_neon; + rtcd->recon.recon2 = vp8_recon2b_neon; + rtcd->recon.recon4 = vp8_recon4b_neon; + rtcd->recon.recon_mb = vp8_recon_mb_neon; + rtcd->recon.build_intra_predictors_mby = + vp8_build_intra_predictors_mby_neon; + rtcd->recon.build_intra_predictors_mby_s = + vp8_build_intra_predictors_mby_s_neon; + } #endif #endif diff --git a/vp8/common/arm/bilinearfilter_arm.c b/vp8/common/arm/bilinearfilter_arm.c index 7340e20f3..a49f13b9e 100644 --- a/vp8/common/arm/bilinearfilter_arm.c +++ b/vp8/common/arm/bilinearfilter_arm.c @@ -16,98 +16,93 @@ void vp8_filter_block2d_bil_armv6 ( - unsigned char *src_ptr, - unsigned char *dst_ptr, - unsigned int src_pitch, - unsigned int dst_pitch, - const short *HFilter, - const short *VFilter, - int Width, - int Height -) -{ - unsigned short FData[36*16]; /* Temp data buffer used in filtering */ - - /* First filter 1-D horizontally... */ - vp8_filter_block2d_bil_first_pass_armv6(src_ptr, FData, src_pitch, Height + 1, Width, HFilter); - - /* then 1-D vertically... */ - vp8_filter_block2d_bil_second_pass_armv6(FData, dst_ptr, dst_pitch, Height, Width, VFilter); + unsigned char *src_ptr, + unsigned char *dst_ptr, + unsigned int src_pitch, + unsigned int dst_pitch, + const short *HFilter, + const short *VFilter, + int Width, + int Height +) { + unsigned short FData[36 * 16]; /* Temp data buffer used in filtering */ + + /* First filter 1-D horizontally... */ + vp8_filter_block2d_bil_first_pass_armv6(src_ptr, FData, src_pitch, Height + 1, Width, HFilter); + + /* then 1-D vertically... */ + vp8_filter_block2d_bil_second_pass_armv6(FData, dst_ptr, dst_pitch, Height, Width, VFilter); } void vp8_bilinear_predict4x4_armv6 ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - vp8_filter_block2d_bil_armv6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 4, 4); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_bilinear_filters[xoffset]; + VFilter = vp8_bilinear_filters[yoffset]; + + vp8_filter_block2d_bil_armv6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 4, 4); } void vp8_bilinear_predict8x8_armv6 ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - vp8_filter_block2d_bil_armv6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 8); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_bilinear_filters[xoffset]; + VFilter = vp8_bilinear_filters[yoffset]; + + vp8_filter_block2d_bil_armv6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 8); } void vp8_bilinear_predict8x4_armv6 ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - vp8_filter_block2d_bil_armv6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 4); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_bilinear_filters[xoffset]; + VFilter = vp8_bilinear_filters[yoffset]; + + vp8_filter_block2d_bil_armv6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 4); } void vp8_bilinear_predict16x16_armv6 ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - vp8_filter_block2d_bil_armv6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 16, 16); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_bilinear_filters[xoffset]; + VFilter = vp8_bilinear_filters[yoffset]; + + vp8_filter_block2d_bil_armv6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 16, 16); } diff --git a/vp8/common/arm/bilinearfilter_arm.h b/vp8/common/arm/bilinearfilter_arm.h index b7155d3f0..1e0d6d231 100644 --- a/vp8/common/arm/bilinearfilter_arm.h +++ b/vp8/common/arm/bilinearfilter_arm.h @@ -14,22 +14,22 @@ extern void vp8_filter_block2d_bil_first_pass_armv6 ( - const unsigned char *src_ptr, - unsigned short *dst_ptr, - unsigned int src_pitch, - unsigned int height, - unsigned int width, - const short *vp8_filter + const unsigned char *src_ptr, + unsigned short *dst_ptr, + unsigned int src_pitch, + unsigned int height, + unsigned int width, + const short *vp8_filter ); extern void vp8_filter_block2d_bil_second_pass_armv6 ( - const unsigned short *src_ptr, - unsigned char *dst_ptr, - int dst_pitch, - unsigned int height, - unsigned int width, - const short *vp8_filter + const unsigned short *src_ptr, + unsigned char *dst_ptr, + int dst_pitch, + unsigned int height, + unsigned int width, + const short *vp8_filter ); #endif /* BILINEARFILTER_ARM_H */ diff --git a/vp8/common/arm/filter_arm.c b/vp8/common/arm/filter_arm.c index 6582fb29a..a53066836 100644 --- a/vp8/common/arm/filter_arm.c +++ b/vp8/common/arm/filter_arm.c @@ -17,205 +17,182 @@ extern void vp8_filter_block2d_first_pass_armv6 ( - unsigned char *src_ptr, - short *output_ptr, - unsigned int src_pixels_per_line, - unsigned int output_width, - unsigned int output_height, - const short *vp8_filter + unsigned char *src_ptr, + short *output_ptr, + unsigned int src_pixels_per_line, + unsigned int output_width, + unsigned int output_height, + const short *vp8_filter ); // 8x8 extern void vp8_filter_block2d_first_pass_8x8_armv6 ( - unsigned char *src_ptr, - short *output_ptr, - unsigned int src_pixels_per_line, - unsigned int output_width, - unsigned int output_height, - const short *vp8_filter + unsigned char *src_ptr, + short *output_ptr, + unsigned int src_pixels_per_line, + unsigned int output_width, + unsigned int output_height, + const short *vp8_filter ); // 16x16 extern void vp8_filter_block2d_first_pass_16x16_armv6 ( - unsigned char *src_ptr, - short *output_ptr, - unsigned int src_pixels_per_line, - unsigned int output_width, - unsigned int output_height, - const short *vp8_filter + unsigned char *src_ptr, + short *output_ptr, + unsigned int src_pixels_per_line, + unsigned int output_width, + unsigned int output_height, + const short *vp8_filter ); extern void vp8_filter_block2d_second_pass_armv6 ( - short *src_ptr, - unsigned char *output_ptr, - unsigned int output_pitch, - unsigned int cnt, - const short *vp8_filter + short *src_ptr, + unsigned char *output_ptr, + unsigned int output_pitch, + unsigned int cnt, + const short *vp8_filter ); extern void vp8_filter4_block2d_second_pass_armv6 ( - short *src_ptr, - unsigned char *output_ptr, - unsigned int output_pitch, - unsigned int cnt, - const short *vp8_filter + short *src_ptr, + unsigned char *output_ptr, + unsigned int output_pitch, + unsigned int cnt, + const short *vp8_filter ); extern void vp8_filter_block2d_first_pass_only_armv6 ( - unsigned char *src_ptr, - unsigned char *output_ptr, - unsigned int src_pixels_per_line, - unsigned int cnt, - unsigned int output_pitch, - const short *vp8_filter + unsigned char *src_ptr, + unsigned char *output_ptr, + unsigned int src_pixels_per_line, + unsigned int cnt, + unsigned int output_pitch, + const short *vp8_filter ); extern void vp8_filter_block2d_second_pass_only_armv6 ( - unsigned char *src_ptr, - unsigned char *output_ptr, - unsigned int src_pixels_per_line, - unsigned int cnt, - unsigned int output_pitch, - const short *vp8_filter + unsigned char *src_ptr, + unsigned char *output_ptr, + unsigned int src_pixels_per_line, + unsigned int cnt, + unsigned int output_pitch, + const short *vp8_filter ); #if HAVE_ARMV6 void vp8_sixtap_predict_armv6 ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - DECLARE_ALIGNED_ARRAY(4, short, FData, 12*4); /* Temp data buffer used in filtering */ - - - HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */ - - /* Vfilter is null. First pass only */ - if (xoffset && !yoffset) - { - /*vp8_filter_block2d_first_pass_armv6 ( src_ptr, FData+2, src_pixels_per_line, 4, 4, HFilter ); - vp8_filter_block2d_second_pass_armv6 ( FData+2, dst_ptr, dst_pitch, 4, VFilter );*/ - - vp8_filter_block2d_first_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 4, dst_pitch, HFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + DECLARE_ALIGNED_ARRAY(4, short, FData, 12 * 4); /* Temp data buffer used in filtering */ + + + HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */ + + /* Vfilter is null. First pass only */ + if (xoffset && !yoffset) { + /*vp8_filter_block2d_first_pass_armv6 ( src_ptr, FData+2, src_pixels_per_line, 4, 4, HFilter ); + vp8_filter_block2d_second_pass_armv6 ( FData+2, dst_ptr, dst_pitch, 4, VFilter );*/ + + vp8_filter_block2d_first_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 4, dst_pitch, HFilter); + } + /* Hfilter is null. Second pass only */ + else if (!xoffset && yoffset) { + vp8_filter_block2d_second_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 4, dst_pitch, VFilter); + } else { + /* Vfilter is a 4 tap filter */ + if (yoffset & 0x1) { + vp8_filter_block2d_first_pass_armv6(src_ptr - src_pixels_per_line, FData + 1, src_pixels_per_line, 4, 7, HFilter); + vp8_filter4_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 4, VFilter); } - /* Hfilter is null. Second pass only */ - else if (!xoffset && yoffset) - { - vp8_filter_block2d_second_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 4, dst_pitch, VFilter); - } - else - { - /* Vfilter is a 4 tap filter */ - if (yoffset & 0x1) - { - vp8_filter_block2d_first_pass_armv6(src_ptr - src_pixels_per_line, FData + 1, src_pixels_per_line, 4, 7, HFilter); - vp8_filter4_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 4, VFilter); - } - /* Vfilter is 6 tap filter */ - else - { - vp8_filter_block2d_first_pass_armv6(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 4, 9, HFilter); - vp8_filter_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 4, VFilter); - } + /* Vfilter is 6 tap filter */ + else { + vp8_filter_block2d_first_pass_armv6(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 4, 9, HFilter); + vp8_filter_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 4, VFilter); } + } } void vp8_sixtap_predict8x8_armv6 ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - DECLARE_ALIGNED_ARRAY(4, short, FData, 16*8); /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */ - - if (xoffset && !yoffset) - { - vp8_filter_block2d_first_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 8, dst_pitch, HFilter); - } - /* Hfilter is null. Second pass only */ - else if (!xoffset && yoffset) - { - vp8_filter_block2d_second_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 8, dst_pitch, VFilter); - } - else - { - if (yoffset & 0x1) - { - vp8_filter_block2d_first_pass_8x8_armv6(src_ptr - src_pixels_per_line, FData + 1, src_pixels_per_line, 8, 11, HFilter); - vp8_filter4_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 8, VFilter); - } - else - { - vp8_filter_block2d_first_pass_8x8_armv6(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 8, 13, HFilter); - vp8_filter_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 8, VFilter); - } + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + DECLARE_ALIGNED_ARRAY(4, short, FData, 16 * 8); /* Temp data buffer used in filtering */ + + HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */ + + if (xoffset && !yoffset) { + vp8_filter_block2d_first_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 8, dst_pitch, HFilter); + } + /* Hfilter is null. Second pass only */ + else if (!xoffset && yoffset) { + vp8_filter_block2d_second_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 8, dst_pitch, VFilter); + } else { + if (yoffset & 0x1) { + vp8_filter_block2d_first_pass_8x8_armv6(src_ptr - src_pixels_per_line, FData + 1, src_pixels_per_line, 8, 11, HFilter); + vp8_filter4_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 8, VFilter); + } else { + vp8_filter_block2d_first_pass_8x8_armv6(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 8, 13, HFilter); + vp8_filter_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 8, VFilter); } + } } void vp8_sixtap_predict16x16_armv6 ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - DECLARE_ALIGNED_ARRAY(4, short, FData, 24*16); /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */ - - if (xoffset && !yoffset) - { - vp8_filter_block2d_first_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 16, dst_pitch, HFilter); - } - /* Hfilter is null. Second pass only */ - else if (!xoffset && yoffset) - { - vp8_filter_block2d_second_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 16, dst_pitch, VFilter); - } - else - { - if (yoffset & 0x1) - { - vp8_filter_block2d_first_pass_16x16_armv6(src_ptr - src_pixels_per_line, FData + 1, src_pixels_per_line, 16, 19, HFilter); - vp8_filter4_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 16, VFilter); - } - else - { - vp8_filter_block2d_first_pass_16x16_armv6(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 16, 21, HFilter); - vp8_filter_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 16, VFilter); - } + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + DECLARE_ALIGNED_ARRAY(4, short, FData, 24 * 16); /* Temp data buffer used in filtering */ + + HFilter = vp8_sub_pel_filters[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters[yoffset]; /* 6 tap */ + + if (xoffset && !yoffset) { + vp8_filter_block2d_first_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 16, dst_pitch, HFilter); + } + /* Hfilter is null. Second pass only */ + else if (!xoffset && yoffset) { + vp8_filter_block2d_second_pass_only_armv6(src_ptr, dst_ptr, src_pixels_per_line, 16, dst_pitch, VFilter); + } else { + if (yoffset & 0x1) { + vp8_filter_block2d_first_pass_16x16_armv6(src_ptr - src_pixels_per_line, FData + 1, src_pixels_per_line, 16, 19, HFilter); + vp8_filter4_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 16, VFilter); + } else { + vp8_filter_block2d_first_pass_16x16_armv6(src_ptr - (2 * src_pixels_per_line), FData, src_pixels_per_line, 16, 21, HFilter); + vp8_filter_block2d_second_pass_armv6(FData + 2, dst_ptr, dst_pitch, 16, VFilter); } + } } #endif diff --git a/vp8/common/arm/loopfilter_arm.c b/vp8/common/arm/loopfilter_arm.c index c841d455a..b620d43d4 100644 --- a/vp8/common/arm/loopfilter_arm.c +++ b/vp8/common/arm/loopfilter_arm.c @@ -22,10 +22,10 @@ extern prototype_loopfilter(vp8_mbloop_filter_vertical_edge_armv6); #if HAVE_ARMV7 typedef void loopfilter_y_neon(unsigned char *src, int pitch, - unsigned char blimit, unsigned char limit, unsigned char thresh); + unsigned char blimit, unsigned char limit, unsigned char thresh); typedef void loopfilter_uv_neon(unsigned char *u, int pitch, - unsigned char blimit, unsigned char limit, unsigned char thresh, - unsigned char *v); + unsigned char blimit, unsigned char limit, unsigned char thresh, + unsigned char *v); extern loopfilter_y_neon vp8_loop_filter_horizontal_edge_y_neon; extern loopfilter_y_neon vp8_loop_filter_vertical_edge_y_neon; @@ -42,74 +42,68 @@ extern loopfilter_uv_neon vp8_mbloop_filter_vertical_edge_uv_neon; /*ARMV6 loopfilter functions*/ /* Horizontal MB filtering */ void vp8_loop_filter_mbh_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_mbloop_filter_horizontal_edge_armv6(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); + int y_stride, int uv_stride, loop_filter_info *lfi) { + vp8_mbloop_filter_horizontal_edge_armv6(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); - if (u_ptr) - vp8_mbloop_filter_horizontal_edge_armv6(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); + if (u_ptr) + vp8_mbloop_filter_horizontal_edge_armv6(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - if (v_ptr) - vp8_mbloop_filter_horizontal_edge_armv6(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); + if (v_ptr) + vp8_mbloop_filter_horizontal_edge_armv6(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); } /* Vertical MB Filtering */ void vp8_loop_filter_mbv_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_mbloop_filter_vertical_edge_armv6(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); + int y_stride, int uv_stride, loop_filter_info *lfi) { + vp8_mbloop_filter_vertical_edge_armv6(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); - if (u_ptr) - vp8_mbloop_filter_vertical_edge_armv6(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); + if (u_ptr) + vp8_mbloop_filter_vertical_edge_armv6(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - if (v_ptr) - vp8_mbloop_filter_vertical_edge_armv6(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); + if (v_ptr) + vp8_mbloop_filter_vertical_edge_armv6(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); } /* Horizontal B Filtering */ void vp8_loop_filter_bh_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_loop_filter_horizontal_edge_armv6(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_horizontal_edge_armv6(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_horizontal_edge_armv6(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + int y_stride, int uv_stride, loop_filter_info *lfi) { + vp8_loop_filter_horizontal_edge_armv6(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + vp8_loop_filter_horizontal_edge_armv6(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + vp8_loop_filter_horizontal_edge_armv6(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - if (u_ptr) - vp8_loop_filter_horizontal_edge_armv6(u_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); + if (u_ptr) + vp8_loop_filter_horizontal_edge_armv6(u_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); - if (v_ptr) - vp8_loop_filter_horizontal_edge_armv6(v_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); + if (v_ptr) + vp8_loop_filter_horizontal_edge_armv6(v_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); } void vp8_loop_filter_bhs_armv6(unsigned char *y_ptr, int y_stride, - const unsigned char *blimit) -{ - vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr + 4 * y_stride, y_stride, blimit); - vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr + 8 * y_stride, y_stride, blimit); - vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr + 12 * y_stride, y_stride, blimit); + const unsigned char *blimit) { + vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr + 4 * y_stride, y_stride, blimit); + vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr + 8 * y_stride, y_stride, blimit); + vp8_loop_filter_simple_horizontal_edge_armv6(y_ptr + 12 * y_stride, y_stride, blimit); } /* Vertical B Filtering */ void vp8_loop_filter_bv_armv6(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_loop_filter_vertical_edge_armv6(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_vertical_edge_armv6(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_vertical_edge_armv6(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + int y_stride, int uv_stride, loop_filter_info *lfi) { + vp8_loop_filter_vertical_edge_armv6(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + vp8_loop_filter_vertical_edge_armv6(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + vp8_loop_filter_vertical_edge_armv6(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - if (u_ptr) - vp8_loop_filter_vertical_edge_armv6(u_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); + if (u_ptr) + vp8_loop_filter_vertical_edge_armv6(u_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); - if (v_ptr) - vp8_loop_filter_vertical_edge_armv6(v_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); + if (v_ptr) + vp8_loop_filter_vertical_edge_armv6(v_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); } void vp8_loop_filter_bvs_armv6(unsigned char *y_ptr, int y_stride, - const unsigned char *blimit) -{ - vp8_loop_filter_simple_vertical_edge_armv6(y_ptr + 4, y_stride, blimit); - vp8_loop_filter_simple_vertical_edge_armv6(y_ptr + 8, y_stride, blimit); - vp8_loop_filter_simple_vertical_edge_armv6(y_ptr + 12, y_stride, blimit); + const unsigned char *blimit) { + vp8_loop_filter_simple_vertical_edge_armv6(y_ptr + 4, y_stride, blimit); + vp8_loop_filter_simple_vertical_edge_armv6(y_ptr + 8, y_stride, blimit); + vp8_loop_filter_simple_vertical_edge_armv6(y_ptr + 12, y_stride, blimit); } #endif @@ -117,60 +111,56 @@ void vp8_loop_filter_bvs_armv6(unsigned char *y_ptr, int y_stride, /* NEON loopfilter functions */ /* Horizontal MB filtering */ void vp8_loop_filter_mbh_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - unsigned char mblim = *lfi->mblim; - unsigned char lim = *lfi->lim; - unsigned char hev_thr = *lfi->hev_thr; - vp8_mbloop_filter_horizontal_edge_y_neon(y_ptr, y_stride, mblim, lim, hev_thr); - - if (u_ptr) - vp8_mbloop_filter_horizontal_edge_uv_neon(u_ptr, uv_stride, mblim, lim, hev_thr, v_ptr); + int y_stride, int uv_stride, loop_filter_info *lfi) { + unsigned char mblim = *lfi->mblim; + unsigned char lim = *lfi->lim; + unsigned char hev_thr = *lfi->hev_thr; + vp8_mbloop_filter_horizontal_edge_y_neon(y_ptr, y_stride, mblim, lim, hev_thr); + + if (u_ptr) + vp8_mbloop_filter_horizontal_edge_uv_neon(u_ptr, uv_stride, mblim, lim, hev_thr, v_ptr); } /* Vertical MB Filtering */ void vp8_loop_filter_mbv_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - unsigned char mblim = *lfi->mblim; - unsigned char lim = *lfi->lim; - unsigned char hev_thr = *lfi->hev_thr; + int y_stride, int uv_stride, loop_filter_info *lfi) { + unsigned char mblim = *lfi->mblim; + unsigned char lim = *lfi->lim; + unsigned char hev_thr = *lfi->hev_thr; - vp8_mbloop_filter_vertical_edge_y_neon(y_ptr, y_stride, mblim, lim, hev_thr); + vp8_mbloop_filter_vertical_edge_y_neon(y_ptr, y_stride, mblim, lim, hev_thr); - if (u_ptr) - vp8_mbloop_filter_vertical_edge_uv_neon(u_ptr, uv_stride, mblim, lim, hev_thr, v_ptr); + if (u_ptr) + vp8_mbloop_filter_vertical_edge_uv_neon(u_ptr, uv_stride, mblim, lim, hev_thr, v_ptr); } /* Horizontal B Filtering */ void vp8_loop_filter_bh_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - unsigned char blim = *lfi->blim; - unsigned char lim = *lfi->lim; - unsigned char hev_thr = *lfi->hev_thr; - - vp8_loop_filter_horizontal_edge_y_neon(y_ptr + 4 * y_stride, y_stride, blim, lim, hev_thr); - vp8_loop_filter_horizontal_edge_y_neon(y_ptr + 8 * y_stride, y_stride, blim, lim, hev_thr); - vp8_loop_filter_horizontal_edge_y_neon(y_ptr + 12 * y_stride, y_stride, blim, lim, hev_thr); - - if (u_ptr) - vp8_loop_filter_horizontal_edge_uv_neon(u_ptr + 4 * uv_stride, uv_stride, blim, lim, hev_thr, v_ptr + 4 * uv_stride); + int y_stride, int uv_stride, loop_filter_info *lfi) { + unsigned char blim = *lfi->blim; + unsigned char lim = *lfi->lim; + unsigned char hev_thr = *lfi->hev_thr; + + vp8_loop_filter_horizontal_edge_y_neon(y_ptr + 4 * y_stride, y_stride, blim, lim, hev_thr); + vp8_loop_filter_horizontal_edge_y_neon(y_ptr + 8 * y_stride, y_stride, blim, lim, hev_thr); + vp8_loop_filter_horizontal_edge_y_neon(y_ptr + 12 * y_stride, y_stride, blim, lim, hev_thr); + + if (u_ptr) + vp8_loop_filter_horizontal_edge_uv_neon(u_ptr + 4 * uv_stride, uv_stride, blim, lim, hev_thr, v_ptr + 4 * uv_stride); } /* Vertical B Filtering */ void vp8_loop_filter_bv_neon(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - unsigned char blim = *lfi->blim; - unsigned char lim = *lfi->lim; - unsigned char hev_thr = *lfi->hev_thr; - - vp8_loop_filter_vertical_edge_y_neon(y_ptr + 4, y_stride, blim, lim, hev_thr); - vp8_loop_filter_vertical_edge_y_neon(y_ptr + 8, y_stride, blim, lim, hev_thr); - vp8_loop_filter_vertical_edge_y_neon(y_ptr + 12, y_stride, blim, lim, hev_thr); - - if (u_ptr) - vp8_loop_filter_vertical_edge_uv_neon(u_ptr + 4, uv_stride, blim, lim, hev_thr, v_ptr + 4); + int y_stride, int uv_stride, loop_filter_info *lfi) { + unsigned char blim = *lfi->blim; + unsigned char lim = *lfi->lim; + unsigned char hev_thr = *lfi->hev_thr; + + vp8_loop_filter_vertical_edge_y_neon(y_ptr + 4, y_stride, blim, lim, hev_thr); + vp8_loop_filter_vertical_edge_y_neon(y_ptr + 8, y_stride, blim, lim, hev_thr); + vp8_loop_filter_vertical_edge_y_neon(y_ptr + 12, y_stride, blim, lim, hev_thr); + + if (u_ptr) + vp8_loop_filter_vertical_edge_uv_neon(u_ptr + 4, uv_stride, blim, lim, hev_thr, v_ptr + 4); } #endif diff --git a/vp8/common/arm/neon/recon_neon.c b/vp8/common/arm/neon/recon_neon.c index 09fd2a56f..a4f601642 100644 --- a/vp8/common/arm/neon/recon_neon.c +++ b/vp8/common/arm/neon/recon_neon.c @@ -15,15 +15,14 @@ extern void vp8_recon16x16mb_neon(unsigned char *pred_ptr, short *diff_ptr, unsigned char *dst_ptr, int ystride, unsigned char *udst_ptr, unsigned char *vdst_ptr); -void vp8_recon_mb_neon(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x) -{ - unsigned char *pred_ptr = &x->predictor[0]; - short *diff_ptr = &x->diff[0]; - unsigned char *dst_ptr = x->dst.y_buffer; - unsigned char *udst_ptr = x->dst.u_buffer; - unsigned char *vdst_ptr = x->dst.v_buffer; - int ystride = x->dst.y_stride; - /*int uv_stride = x->dst.uv_stride;*/ +void vp8_recon_mb_neon(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x) { + unsigned char *pred_ptr = &x->predictor[0]; + short *diff_ptr = &x->diff[0]; + unsigned char *dst_ptr = x->dst.y_buffer; + unsigned char *udst_ptr = x->dst.u_buffer; + unsigned char *vdst_ptr = x->dst.v_buffer; + int ystride = x->dst.y_stride; + /*int uv_stride = x->dst.uv_stride;*/ - vp8_recon16x16mb_neon(pred_ptr, diff_ptr, dst_ptr, ystride, udst_ptr, vdst_ptr); + vp8_recon16x16mb_neon(pred_ptr, diff_ptr, dst_ptr, ystride, udst_ptr, vdst_ptr); } diff --git a/vp8/common/arm/reconintra_arm.c b/vp8/common/arm/reconintra_arm.c index f8f4dca3e..814cabd20 100644 --- a/vp8/common/arm/reconintra_arm.c +++ b/vp8/common/arm/reconintra_arm.c @@ -17,46 +17,44 @@ #if HAVE_ARMV7 extern void vp8_build_intra_predictors_mby_neon_func( - unsigned char *y_buffer, - unsigned char *ypred_ptr, - int y_stride, - int mode, - int Up, - int Left); - -void vp8_build_intra_predictors_mby_neon(MACROBLOCKD *x) -{ - unsigned char *y_buffer = x->dst.y_buffer; - unsigned char *ypred_ptr = x->predictor; - int y_stride = x->dst.y_stride; - int mode = x->mode_info_context->mbmi.mode; - int Up = x->up_available; - int Left = x->left_available; - - vp8_build_intra_predictors_mby_neon_func(y_buffer, ypred_ptr, y_stride, mode, Up, Left); + unsigned char *y_buffer, + unsigned char *ypred_ptr, + int y_stride, + int mode, + int Up, + int Left); + +void vp8_build_intra_predictors_mby_neon(MACROBLOCKD *x) { + unsigned char *y_buffer = x->dst.y_buffer; + unsigned char *ypred_ptr = x->predictor; + int y_stride = x->dst.y_stride; + int mode = x->mode_info_context->mbmi.mode; + int Up = x->up_available; + int Left = x->left_available; + + vp8_build_intra_predictors_mby_neon_func(y_buffer, ypred_ptr, y_stride, mode, Up, Left); } #endif #if HAVE_ARMV7 extern void vp8_build_intra_predictors_mby_s_neon_func( - unsigned char *y_buffer, - unsigned char *ypred_ptr, - int y_stride, - int mode, - int Up, - int Left); - -void vp8_build_intra_predictors_mby_s_neon(MACROBLOCKD *x) -{ - unsigned char *y_buffer = x->dst.y_buffer; - unsigned char *ypred_ptr = x->predictor; - int y_stride = x->dst.y_stride; - int mode = x->mode_info_context->mbmi.mode; - int Up = x->up_available; - int Left = x->left_available; - - vp8_build_intra_predictors_mby_s_neon_func(y_buffer, ypred_ptr, y_stride, mode, Up, Left); + unsigned char *y_buffer, + unsigned char *ypred_ptr, + int y_stride, + int mode, + int Up, + int Left); + +void vp8_build_intra_predictors_mby_s_neon(MACROBLOCKD *x) { + unsigned char *y_buffer = x->dst.y_buffer; + unsigned char *ypred_ptr = x->predictor; + int y_stride = x->dst.y_stride; + int mode = x->mode_info_context->mbmi.mode; + int Up = x->up_available; + int Left = x->left_available; + + vp8_build_intra_predictors_mby_s_neon_func(y_buffer, ypred_ptr, y_stride, mode, Up, Left); } #endif diff --git a/vp8/common/blockd.c b/vp8/common/blockd.c index 60ef31217..2793995a0 100644 --- a/vp8/common/blockd.c +++ b/vp8/common/blockd.c @@ -13,21 +13,17 @@ #include "vpx_mem/vpx_mem.h" -const unsigned char vp8_block2left[25] = -{ - 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 +const unsigned char vp8_block2left[25] = { + 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 }; -const unsigned char vp8_block2above[25] = -{ - 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8 +const unsigned char vp8_block2above[25] = { + 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 4, 5, 6, 7, 6, 7, 8 }; -const unsigned char vp8_block2left_8x8[25] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 6, 6, 6, 6, 8 +const unsigned char vp8_block2left_8x8[25] = { + 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 6, 6, 6, 6, 8 }; -const unsigned char vp8_block2above_8x8[25] = -{ - 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, 2, 2, 2, 2, 4, 4, 4, 4, 6, 6, 6, 6, 8 +const unsigned char vp8_block2above_8x8[25] = { + 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, 2, 2, 2, 2, 4, 4, 4, 4, 6, 6, 6, 6, 8 }; diff --git a/vp8/common/blockd.h b/vp8/common/blockd.h index 26ac8262d..3c60b10ae 100644 --- a/vp8/common/blockd.h +++ b/vp8/common/blockd.h @@ -25,7 +25,7 @@ void vpx_log(const char *format, ...); #define TRUE 1 #define FALSE 0 -//#define MODE_STATS +// #define MODE_STATS /*#define DCPRED 1*/ #define DCPREDSIMTHRESH 0 @@ -47,9 +47,8 @@ void vpx_log(const char *format, ...); #define SEGMENT_DELTADATA 0 #define SEGMENT_ABSDATA 1 -typedef struct -{ - int r, c; +typedef struct { + int r, c; } POS; #define PLANE_TYPE_Y_NO_DC 0 @@ -59,12 +58,11 @@ typedef struct typedef char ENTROPY_CONTEXT; -typedef struct -{ - ENTROPY_CONTEXT y1[4]; - ENTROPY_CONTEXT u[2]; - ENTROPY_CONTEXT v[2]; - ENTROPY_CONTEXT y2; +typedef struct { + ENTROPY_CONTEXT y1[4]; + ENTROPY_CONTEXT u[2]; + ENTROPY_CONTEXT v[2]; + ENTROPY_CONTEXT y2; } ENTROPY_CONTEXT_PLANES; extern const unsigned char vp8_block2left[25]; @@ -73,60 +71,56 @@ extern const unsigned char vp8_block2left_8x8[25]; extern const unsigned char vp8_block2above_8x8[25]; #define VP8_COMBINEENTROPYCONTEXTS( Dest, A, B) \ - Dest = ((A)!=0) + ((B)!=0); + Dest = ((A)!=0) + ((B)!=0); -typedef enum -{ - KEY_FRAME = 0, - INTER_FRAME = 1 +typedef enum { + KEY_FRAME = 0, + INTER_FRAME = 1 } FRAME_TYPE; -typedef enum -{ - DC_PRED, /* average of above and left pixels */ - V_PRED, /* vertical prediction */ - H_PRED, /* horizontal prediction */ +typedef enum { + DC_PRED, /* average of above and left pixels */ + V_PRED, /* vertical prediction */ + H_PRED, /* horizontal prediction */ #if CONFIG_NEWINTRAMODES - D45_PRED, /* Directional 45 deg prediction [anti-clockwise from 0 deg hor] */ - D135_PRED, /* Directional 135 deg prediction [anti-clockwise from 0 deg hor] */ - D117_PRED, /* Directional 112 deg prediction [anti-clockwise from 0 deg hor] */ - D153_PRED, /* Directional 157 deg prediction [anti-clockwise from 0 deg hor] */ - D27_PRED, /* Directional 22 deg prediction [anti-clockwise from 0 deg hor] */ - D63_PRED, /* Directional 67 deg prediction [anti-clockwise from 0 deg hor] */ + D45_PRED, /* Directional 45 deg prediction [anti-clockwise from 0 deg hor] */ + D135_PRED, /* Directional 135 deg prediction [anti-clockwise from 0 deg hor] */ + D117_PRED, /* Directional 112 deg prediction [anti-clockwise from 0 deg hor] */ + D153_PRED, /* Directional 157 deg prediction [anti-clockwise from 0 deg hor] */ + D27_PRED, /* Directional 22 deg prediction [anti-clockwise from 0 deg hor] */ + D63_PRED, /* Directional 67 deg prediction [anti-clockwise from 0 deg hor] */ #endif - TM_PRED, /* Truemotion prediction */ - I8X8_PRED, /* 8x8 based prediction, each 8x8 has its own prediction mode */ - B_PRED, /* block based prediction, each block has its own prediction mode */ + TM_PRED, /* Truemotion prediction */ + I8X8_PRED, /* 8x8 based prediction, each 8x8 has its own prediction mode */ + B_PRED, /* block based prediction, each block has its own prediction mode */ - NEARESTMV, - NEARMV, - ZEROMV, - NEWMV, - SPLITMV, + NEARESTMV, + NEARMV, + ZEROMV, + NEWMV, + SPLITMV, - MB_MODE_COUNT + MB_MODE_COUNT } MB_PREDICTION_MODE; // Segment level features. -typedef enum -{ - SEG_LVL_ALT_Q = 0, // Use alternate Quantizer .... - SEG_LVL_ALT_LF = 1, // Use alternate loop filter value... - SEG_LVL_REF_FRAME = 2, // Optional Segment reference frame - SEG_LVL_MODE = 3, // Optional Segment mode - SEG_LVL_EOB = 4, // EOB end stop marker. - SEG_LVL_TRANSFORM = 5, // Block transform size. - SEG_LVL_MAX = 6 // Number of MB level features supported +typedef enum { + SEG_LVL_ALT_Q = 0, // Use alternate Quantizer .... + SEG_LVL_ALT_LF = 1, // Use alternate loop filter value... + SEG_LVL_REF_FRAME = 2, // Optional Segment reference frame + SEG_LVL_MODE = 3, // Optional Segment mode + SEG_LVL_EOB = 4, // EOB end stop marker. + SEG_LVL_TRANSFORM = 5, // Block transform size. + SEG_LVL_MAX = 6 // Number of MB level features supported } SEG_LVL_FEATURES; // Segment level features. -typedef enum -{ - TX_4X4 = 0, // 4x4 dct transform - TX_8X8 = 1, // 8x8 dct transform +typedef enum { + TX_4X4 = 0, // 4x4 dct transform + TX_8X8 = 1, // 8x8 dct transform - TX_SIZE_MAX = 2 // Number of differnt transforms avaialble + TX_SIZE_MAX = 2 // Number of differnt transforms avaialble } TX_SIZE; @@ -136,28 +130,27 @@ typedef enum #define VP8_MVREFS (1 + SPLITMV - NEARESTMV) -typedef enum -{ - B_DC_PRED, /* average of above and left pixels */ - B_TM_PRED, +typedef enum { + B_DC_PRED, /* average of above and left pixels */ + B_TM_PRED, - B_VE_PRED, /* vertical prediction */ - B_HE_PRED, /* horizontal prediction */ + B_VE_PRED, /* vertical prediction */ + B_HE_PRED, /* horizontal prediction */ - B_LD_PRED, - B_RD_PRED, + B_LD_PRED, + B_RD_PRED, - B_VR_PRED, - B_VL_PRED, - B_HD_PRED, - B_HU_PRED, + B_VR_PRED, + B_VL_PRED, + B_HD_PRED, + B_HU_PRED, - LEFT4X4, - ABOVE4X4, - ZERO4X4, - NEW4X4, + LEFT4X4, + ABOVE4X4, + ZERO4X4, + NEW4X4, - B_MODE_COUNT + B_MODE_COUNT } B_PREDICTION_MODE; #define VP8_BINTRAMODES (B_HU_PRED + 1) /* 10 */ @@ -167,196 +160,190 @@ typedef enum modes for the Y blocks to the left and above us; for interframes, there is a single probability table. */ -union b_mode_info -{ - struct { - B_PREDICTION_MODE first; +union b_mode_info { + struct { + B_PREDICTION_MODE first; #if CONFIG_COMP_INTRA_PRED - B_PREDICTION_MODE second; + B_PREDICTION_MODE second; #endif - } as_mode; - struct { - int_mv first; - int_mv second; - } as_mv; + } as_mode; + struct { + int_mv first; + int_mv second; + } as_mv; }; -typedef enum -{ - INTRA_FRAME = 0, - LAST_FRAME = 1, - GOLDEN_FRAME = 2, - ALTREF_FRAME = 3, - MAX_REF_FRAMES = 4 +typedef enum { + INTRA_FRAME = 0, + LAST_FRAME = 1, + GOLDEN_FRAME = 2, + ALTREF_FRAME = 3, + MAX_REF_FRAMES = 4 } MV_REFERENCE_FRAME; -typedef struct -{ - MB_PREDICTION_MODE mode, uv_mode; +typedef struct { + MB_PREDICTION_MODE mode, uv_mode; #if CONFIG_COMP_INTRA_PRED - MB_PREDICTION_MODE second_mode, second_uv_mode; + MB_PREDICTION_MODE second_mode, second_uv_mode; #endif - MV_REFERENCE_FRAME ref_frame, second_ref_frame; - TX_SIZE txfm_size; - int_mv mv, second_mv; - unsigned char partitioning; - unsigned char mb_skip_coeff; /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */ - unsigned char need_to_clamp_mvs; - unsigned char need_to_clamp_secondmv; - unsigned char segment_id; /* Which set of segmentation parameters should be used for this MB */ - - // Flags used for prediction status of various bistream signals - unsigned char seg_id_predicted; - unsigned char ref_predicted; - - // Indicates if the mb is part of the image (1) vs border (0) - // This can be useful in determining whether the MB provides - // a valid predictor - unsigned char mb_in_image; + MV_REFERENCE_FRAME ref_frame, second_ref_frame; + TX_SIZE txfm_size; + int_mv mv, second_mv; + unsigned char partitioning; + unsigned char mb_skip_coeff; /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */ + unsigned char need_to_clamp_mvs; + unsigned char need_to_clamp_secondmv; + unsigned char segment_id; /* Which set of segmentation parameters should be used for this MB */ + + // Flags used for prediction status of various bistream signals + unsigned char seg_id_predicted; + unsigned char ref_predicted; + + // Indicates if the mb is part of the image (1) vs border (0) + // This can be useful in determining whether the MB provides + // a valid predictor + unsigned char mb_in_image; #if CONFIG_PRED_FILTER - // Flag to turn prediction signal filter on(1)/off(0 ) at the MB level - unsigned int pred_filter_enabled; + // Flag to turn prediction signal filter on(1)/off(0 ) at the MB level + unsigned int pred_filter_enabled; #endif } MB_MODE_INFO; -typedef struct -{ - MB_MODE_INFO mbmi; - union b_mode_info bmi[16]; +typedef struct { + MB_MODE_INFO mbmi; + union b_mode_info bmi[16]; } MODE_INFO; -typedef struct -{ - short *qcoeff; - short *dqcoeff; - unsigned char *predictor; - short *diff; - short *dequant; +typedef struct { + short *qcoeff; + short *dqcoeff; + unsigned char *predictor; + short *diff; + short *dequant; - /* 16 Y blocks, 4 U blocks, 4 V blocks each with 16 entries */ - unsigned char **base_pre; - unsigned char **base_second_pre; - int pre; - int pre_stride; + /* 16 Y blocks, 4 U blocks, 4 V blocks each with 16 entries */ + unsigned char **base_pre; + unsigned char **base_second_pre; + int pre; + int pre_stride; - unsigned char **base_dst; - int dst; - int dst_stride; + unsigned char **base_dst; + int dst; + int dst_stride; - int eob; + int eob; - union b_mode_info bmi; + union b_mode_info bmi; } BLOCKD; -typedef struct MacroBlockD -{ - DECLARE_ALIGNED(16, short, diff[400]); /* from idct diff */ - DECLARE_ALIGNED(16, unsigned char, predictor[384]); - DECLARE_ALIGNED(16, short, qcoeff[400]); - DECLARE_ALIGNED(16, short, dqcoeff[400]); - DECLARE_ALIGNED(16, char, eobs[25]); +typedef struct MacroBlockD { + DECLARE_ALIGNED(16, short, diff[400]); /* from idct diff */ + DECLARE_ALIGNED(16, unsigned char, predictor[384]); + DECLARE_ALIGNED(16, short, qcoeff[400]); + DECLARE_ALIGNED(16, short, dqcoeff[400]); + DECLARE_ALIGNED(16, char, eobs[25]); - /* 16 Y blocks, 4 U, 4 V, 1 DC 2nd order block, each with 16 entries. */ - BLOCKD block[25]; - int fullpixel_mask; + /* 16 Y blocks, 4 U, 4 V, 1 DC 2nd order block, each with 16 entries. */ + BLOCKD block[25]; + int fullpixel_mask; - YV12_BUFFER_CONFIG pre; /* Filtered copy of previous frame reconstruction */ - struct { - uint8_t *y_buffer, *u_buffer, *v_buffer; - } second_pre; - YV12_BUFFER_CONFIG dst; + YV12_BUFFER_CONFIG pre; /* Filtered copy of previous frame reconstruction */ + struct { + uint8_t *y_buffer, *u_buffer, *v_buffer; + } second_pre; + YV12_BUFFER_CONFIG dst; - MODE_INFO *prev_mode_info_context; - MODE_INFO *mode_info_context; - int mode_info_stride; + MODE_INFO *prev_mode_info_context; + MODE_INFO *mode_info_context; + int mode_info_stride; - FRAME_TYPE frame_type; + FRAME_TYPE frame_type; - int up_available; - int left_available; + int up_available; + int left_available; - /* Y,U,V,Y2 */ - ENTROPY_CONTEXT_PLANES *above_context; - ENTROPY_CONTEXT_PLANES *left_context; + /* Y,U,V,Y2 */ + ENTROPY_CONTEXT_PLANES *above_context; + ENTROPY_CONTEXT_PLANES *left_context; - /* 0 indicates segmentation at MB level is not enabled. Otherwise the individual bits indicate which features are active. */ - unsigned char segmentation_enabled; + /* 0 indicates segmentation at MB level is not enabled. Otherwise the individual bits indicate which features are active. */ + unsigned char segmentation_enabled; - /* 0 (do not update) 1 (update) the macroblock segmentation map. */ - unsigned char update_mb_segmentation_map; + /* 0 (do not update) 1 (update) the macroblock segmentation map. */ + unsigned char update_mb_segmentation_map; - /* 0 (do not update) 1 (update) the macroblock segmentation feature data. */ - unsigned char update_mb_segmentation_data; + /* 0 (do not update) 1 (update) the macroblock segmentation feature data. */ + unsigned char update_mb_segmentation_data; - /* 0 (do not update) 1 (update) the macroblock segmentation feature data. */ - unsigned char mb_segment_abs_delta; + /* 0 (do not update) 1 (update) the macroblock segmentation feature data. */ + unsigned char mb_segment_abs_delta; - /* Per frame flags that define which MB level features (such as quantizer or loop filter level) */ - /* are enabled and when enabled the proabilities used to decode the per MB flags in MB_MODE_INFO */ + /* Per frame flags that define which MB level features (such as quantizer or loop filter level) */ + /* are enabled and when enabled the proabilities used to decode the per MB flags in MB_MODE_INFO */ - // Probability Tree used to code Segment number - vp8_prob mb_segment_tree_probs[MB_FEATURE_TREE_PROBS]; + // Probability Tree used to code Segment number + vp8_prob mb_segment_tree_probs[MB_FEATURE_TREE_PROBS]; - // Segment features - signed char segment_feature_data[MAX_MB_SEGMENTS][SEG_LVL_MAX]; - unsigned int segment_feature_mask[MAX_MB_SEGMENTS]; + // Segment features + signed char segment_feature_data[MAX_MB_SEGMENTS][SEG_LVL_MAX]; + unsigned int segment_feature_mask[MAX_MB_SEGMENTS]; #if CONFIG_FEATUREUPDATES - // keep around the last set so we can figure out what updates... - unsigned int old_segment_feature_mask[MAX_MB_SEGMENTS]; - signed char old_segment_feature_data[MAX_MB_SEGMENTS][SEG_LVL_MAX]; + // keep around the last set so we can figure out what updates... + unsigned int old_segment_feature_mask[MAX_MB_SEGMENTS]; + signed char old_segment_feature_data[MAX_MB_SEGMENTS][SEG_LVL_MAX]; #endif - /* mode_based Loop filter adjustment */ - unsigned char mode_ref_lf_delta_enabled; - unsigned char mode_ref_lf_delta_update; - - /* Delta values have the range +/- MAX_LOOP_FILTER */ - signed char last_ref_lf_deltas[MAX_REF_LF_DELTAS]; /* 0 = Intra, Last, GF, ARF */ - signed char ref_lf_deltas[MAX_REF_LF_DELTAS]; /* 0 = Intra, Last, GF, ARF */ - signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS]; /* 0 = BPRED, ZERO_MV, MV, SPLIT */ - signed char mode_lf_deltas[MAX_MODE_LF_DELTAS]; /* 0 = BPRED, ZERO_MV, MV, SPLIT */ - - /* Distance of MB away from frame edges */ - int mb_to_left_edge; - int mb_to_right_edge; - int mb_to_top_edge; - int mb_to_bottom_edge; - - unsigned int frames_since_golden; - unsigned int frames_till_alt_ref_frame; - vp8_subpix_fn_t subpixel_predict; - vp8_subpix_fn_t subpixel_predict8x4; - vp8_subpix_fn_t subpixel_predict8x8; - vp8_subpix_fn_t subpixel_predict16x16; - vp8_subpix_fn_t subpixel_predict_avg; - vp8_subpix_fn_t subpixel_predict_avg8x4; - vp8_subpix_fn_t subpixel_predict_avg8x8; - vp8_subpix_fn_t subpixel_predict_avg16x16; + /* mode_based Loop filter adjustment */ + unsigned char mode_ref_lf_delta_enabled; + unsigned char mode_ref_lf_delta_update; + + /* Delta values have the range +/- MAX_LOOP_FILTER */ + signed char last_ref_lf_deltas[MAX_REF_LF_DELTAS]; /* 0 = Intra, Last, GF, ARF */ + signed char ref_lf_deltas[MAX_REF_LF_DELTAS]; /* 0 = Intra, Last, GF, ARF */ + signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS]; /* 0 = BPRED, ZERO_MV, MV, SPLIT */ + signed char mode_lf_deltas[MAX_MODE_LF_DELTAS]; /* 0 = BPRED, ZERO_MV, MV, SPLIT */ + + /* Distance of MB away from frame edges */ + int mb_to_left_edge; + int mb_to_right_edge; + int mb_to_top_edge; + int mb_to_bottom_edge; + + unsigned int frames_since_golden; + unsigned int frames_till_alt_ref_frame; + vp8_subpix_fn_t subpixel_predict; + vp8_subpix_fn_t subpixel_predict8x4; + vp8_subpix_fn_t subpixel_predict8x8; + vp8_subpix_fn_t subpixel_predict16x16; + vp8_subpix_fn_t subpixel_predict_avg; + vp8_subpix_fn_t subpixel_predict_avg8x4; + vp8_subpix_fn_t subpixel_predict_avg8x8; + vp8_subpix_fn_t subpixel_predict_avg16x16; #if CONFIG_HIGH_PRECISION_MV - int allow_high_precision_mv; + int allow_high_precision_mv; #endif /* CONFIG_HIGH_PRECISION_MV */ - void *current_bc; + void *current_bc; - int corrupted; + int corrupted; #if ARCH_X86 || ARCH_X86_64 - /* This is an intermediate buffer currently used in sub-pixel motion search - * to keep a copy of the reference area. This buffer can be used for other - * purpose. - */ - DECLARE_ALIGNED(32, unsigned char, y_buf[22*32]); + /* This is an intermediate buffer currently used in sub-pixel motion search + * to keep a copy of the reference area. This buffer can be used for other + * purpose. + */ + DECLARE_ALIGNED(32, unsigned char, y_buf[22 * 32]); #endif #if CONFIG_RUNTIME_CPU_DETECT - struct VP8_COMMON_RTCD *rtcd; + struct VP8_COMMON_RTCD *rtcd; #endif - int mb_index; // Index of the MB in the SB (0..3) + int mb_index; // Index of the MB in the SB (0..3) } MACROBLOCKD; @@ -364,20 +351,17 @@ typedef struct MacroBlockD extern void vp8_build_block_doffsets(MACROBLOCKD *x); extern void vp8_setup_block_dptrs(MACROBLOCKD *x); -static void update_blockd_bmi(MACROBLOCKD *xd) -{ - int i; - int is_4x4; - is_4x4 = (xd->mode_info_context->mbmi.mode == SPLITMV) || - (xd->mode_info_context->mbmi.mode == I8X8_PRED) || - (xd->mode_info_context->mbmi.mode == B_PRED); - - if (is_4x4) - { - for (i = 0; i < 16; i++) - { - xd->block[i].bmi = xd->mode_info_context->bmi[i]; - } +static void update_blockd_bmi(MACROBLOCKD *xd) { + int i; + int is_4x4; + is_4x4 = (xd->mode_info_context->mbmi.mode == SPLITMV) || + (xd->mode_info_context->mbmi.mode == I8X8_PRED) || + (xd->mode_info_context->mbmi.mode == B_PRED); + + if (is_4x4) { + for (i = 0; i < 16; i++) { + xd->block[i].bmi = xd->mode_info_context->bmi[i]; } + } } #endif /* __INC_BLOCKD_H */ diff --git a/vp8/common/common.h b/vp8/common/common.h index 999f79f2f..c6e6fcb7c 100644 --- a/vp8/common/common.h +++ b/vp8/common/common.h @@ -23,16 +23,16 @@ /* Only need this for fixed-size arrays, for structs just assign. */ #define vp8_copy( Dest, Src) { \ - assert( sizeof( Dest) == sizeof( Src)); \ - vpx_memcpy( Dest, Src, sizeof( Src)); \ - } + assert( sizeof( Dest) == sizeof( Src)); \ + vpx_memcpy( Dest, Src, sizeof( Src)); \ + } /* Use this for variably-sized arrays. */ #define vp8_copy_array( Dest, Src, N) { \ - assert( sizeof( *Dest) == sizeof( *Src)); \ - vpx_memcpy( Dest, Src, N * sizeof( *Src)); \ - } + assert( sizeof( *Dest) == sizeof( *Src)); \ + vpx_memcpy( Dest, Src, N * sizeof( *Src)); \ + } #define vp8_zero( Dest) vpx_memset( &Dest, 0, sizeof( Dest)); diff --git a/vp8/common/context.c b/vp8/common/context.c index 99e95d30f..27ad6a42d 100644 --- a/vp8/common/context.c +++ b/vp8/common/context.c @@ -16,384 +16,382 @@ #if 0 int Contexts[vp8_coef_counter_dimen]; -const int default_contexts[vp8_coef_counter_dimen] = -{ - { - // Block Type ( 0 ) - { - // Coeff Band ( 0 ) - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - }, - { - // Coeff Band ( 1 ) - {30190, 26544, 225, 24, 4, 0, 0, 0, 0, 0, 0, 4171593,}, - {26846, 25157, 1241, 130, 26, 6, 1, 0, 0, 0, 0, 149987,}, - {10484, 9538, 1006, 160, 36, 18, 0, 0, 0, 0, 0, 15104,}, - }, - { - // Coeff Band ( 2 ) - {25842, 40456, 1126, 83, 11, 2, 0, 0, 0, 0, 0, 0,}, - {9338, 8010, 512, 73, 7, 3, 2, 0, 0, 0, 0, 43294,}, - {1047, 751, 149, 31, 13, 6, 1, 0, 0, 0, 0, 879,}, - }, - { - // Coeff Band ( 3 ) - {26136, 9826, 252, 13, 0, 0, 0, 0, 0, 0, 0, 0,}, - {8134, 5574, 191, 14, 2, 0, 0, 0, 0, 0, 0, 35302,}, - { 605, 677, 116, 9, 1, 0, 0, 0, 0, 0, 0, 611,}, - }, - { - // Coeff Band ( 4 ) - {10263, 15463, 283, 17, 0, 0, 0, 0, 0, 0, 0, 0,}, - {2773, 2191, 128, 9, 2, 2, 0, 0, 0, 0, 0, 10073,}, - { 134, 125, 32, 4, 0, 2, 0, 0, 0, 0, 0, 50,}, - }, - { - // Coeff Band ( 5 ) - {10483, 2663, 23, 1, 0, 0, 0, 0, 0, 0, 0, 0,}, - {2137, 1251, 27, 1, 1, 0, 0, 0, 0, 0, 0, 14362,}, - { 116, 156, 14, 2, 1, 0, 0, 0, 0, 0, 0, 190,}, - }, - { - // Coeff Band ( 6 ) - {40977, 27614, 412, 28, 0, 0, 0, 0, 0, 0, 0, 0,}, - {6113, 5213, 261, 22, 3, 0, 0, 0, 0, 0, 0, 26164,}, - { 382, 312, 50, 14, 2, 0, 0, 0, 0, 0, 0, 345,}, - }, - { - // Coeff Band ( 7 ) - { 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 319,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8,}, - }, - }, - { - // Block Type ( 1 ) - { - // Coeff Band ( 0 ) - {3268, 19382, 1043, 250, 93, 82, 49, 26, 17, 8, 25, 82289,}, - {8758, 32110, 5436, 1832, 827, 668, 420, 153, 24, 0, 3, 52914,}, - {9337, 23725, 8487, 3954, 2107, 1836, 1069, 399, 59, 0, 0, 18620,}, - }, - { - // Coeff Band ( 1 ) - {12419, 8420, 452, 62, 9, 1, 0, 0, 0, 0, 0, 0,}, - {11715, 8705, 693, 92, 15, 7, 2, 0, 0, 0, 0, 53988,}, - {7603, 8585, 2306, 778, 270, 145, 39, 5, 0, 0, 0, 9136,}, - }, - { - // Coeff Band ( 2 ) - {15938, 14335, 1207, 184, 55, 13, 4, 1, 0, 0, 0, 0,}, - {7415, 6829, 1138, 244, 71, 26, 7, 0, 0, 0, 0, 9980,}, - {1580, 1824, 655, 241, 89, 46, 10, 2, 0, 0, 0, 429,}, - }, - { - // Coeff Band ( 3 ) - {19453, 5260, 201, 19, 0, 0, 0, 0, 0, 0, 0, 0,}, - {9173, 3758, 213, 22, 1, 1, 0, 0, 0, 0, 0, 9820,}, - {1689, 1277, 276, 51, 17, 4, 0, 0, 0, 0, 0, 679,}, - }, - { - // Coeff Band ( 4 ) - {12076, 10667, 620, 85, 19, 9, 5, 0, 0, 0, 0, 0,}, - {4665, 3625, 423, 55, 19, 9, 0, 0, 0, 0, 0, 5127,}, - { 415, 440, 143, 34, 20, 7, 2, 0, 0, 0, 0, 101,}, - }, - { - // Coeff Band ( 5 ) - {12183, 4846, 115, 11, 1, 0, 0, 0, 0, 0, 0, 0,}, - {4226, 3149, 177, 21, 2, 0, 0, 0, 0, 0, 0, 7157,}, - { 375, 621, 189, 51, 11, 4, 1, 0, 0, 0, 0, 198,}, - }, - { - // Coeff Band ( 6 ) - {61658, 37743, 1203, 94, 10, 3, 0, 0, 0, 0, 0, 0,}, - {15514, 11563, 903, 111, 14, 5, 0, 0, 0, 0, 0, 25195,}, - { 929, 1077, 291, 78, 14, 7, 1, 0, 0, 0, 0, 507,}, - }, - { - // Coeff Band ( 7 ) - { 0, 990, 15, 3, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 412, 13, 0, 0, 0, 0, 0, 0, 0, 0, 1641,}, - { 0, 18, 7, 1, 0, 0, 0, 0, 0, 0, 0, 30,}, - }, - }, - { - // Block Type ( 2 ) - { - // Coeff Band ( 0 ) - { 953, 24519, 628, 120, 28, 12, 4, 0, 0, 0, 0, 2248798,}, - {1525, 25654, 2647, 617, 239, 143, 42, 5, 0, 0, 0, 66837,}, - {1180, 11011, 3001, 1237, 532, 448, 239, 54, 5, 0, 0, 7122,}, - }, - { - // Coeff Band ( 1 ) - {1356, 2220, 67, 10, 4, 1, 0, 0, 0, 0, 0, 0,}, - {1450, 2544, 102, 18, 4, 3, 0, 0, 0, 0, 0, 57063,}, - {1182, 2110, 470, 130, 41, 21, 0, 0, 0, 0, 0, 6047,}, - }, - { - // Coeff Band ( 2 ) - { 370, 3378, 200, 30, 5, 4, 1, 0, 0, 0, 0, 0,}, - { 293, 1006, 131, 29, 11, 0, 0, 0, 0, 0, 0, 5404,}, - { 114, 387, 98, 23, 4, 8, 1, 0, 0, 0, 0, 236,}, - }, - { - // Coeff Band ( 3 ) - { 579, 194, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 395, 213, 5, 1, 0, 0, 0, 0, 0, 0, 0, 4157,}, - { 119, 122, 4, 0, 0, 0, 0, 0, 0, 0, 0, 300,}, - }, - { - // Coeff Band ( 4 ) - { 38, 557, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 21, 114, 12, 1, 0, 0, 0, 0, 0, 0, 0, 427,}, - { 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7,}, - }, - { - // Coeff Band ( 5 ) - { 52, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 18, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 652,}, - { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30,}, - }, - { - // Coeff Band ( 6 ) - { 640, 569, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 25, 77, 2, 0, 0, 0, 0, 0, 0, 0, 0, 517,}, - { 4, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,}, - }, - { - // Coeff Band ( 7 ) - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - }, - }, - { - // Block Type ( 3 ) - { - // Coeff Band ( 0 ) - {2506, 20161, 2707, 767, 261, 178, 107, 30, 14, 3, 0, 100694,}, - {8806, 36478, 8817, 3268, 1280, 850, 401, 114, 42, 0, 0, 58572,}, - {11003, 27214, 11798, 5716, 2482, 2072, 1048, 175, 32, 0, 0, 19284,}, - }, - { - // Coeff Band ( 1 ) - {9738, 11313, 959, 205, 70, 18, 11, 1, 0, 0, 0, 0,}, - {12628, 15085, 1507, 273, 52, 19, 9, 0, 0, 0, 0, 54280,}, - {10701, 15846, 5561, 1926, 813, 570, 249, 36, 0, 0, 0, 6460,}, - }, - { - // Coeff Band ( 2 ) - {6781, 22539, 2784, 634, 182, 123, 20, 4, 0, 0, 0, 0,}, - {6263, 11544, 2649, 790, 259, 168, 27, 5, 0, 0, 0, 20539,}, - {3109, 4075, 2031, 896, 457, 386, 158, 29, 0, 0, 0, 1138,}, - }, - { - // Coeff Band ( 3 ) - {11515, 4079, 465, 73, 5, 14, 2, 0, 0, 0, 0, 0,}, - {9361, 5834, 650, 96, 24, 8, 4, 0, 0, 0, 0, 22181,}, - {4343, 3974, 1360, 415, 132, 96, 14, 1, 0, 0, 0, 1267,}, - }, - { - // Coeff Band ( 4 ) - {4787, 9297, 823, 168, 44, 12, 4, 0, 0, 0, 0, 0,}, - {3619, 4472, 719, 198, 60, 31, 3, 0, 0, 0, 0, 8401,}, - {1157, 1175, 483, 182, 88, 31, 8, 0, 0, 0, 0, 268,}, - }, - { - // Coeff Band ( 5 ) - {8299, 1226, 32, 5, 1, 0, 0, 0, 0, 0, 0, 0,}, - {3502, 1568, 57, 4, 1, 1, 0, 0, 0, 0, 0, 9811,}, - {1055, 1070, 166, 29, 6, 1, 0, 0, 0, 0, 0, 527,}, - }, - { - // Coeff Band ( 6 ) - {27414, 27927, 1989, 347, 69, 26, 0, 0, 0, 0, 0, 0,}, - {5876, 10074, 1574, 341, 91, 24, 4, 0, 0, 0, 0, 21954,}, - {1571, 2171, 778, 324, 124, 65, 16, 0, 0, 0, 0, 979,}, - }, - { - // Coeff Band ( 7 ) - { 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}, - { 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 459,}, - { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13,}, - }, +const int default_contexts[vp8_coef_counter_dimen] = { + { + // Block Type ( 0 ) + { + // Coeff Band ( 0 ) + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + }, + { + // Coeff Band ( 1 ) + {30190, 26544, 225, 24, 4, 0, 0, 0, 0, 0, 0, 4171593}, + {26846, 25157, 1241, 130, 26, 6, 1, 0, 0, 0, 0, 149987}, + {10484, 9538, 1006, 160, 36, 18, 0, 0, 0, 0, 0, 15104}, + }, + { + // Coeff Band ( 2 ) + {25842, 40456, 1126, 83, 11, 2, 0, 0, 0, 0, 0, 0}, + {9338, 8010, 512, 73, 7, 3, 2, 0, 0, 0, 0, 43294}, + {1047, 751, 149, 31, 13, 6, 1, 0, 0, 0, 0, 879}, + }, + { + // Coeff Band ( 3 ) + {26136, 9826, 252, 13, 0, 0, 0, 0, 0, 0, 0, 0}, + {8134, 5574, 191, 14, 2, 0, 0, 0, 0, 0, 0, 35302}, + { 605, 677, 116, 9, 1, 0, 0, 0, 0, 0, 0, 611}, + }, + { + // Coeff Band ( 4 ) + {10263, 15463, 283, 17, 0, 0, 0, 0, 0, 0, 0, 0}, + {2773, 2191, 128, 9, 2, 2, 0, 0, 0, 0, 0, 10073}, + { 134, 125, 32, 4, 0, 2, 0, 0, 0, 0, 0, 50}, + }, + { + // Coeff Band ( 5 ) + {10483, 2663, 23, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + {2137, 1251, 27, 1, 1, 0, 0, 0, 0, 0, 0, 14362}, + { 116, 156, 14, 2, 1, 0, 0, 0, 0, 0, 0, 190}, + }, + { + // Coeff Band ( 6 ) + {40977, 27614, 412, 28, 0, 0, 0, 0, 0, 0, 0, 0}, + {6113, 5213, 261, 22, 3, 0, 0, 0, 0, 0, 0, 26164}, + { 382, 312, 50, 14, 2, 0, 0, 0, 0, 0, 0, 345}, + }, + { + // Coeff Band ( 7 ) + { 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 319}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8}, + }, + }, + { + // Block Type ( 1 ) + { + // Coeff Band ( 0 ) + {3268, 19382, 1043, 250, 93, 82, 49, 26, 17, 8, 25, 82289}, + {8758, 32110, 5436, 1832, 827, 668, 420, 153, 24, 0, 3, 52914}, + {9337, 23725, 8487, 3954, 2107, 1836, 1069, 399, 59, 0, 0, 18620}, + }, + { + // Coeff Band ( 1 ) + {12419, 8420, 452, 62, 9, 1, 0, 0, 0, 0, 0, 0}, + {11715, 8705, 693, 92, 15, 7, 2, 0, 0, 0, 0, 53988}, + {7603, 8585, 2306, 778, 270, 145, 39, 5, 0, 0, 0, 9136}, + }, + { + // Coeff Band ( 2 ) + {15938, 14335, 1207, 184, 55, 13, 4, 1, 0, 0, 0, 0}, + {7415, 6829, 1138, 244, 71, 26, 7, 0, 0, 0, 0, 9980}, + {1580, 1824, 655, 241, 89, 46, 10, 2, 0, 0, 0, 429}, + }, + { + // Coeff Band ( 3 ) + {19453, 5260, 201, 19, 0, 0, 0, 0, 0, 0, 0, 0}, + {9173, 3758, 213, 22, 1, 1, 0, 0, 0, 0, 0, 9820}, + {1689, 1277, 276, 51, 17, 4, 0, 0, 0, 0, 0, 679}, + }, + { + // Coeff Band ( 4 ) + {12076, 10667, 620, 85, 19, 9, 5, 0, 0, 0, 0, 0}, + {4665, 3625, 423, 55, 19, 9, 0, 0, 0, 0, 0, 5127}, + { 415, 440, 143, 34, 20, 7, 2, 0, 0, 0, 0, 101}, + }, + { + // Coeff Band ( 5 ) + {12183, 4846, 115, 11, 1, 0, 0, 0, 0, 0, 0, 0}, + {4226, 3149, 177, 21, 2, 0, 0, 0, 0, 0, 0, 7157}, + { 375, 621, 189, 51, 11, 4, 1, 0, 0, 0, 0, 198}, + }, + { + // Coeff Band ( 6 ) + {61658, 37743, 1203, 94, 10, 3, 0, 0, 0, 0, 0, 0}, + {15514, 11563, 903, 111, 14, 5, 0, 0, 0, 0, 0, 25195}, + { 929, 1077, 291, 78, 14, 7, 1, 0, 0, 0, 0, 507}, + }, + { + // Coeff Band ( 7 ) + { 0, 990, 15, 3, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 412, 13, 0, 0, 0, 0, 0, 0, 0, 0, 1641}, + { 0, 18, 7, 1, 0, 0, 0, 0, 0, 0, 0, 30}, + }, + }, + { + // Block Type ( 2 ) + { + // Coeff Band ( 0 ) + { 953, 24519, 628, 120, 28, 12, 4, 0, 0, 0, 0, 2248798}, + {1525, 25654, 2647, 617, 239, 143, 42, 5, 0, 0, 0, 66837}, + {1180, 11011, 3001, 1237, 532, 448, 239, 54, 5, 0, 0, 7122}, + }, + { + // Coeff Band ( 1 ) + {1356, 2220, 67, 10, 4, 1, 0, 0, 0, 0, 0, 0}, + {1450, 2544, 102, 18, 4, 3, 0, 0, 0, 0, 0, 57063}, + {1182, 2110, 470, 130, 41, 21, 0, 0, 0, 0, 0, 6047}, + }, + { + // Coeff Band ( 2 ) + { 370, 3378, 200, 30, 5, 4, 1, 0, 0, 0, 0, 0}, + { 293, 1006, 131, 29, 11, 0, 0, 0, 0, 0, 0, 5404}, + { 114, 387, 98, 23, 4, 8, 1, 0, 0, 0, 0, 236}, + }, + { + // Coeff Band ( 3 ) + { 579, 194, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 395, 213, 5, 1, 0, 0, 0, 0, 0, 0, 0, 4157}, + { 119, 122, 4, 0, 0, 0, 0, 0, 0, 0, 0, 300}, + }, + { + // Coeff Band ( 4 ) + { 38, 557, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 21, 114, 12, 1, 0, 0, 0, 0, 0, 0, 0, 427}, + { 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7}, + }, + { + // Coeff Band ( 5 ) + { 52, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 18, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 652}, + { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30}, + }, + { + // Coeff Band ( 6 ) + { 640, 569, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 25, 77, 2, 0, 0, 0, 0, 0, 0, 0, 0, 517}, + { 4, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3}, + }, + { + // Coeff Band ( 7 ) + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + }, + }, + { + // Block Type ( 3 ) + { + // Coeff Band ( 0 ) + {2506, 20161, 2707, 767, 261, 178, 107, 30, 14, 3, 0, 100694}, + {8806, 36478, 8817, 3268, 1280, 850, 401, 114, 42, 0, 0, 58572}, + {11003, 27214, 11798, 5716, 2482, 2072, 1048, 175, 32, 0, 0, 19284}, + }, + { + // Coeff Band ( 1 ) + {9738, 11313, 959, 205, 70, 18, 11, 1, 0, 0, 0, 0}, + {12628, 15085, 1507, 273, 52, 19, 9, 0, 0, 0, 0, 54280}, + {10701, 15846, 5561, 1926, 813, 570, 249, 36, 0, 0, 0, 6460}, + }, + { + // Coeff Band ( 2 ) + {6781, 22539, 2784, 634, 182, 123, 20, 4, 0, 0, 0, 0}, + {6263, 11544, 2649, 790, 259, 168, 27, 5, 0, 0, 0, 20539}, + {3109, 4075, 2031, 896, 457, 386, 158, 29, 0, 0, 0, 1138}, + }, + { + // Coeff Band ( 3 ) + {11515, 4079, 465, 73, 5, 14, 2, 0, 0, 0, 0, 0}, + {9361, 5834, 650, 96, 24, 8, 4, 0, 0, 0, 0, 22181}, + {4343, 3974, 1360, 415, 132, 96, 14, 1, 0, 0, 0, 1267}, + }, + { + // Coeff Band ( 4 ) + {4787, 9297, 823, 168, 44, 12, 4, 0, 0, 0, 0, 0}, + {3619, 4472, 719, 198, 60, 31, 3, 0, 0, 0, 0, 8401}, + {1157, 1175, 483, 182, 88, 31, 8, 0, 0, 0, 0, 268}, + }, + { + // Coeff Band ( 5 ) + {8299, 1226, 32, 5, 1, 0, 0, 0, 0, 0, 0, 0}, + {3502, 1568, 57, 4, 1, 1, 0, 0, 0, 0, 0, 9811}, + {1055, 1070, 166, 29, 6, 1, 0, 0, 0, 0, 0, 527}, + }, + { + // Coeff Band ( 6 ) + {27414, 27927, 1989, 347, 69, 26, 0, 0, 0, 0, 0, 0}, + {5876, 10074, 1574, 341, 91, 24, 4, 0, 0, 0, 0, 21954}, + {1571, 2171, 778, 324, 124, 65, 16, 0, 0, 0, 0, 979}, + }, + { + // Coeff Band ( 7 ) + { 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 459}, + { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13}, }, + }, }; -//Update probabilities for the nodes in the token entropy tree. -const vp8_prob tree_update_probs[vp8_coef_tree_dimen] = -{ - { - { - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255, }, - {249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255, }, - {234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255, }, - {250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255, }, - {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - }, - { - { - {217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255, }, - {234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255, }, - }, - { - {255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255, }, - {250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - }, - { - { - {186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255, }, - {234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255, }, - {251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255, }, - }, - { - {255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - }, - { - { - {248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255, }, - {248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255, }, - {246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255, }, - {252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255, }, - {248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255, }, - {253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255, }, - {252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255, }, - {250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, - { - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, - }, +// Update probabilities for the nodes in the token entropy tree. +const vp8_prob tree_update_probs[vp8_coef_tree_dimen] = { + { + { + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255, }, + {249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255, }, + {234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255, }, + {250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255, }, + {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + }, + { + { + {217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255, }, + {234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255, }, + }, + { + {255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255, }, + {250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + }, + { + { + {186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255, }, + {234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255, }, + {251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255, }, + }, + { + {255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + }, + { + { + {248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255, }, + {248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255, }, + {246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255, }, + {252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255, }, + {248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255, }, + {253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255, }, + {252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255, }, + {250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + }, + { + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, + {255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, }, }, + }, }; #endif diff --git a/vp8/common/debugmodes.c b/vp8/common/debugmodes.c index 9bbf1235d..32e947bdc 100644 --- a/vp8/common/debugmodes.c +++ b/vp8/common/debugmodes.c @@ -13,152 +13,137 @@ #include "blockd.h" -void vp8_print_modes_and_motion_vectors(MODE_INFO *mi, int rows, int cols, int frame) -{ +void vp8_print_modes_and_motion_vectors(MODE_INFO *mi, int rows, int cols, int frame) { - int mb_row; - int mb_col; - int mb_index = 0; - FILE *mvs = fopen("mvs.stt", "a"); + int mb_row; + int mb_col; + int mb_index = 0; + FILE *mvs = fopen("mvs.stt", "a"); - /* print out the macroblock Y modes */ - mb_index = 0; - fprintf(mvs, "Mb Modes for Frame %d\n", frame); + /* print out the macroblock Y modes */ + mb_index = 0; + fprintf(mvs, "Mb Modes for Frame %d\n", frame); - for (mb_row = 0; mb_row < rows; mb_row++) - { - for (mb_col = 0; mb_col < cols; mb_col++) - { + for (mb_row = 0; mb_row < rows; mb_row++) { + for (mb_col = 0; mb_col < cols; mb_col++) { - fprintf(mvs, "%2d ", mi[mb_index].mbmi.mode); + fprintf(mvs, "%2d ", mi[mb_index].mbmi.mode); - mb_index++; - } - - fprintf(mvs, "\n"); - mb_index++; + mb_index++; } fprintf(mvs, "\n"); + mb_index++; + } - mb_index = 0; - fprintf(mvs, "Mb mv ref for Frame %d\n", frame); + fprintf(mvs, "\n"); - for (mb_row = 0; mb_row < rows; mb_row++) - { - for (mb_col = 0; mb_col < cols; mb_col++) - { + mb_index = 0; + fprintf(mvs, "Mb mv ref for Frame %d\n", frame); - fprintf(mvs, "%2d ", mi[mb_index].mbmi.ref_frame); + for (mb_row = 0; mb_row < rows; mb_row++) { + for (mb_col = 0; mb_col < cols; mb_col++) { - mb_index++; - } + fprintf(mvs, "%2d ", mi[mb_index].mbmi.ref_frame); - fprintf(mvs, "\n"); - mb_index++; + mb_index++; } fprintf(mvs, "\n"); + mb_index++; + } - /* print out the macroblock UV modes */ - mb_index = 0; - fprintf(mvs, "UV Modes for Frame %d\n", frame); + fprintf(mvs, "\n"); - for (mb_row = 0; mb_row < rows; mb_row++) - { - for (mb_col = 0; mb_col < cols; mb_col++) - { + /* print out the macroblock UV modes */ + mb_index = 0; + fprintf(mvs, "UV Modes for Frame %d\n", frame); - fprintf(mvs, "%2d ", mi[mb_index].mbmi.uv_mode); + for (mb_row = 0; mb_row < rows; mb_row++) { + for (mb_col = 0; mb_col < cols; mb_col++) { - mb_index++; - } + fprintf(mvs, "%2d ", mi[mb_index].mbmi.uv_mode); - mb_index++; - fprintf(mvs, "\n"); + mb_index++; } + mb_index++; fprintf(mvs, "\n"); + } + + fprintf(mvs, "\n"); + + /* print out the block modes */ + mb_index = 0; + fprintf(mvs, "Mbs for Frame %d\n", frame); + { + int b_row; + + for (b_row = 0; b_row < 4 * rows; b_row++) { + int b_col; + int bindex; + + for (b_col = 0; b_col < 4 * cols; b_col++) { + mb_index = (b_row >> 2) * (cols + 1) + (b_col >> 2); + bindex = (b_row & 3) * 4 + (b_col & 3); - /* print out the block modes */ - mb_index = 0; - fprintf(mvs, "Mbs for Frame %d\n", frame); - { - int b_row; - - for (b_row = 0; b_row < 4 * rows; b_row++) - { - int b_col; - int bindex; - - for (b_col = 0; b_col < 4 * cols; b_col++) - { - mb_index = (b_row >> 2) * (cols + 1) + (b_col >> 2); - bindex = (b_row & 3) * 4 + (b_col & 3); - - if (mi[mb_index].mbmi.mode == B_PRED) - { - fprintf(mvs, "%2d ", mi[mb_index].bmi[bindex].as_mode.first); + if (mi[mb_index].mbmi.mode == B_PRED) { + fprintf(mvs, "%2d ", mi[mb_index].bmi[bindex].as_mode.first); #if CONFIG_COMP_INTRA_PRED - fprintf(mvs, "%2d ", mi[mb_index].bmi[bindex].as_mode.second); + fprintf(mvs, "%2d ", mi[mb_index].bmi[bindex].as_mode.second); #endif - } - else - fprintf(mvs, "xx "); + } else + fprintf(mvs, "xx "); - } + } - fprintf(mvs, "\n"); - } + fprintf(mvs, "\n"); } - fprintf(mvs, "\n"); - - /* print out the macroblock mvs */ - mb_index = 0; - fprintf(mvs, "MVs for Frame %d\n", frame); + } + fprintf(mvs, "\n"); - for (mb_row = 0; mb_row < rows; mb_row++) - { - for (mb_col = 0; mb_col < cols; mb_col++) - { - fprintf(mvs, "%5d:%-5d", mi[mb_index].mbmi.mv.as_mv.row / 2, mi[mb_index].mbmi.mv.as_mv.col / 2); + /* print out the macroblock mvs */ + mb_index = 0; + fprintf(mvs, "MVs for Frame %d\n", frame); - mb_index++; - } + for (mb_row = 0; mb_row < rows; mb_row++) { + for (mb_col = 0; mb_col < cols; mb_col++) { + fprintf(mvs, "%5d:%-5d", mi[mb_index].mbmi.mv.as_mv.row / 2, mi[mb_index].mbmi.mv.as_mv.col / 2); - mb_index++; - fprintf(mvs, "\n"); + mb_index++; } + mb_index++; fprintf(mvs, "\n"); + } + fprintf(mvs, "\n"); - /* print out the block modes */ - mb_index = 0; - fprintf(mvs, "MVs for Frame %d\n", frame); - { - int b_row; - for (b_row = 0; b_row < 4 * rows; b_row++) - { - int b_col; - int bindex; + /* print out the block modes */ + mb_index = 0; + fprintf(mvs, "MVs for Frame %d\n", frame); + { + int b_row; - for (b_col = 0; b_col < 4 * cols; b_col++) - { - mb_index = (b_row >> 2) * (cols + 1) + (b_col >> 2); - bindex = (b_row & 3) * 4 + (b_col & 3); - fprintf(mvs, "%3d:%-3d ", - mi[mb_index].bmi[bindex].as_mv.first.as_mv.row, - mi[mb_index].bmi[bindex].as_mv.first.as_mv.col); + for (b_row = 0; b_row < 4 * rows; b_row++) { + int b_col; + int bindex; - } + for (b_col = 0; b_col < 4 * cols; b_col++) { + mb_index = (b_row >> 2) * (cols + 1) + (b_col >> 2); + bindex = (b_row & 3) * 4 + (b_col & 3); + fprintf(mvs, "%3d:%-3d ", + mi[mb_index].bmi[bindex].as_mv.first.as_mv.row, + mi[mb_index].bmi[bindex].as_mv.first.as_mv.col); - fprintf(mvs, "\n"); - } + } + + fprintf(mvs, "\n"); } - fprintf(mvs, "\n"); + } + fprintf(mvs, "\n"); - fclose(mvs); + fclose(mvs); } diff --git a/vp8/common/default_coef_probs.h b/vp8/common/default_coef_probs.h index 380f2c0c0..10248cc6f 100644 --- a/vp8/common/default_coef_probs.h +++ b/vp8/common/default_coef_probs.h @@ -13,489 +13,550 @@ static const vp8_prob default_coef_probs [BLOCK_TYPES] - [COEF_BANDS] - [PREV_COEF_CONTEXTS] - [ENTROPY_NODES] = -{ - { /* Block Type ( 0 ) */ - { /* Coeff Band ( 0 )*/ - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, +[COEF_BANDS] +[PREV_COEF_CONTEXTS] +[ENTROPY_NODES] = { + { + /* Block Type ( 0 ) */ + { + /* Coeff Band ( 0 )*/ + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, #else - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 } #endif - }, - { /* Coeff Band ( 1 )*/ - { 253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128 }, - { 189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128 }, -#if CONFIG_EXPANDED_COEF_CONTEXT - { 106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128 }, - { 90, 116, 227, 252, 214, 209, 255, 255, 128, 128, 128 }, -#else - { 106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128 }, -#endif - }, - { /* Coeff Band ( 2 )*/ - { 1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128 }, - { 181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128 }, + }, + { + /* Coeff Band ( 1 )*/ + { 253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128 }, + { 189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128 }, - { 64, 128, 202, 247, 198, 180, 255, 219, 128, 128, 128 }, + { 106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128 }, + { 90, 116, 227, 252, 214, 209, 255, 255, 128, 128, 128 }, #else - { 78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128 }, + { 106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 3 )*/ - { 1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128 }, - { 184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128 }, + }, + { + /* Coeff Band ( 2 )*/ + { 1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128 }, + { 181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128 }, - { 64, 100, 216, 255, 236, 230, 128, 128, 128, 128, 128 }, + { 78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128 }, + { 64, 128, 202, 247, 198, 180, 255, 219, 128, 128, 128 }, #else - { 77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128 }, + { 78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 4 )*/ - { 1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128 }, - { 170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128 }, + }, + { + /* Coeff Band ( 3 )*/ + { 1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128 }, + { 184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128 }, - { 28, 110, 196, 243, 228, 255, 255, 255, 128, 128, 128 }, + { 77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128 }, + { 64, 100, 216, 255, 236, 230, 128, 128, 128, 128, 128 }, #else - { 37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128 }, + { 77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 5 )*/ - { 1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128 }, - { 207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128 }, + }, + { + /* Coeff Band ( 4 )*/ + { 1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128 }, + { 170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128 }, - { 90, 90, 231, 255, 211, 171, 128, 128, 128, 128, 128 }, + { 37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128 }, + { 28, 110, 196, 243, 228, 255, 255, 255, 128, 128, 128 }, #else - { 102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128 }, + { 37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 6 )*/ - { 1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128 }, - { 177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128 }, + }, + { + /* Coeff Band ( 5 )*/ + { 1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128 }, + { 207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128 }, - { 64, 120, 211, 255, 194, 224, 128, 128, 128, 128, 128 }, + { 102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128 }, + { 90, 90, 231, 255, 211, 171, 128, 128, 128, 128, 128 }, #else - { 80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128 }, + { 102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 7 )*/ - { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + { + /* Coeff Band ( 6 )*/ + { 1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128 }, + { 177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128 }, + { 64, 120, 211, 255, 194, 224, 128, 128, 128, 128, 128 }, #else - { 255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128 }, #endif - } }, - { /* Block Type ( 1 ) */ - { /* Coeff Band ( 0 )*/ - { 198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62 }, - { 131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1 }, + { + /* Coeff Band ( 7 )*/ + { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128 }, - { 48, 32, 146, 208, 149, 167, 221, 162, 255, 223, 128 }, + { 255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, #else - { 68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128 }, + { 255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 1 )*/ - { 1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128 }, - { 184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128 }, + } + }, + { + /* Block Type ( 1 ) */ + { + /* Coeff Band ( 0 )*/ + { 198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62 }, + { 131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128 }, - { 66, 90, 181, 242, 176, 190, 249, 202, 255, 255, 128 }, + { 68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128 }, + { 48, 32, 146, 208, 149, 167, 221, 162, 255, 223, 128 }, #else - { 81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128 }, + { 68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128 }, #endif - }, - { /* Coeff Band ( 2 )*/ - { 1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128 }, - { 99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128 }, + }, + { + /* Coeff Band ( 1 )*/ + { 1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128 }, + { 184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128 }, - { 18, 80, 163, 242, 170, 187, 247, 210, 255, 255, 128 }, + { 81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128 }, + { 66, 90, 181, 242, 176, 190, 249, 202, 255, 255, 128 }, #else - { 23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128 }, + { 81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128 }, #endif - }, - { /* Coeff Band ( 3 )*/ - { 1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128 }, - { 109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128 }, + }, + { + /* Coeff Band ( 2 )*/ + { 1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128 }, + { 99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128 }, - { 36, 120, 201, 253, 205, 192, 255, 255, 128, 128, 128 }, + { 23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128 }, + { 18, 80, 163, 242, 170, 187, 247, 210, 255, 255, 128 }, #else - { 44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128 }, + { 23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128 }, #endif - }, - { /* Coeff Band ( 4 )*/ - { 1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128 }, - { 94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128 }, + }, + { + /* Coeff Band ( 3 )*/ + { 1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128 }, + { 109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128 }, - { 18, 90, 174, 245, 186, 161, 255, 199, 128, 128, 128 }, + { 44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128 }, + { 36, 120, 201, 253, 205, 192, 255, 255, 128, 128, 128 }, #else - { 22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128 }, + { 44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 5 )*/ - { 1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128 }, - { 124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128 }, + }, + { + /* Coeff Band ( 4 )*/ + { 1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128 }, + { 94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128 }, - { 28, 70, 181, 251, 193, 211, 255, 205, 128, 128, 128 }, + { 22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128 }, + { 18, 90, 174, 245, 186, 161, 255, 199, 128, 128, 128 }, #else - { 35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128 }, + { 22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 6 )*/ - { 1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128 }, - { 121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128 }, + }, + { + /* Coeff Band ( 5 )*/ + { 1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128 }, + { 124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128 }, - { 40, 90, 188, 251, 195, 217, 255, 224, 128, 128, 128 }, + { 35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128 }, + { 28, 70, 181, 251, 193, 211, 255, 205, 128, 128, 128 }, #else - { 45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128 }, + { 35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 7 )*/ - { 1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128 }, - { 203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, + }, + { + /* Coeff Band ( 6 )*/ + { 1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128 }, + { 121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128 }, - { 137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128 }, + { 45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128 }, + { 40, 90, 188, 251, 195, 217, 255, 224, 128, 128, 128 }, #else - { 137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128 }, + { 45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128 }, #endif - } }, - { /* Block Type ( 2 ) */ - { /* Coeff Band ( 0 )*/ - { 253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128 }, - { 175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128 }, + { + /* Coeff Band ( 7 )*/ + { 1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128 }, + { 203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128 }, - { 64, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128 }, + { 137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128 }, + { 137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128 }, #else - { 73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128 }, + { 137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 1 )*/ - { 1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128 }, - { 239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128 }, + } + }, + { + /* Block Type ( 2 ) */ + { + /* Coeff Band ( 0 )*/ + { 253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128 }, + { 175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128 }, - { 140, 70, 195, 248, 188, 195, 255, 255, 128, 128, 128 }, + { 73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128 }, + { 64, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128 }, #else - { 155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128 }, + { 73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128 }, #endif - }, - { /* Coeff Band ( 2 )*/ - { 1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128 }, - { 201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128 }, + }, + { + /* Coeff Band ( 1 )*/ + { 1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128 }, + { 239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128 }, - { 60, 40, 190, 239, 201, 218, 255, 228, 128, 128, 128 }, + { 155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128 }, + { 140, 70, 195, 248, 188, 195, 255, 255, 128, 128, 128 }, #else - { 69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128 }, + { 155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 3 )*/ - { 1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128 }, + }, + { + /* Coeff Band ( 2 )*/ + { 1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128 }, + { 201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 132, 118, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, + { 69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128 }, + { 60, 40, 190, 239, 201, 218, 255, 228, 128, 128, 128 }, #else - { 141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, + { 69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 4 )*/ - { 1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128 }, + }, + { + /* Coeff Band ( 3 )*/ + { 1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128 }, + { 223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, + { 132, 118, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, #else - { 149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 5 )*/ - { 1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + { + /* Coeff Band ( 4 )*/ + { 1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, + { 190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, #else - { 240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 6 )*/ - { 1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128 }, - { 213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128 }, + }, + { + /* Coeff Band ( 5 )*/ + { 1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 48, 85, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, #else - { 55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 7 )*/ - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + { + /* Coeff Band ( 6 )*/ + { 1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128 }, + { 213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 48, 85, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, #else - { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, #endif - } }, - { /* Block Type ( 3 ) */ - { /* Coeff Band ( 0 )*/ - { 202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255 }, - { 126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128 }, + { + /* Coeff Band ( 7 )*/ + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 63, 48, 138, 219, 151, 178, 240, 170, 255, 216, 128 }, - { 54, 40, 138, 219, 151, 178, 240, 170, 255, 216, 128 }, + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, #else - { 61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128 }, + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 1 )*/ - { 1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128 }, - { 166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128 }, + } + }, + { + /* Block Type ( 3 ) */ + { + /* Coeff Band ( 0 )*/ + { 202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255 }, + { 126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 44, 84, 162, 232, 172, 180, 245, 178, 255, 255, 128 }, - { 32, 70, 162, 232, 172, 180, 245, 178, 255, 255, 128 }, + { 63, 48, 138, 219, 151, 178, 240, 170, 255, 216, 128 }, + { 54, 40, 138, 219, 151, 178, 240, 170, 255, 216, 128 }, #else - { 39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128 }, + { 61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128 }, #endif - }, - { /* Coeff Band ( 2 )*/ - { 1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128 }, - { 124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128 }, + }, + { + /* Coeff Band ( 1 )*/ + { 1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128 }, + { 166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128 }, - { 24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128 }, + { 44, 84, 162, 232, 172, 180, 245, 178, 255, 255, 128 }, + { 32, 70, 162, 232, 172, 180, 245, 178, 255, 255, 128 }, #else - { 24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128 }, + { 39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128 }, #endif - }, - { /* Coeff Band ( 3 )*/ - { 1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128 }, - { 149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128 }, + }, + { + /* Coeff Band ( 2 )*/ + { 1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128 }, + { 124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128 }, - { 26, 104, 170, 242, 183, 194, 254, 223, 255, 255, 128 }, + { 24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128 }, + { 24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128 }, #else - { 28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128 }, + { 24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128 }, #endif - }, - { /* Coeff Band ( 4 )*/ - { 1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128 }, - { 123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128 }, + }, + { + /* Coeff Band ( 3 )*/ + { 1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128 }, + { 149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128 }, - { 20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128 }, + { 28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128 }, + { 26, 104, 170, 242, 183, 194, 254, 223, 255, 255, 128 }, #else - { 20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128 }, + { 28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128 }, #endif - }, - { /* Coeff Band ( 5 )*/ - { 1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128 }, - { 168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128 }, + }, + { + /* Coeff Band ( 4 )*/ + { 1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128 }, + { 123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128 }, - { 47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128 }, + { 20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128 }, + { 20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128 }, #else - { 47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128 }, + { 20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 6 )*/ - { 1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128 }, - { 141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128 }, + }, + { + /* Coeff Band ( 5 )*/ + { 1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128 }, + { 168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128 }, - { 42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128 }, + { 47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128 }, + { 47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128 }, #else - { 42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128 }, + { 47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128 }, #endif - }, - { /* Coeff Band ( 7 )*/ - { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + { + /* Coeff Band ( 6 )*/ + { 1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128 }, + { 141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128 }, #if CONFIG_EXPANDED_COEF_CONTEXT - { 238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, - { 238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128 }, + { 42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128 }, #else - { 238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128 }, +#endif + }, + { + /* Coeff Band ( 7 )*/ + { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, +#if CONFIG_EXPANDED_COEF_CONTEXT + { 238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, +#else + { 238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, #endif - } } + } }; #if CONFIG_EXPANDED_COEF_CONTEXT static const vp8_prob vp8_default_coef_probs_8x8[BLOCK_TYPES_8X8] - [COEF_BANDS] - [PREV_COEF_CONTEXTS] - [ENTROPY_NODES] = -{ - { /* block Type 0 */ - { /* Coeff Band 0 */ +[COEF_BANDS] +[PREV_COEF_CONTEXTS] +[ENTROPY_NODES] = { + { + /* block Type 0 */ + { + /* Coeff Band 0 */ { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128} }, - { /* Coeff Band 1 */ + { + /* Coeff Band 1 */ { 60, 140, 195, 255, 212, 214, 128, 128, 128, 128, 128}, { 75, 221, 231, 255, 203, 255, 128, 128, 128, 128, 128}, { 9, 212, 196, 251, 197, 207, 255, 185, 128, 128, 128}, { 9, 212, 196, 251, 197, 207, 255, 185, 128, 128, 128} }, - { /* Coeff Band 2 */ + { + /* Coeff Band 2 */ { 1, 227, 226, 255, 215, 215, 128, 128, 128, 128, 128}, { 5, 163, 209, 255, 212, 212, 255, 255, 128, 128, 128}, { 1, 133, 203, 255, 210, 220, 255, 255, 128, 128, 128}, { 1, 133, 203, 255, 210, 220, 255, 255, 128, 128, 128} }, - { /* Coeff Band 3 */ + { + /* Coeff Band 3 */ { 1, 226, 225, 255, 228, 236, 128, 128, 128, 128, 128}, { 6, 163, 208, 255, 224, 234, 255, 255, 128, 128, 128}, { 1, 122, 196, 253, 212, 248, 255, 255, 128, 128, 128}, { 1, 122, 196, 253, 212, 248, 255, 255, 128, 128, 128} }, - { /* Coeff Band 4 */ + { + /* Coeff Band 4 */ { 1, 222, 197, 254, 193, 216, 255, 236, 128, 128, 128}, { 7, 140, 163, 251, 195, 211, 255, 238, 128, 128, 128}, { 1, 91, 152, 249, 181, 197, 255, 239, 128, 128, 128}, { 1, 91, 152, 249, 181, 197, 255, 239, 128, 128, 128} }, - { /* Coeff Band 5 */ + { + /* Coeff Band 5 */ { 1, 226, 218, 255, 216, 241, 255, 255, 128, 128, 128}, { 6, 154, 191, 255, 218, 240, 255, 255, 128, 128, 128}, { 1, 110, 171, 252, 191, 204, 255, 236, 128, 128, 128}, { 1, 110, 171, 252, 191, 204, 255, 236, 128, 128, 128} }, - { /* Coeff Band 6 */ + { + /* Coeff Band 6 */ { 1, 221, 217, 255, 208, 217, 255, 232, 128, 128, 128}, { 11, 155, 189, 254, 203, 211, 255, 249, 128, 128, 128}, { 1, 110, 171, 252, 191, 204, 255, 236, 128, 128, 128}, { 1, 110, 171, 252, 191, 204, 255, 236, 128, 128, 128} }, - { /* Coeff Band 7 */ + { + /* Coeff Band 7 */ { 1, 207, 235, 255, 232, 240, 128, 128, 128, 128, 128}, { 58, 161, 216, 255, 229, 235, 255, 255, 128, 128, 128}, { 8, 133, 204, 255, 219, 231, 255, 255, 128, 128, 128}, { 8, 133, 204, 255, 219, 231, 255, 255, 128, 128, 128} } }, - { /* block Type 1 */ - { /* Coeff Band 0 */ + { + /* block Type 1 */ + { + /* Coeff Band 0 */ { 134, 152, 233, 224, 234, 52, 255, 166, 128, 128, 128}, { 97, 132, 185, 234, 186, 189, 197, 171, 255, 212, 128}, { 84, 110, 185, 237, 182, 182, 145, 145, 255, 255, 128} }, - { /* Coeff Band 1 */ + { + /* Coeff Band 1 */ { 1, 124, 213, 247, 192, 212, 255, 255, 128, 128, 128}, { 88, 111, 178, 254, 189, 211, 255, 255, 128, 128, 128}, { 12, 59, 129, 236, 150, 179, 239, 195, 255, 255, 128}, { 12, 59, 129, 236, 150, 179, 239, 195, 255, 255, 128} }, - { /* Coeff Band 2 */ + { + /* Coeff Band 2 */ { 1, 102, 225, 255, 210, 240, 128, 128, 128, 128, 128}, { 110, 78, 195, 254, 200, 191, 255, 255, 128, 128, 128}, { 37, 63, 177, 255, 194, 195, 128, 128, 128, 128, 128}, { 37, 63, 177, 255, 194, 195, 128, 128, 128, 128, 128} }, - { /* Coeff Band 3 */ + { + /* Coeff Band 3 */ { 1, 1, 229, 255, 202, 224, 128, 128, 128, 128, 128}, { 150, 1, 192, 255, 206, 226, 128, 128, 128, 128, 128}, { 75, 1, 138, 255, 172, 228, 128, 128, 128, 128, 128}, { 75, 1, 138, 255, 172, 228, 128, 128, 128, 128, 128} }, - { /* Coeff Band 4 */ + { + /* Coeff Band 4 */ { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128} }, - { /* Coeff Band 5 */ + { + /* Coeff Band 5 */ { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128} }, - { /* Coeff Band 6 */ + { + /* Coeff Band 6 */ { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128} }, - { /* Coeff Band 7 */ + { + /* Coeff Band 7 */ { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}, { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128} } }, - { /* block Type 2 */ - { /* Coeff Band 0 */ + { + /* block Type 2 */ + { + /* Coeff Band 0 */ { 11, 181, 226, 199, 183, 255, 255, 255, 128, 128, 128}, { 2, 147, 185, 248, 163, 180, 255, 236, 128, 128, 128}, { 1, 123, 157, 238, 154, 176, 255, 226, 255, 255, 128}, { 1, 123, 157, 238, 154, 176, 255, 226, 255, 255, 128} }, - { /* Coeff Band 1 */ + { + /* Coeff Band 1 */ { 1, 150, 191, 246, 174, 188, 255, 235, 128, 128, 128}, { 1, 125, 166, 245, 165, 185, 255, 234, 128, 128, 128}, { 1, 79, 125, 240, 148, 179, 255, 234, 255, 255, 128}, { 1, 79, 125, 240, 148, 179, 255, 234, 255, 255, 128} }, - { /* Coeff Band 2 */ + { + /* Coeff Band 2 */ { 1, 146, 184, 242, 167, 183, 255, 230, 255, 255, 128}, { 1, 119, 160, 239, 156, 178, 255, 231, 255, 255, 128}, { 1, 75, 115, 234, 142, 173, 255, 225, 255, 255, 128}, { 1, 75, 115, 234, 142, 173, 255, 225, 255, 255, 128} }, - { /* Coeff Band 3 */ + { + /* Coeff Band 3 */ { 1, 150, 188, 244, 169, 183, 255, 233, 255, 255, 128}, { 1, 123, 162, 243, 161, 180, 255, 233, 128, 128, 128}, { 1, 76, 120, 238, 148, 178, 255, 230, 255, 255, 128}, { 1, 76, 120, 238, 148, 178, 255, 230, 255, 255, 128} }, - { /* Coeff Band 4 */ + { + /* Coeff Band 4 */ { 1, 163, 202, 252, 188, 204, 255, 248, 128, 128, 128}, { 1, 136, 180, 251, 181, 201, 255, 246, 128, 128, 128}, { 1, 92, 146, 249, 170, 197, 255, 245, 128, 128, 128}, { 1, 92, 146, 249, 170, 197, 255, 245, 128, 128, 128} }, - { /* Coeff Band 5 */ + { + /* Coeff Band 5 */ { 1, 156, 195, 249, 179, 193, 255, 241, 255, 255, 128}, { 1, 128, 169, 248, 171, 192, 255, 242, 255, 255, 128}, { 1, 84, 132, 245, 158, 187, 255, 240, 255, 255, 128}, { 1, 84, 132, 245, 158, 187, 255, 240, 255, 255, 128} }, - { /* Coeff Band 6 */ + { + /* Coeff Band 6 */ { 1, 36, 71, 251, 192, 201, 255, 243, 255, 255, 128}, { 1, 49, 185, 250, 184, 199, 255, 242, 128, 128, 128}, { 1, 95, 147, 247, 168, 190, 255, 239, 255, 255, 128}, { 1, 95, 147, 247, 168, 190, 255, 239, 255, 255, 128} }, - { /* Coeff Band 7 */ + { + /* Coeff Band 7 */ { 1, 19, 98, 255, 218, 222, 255, 255, 128, 128, 128}, { 36, 50, 210, 255, 212, 221, 255, 255, 128, 128, 128}, { 6, 117, 180, 254, 199, 216, 255, 251, 128, 128, 128}, @@ -506,131 +567,157 @@ vp8_default_coef_probs_8x8[BLOCK_TYPES_8X8] #else static const vp8_prob vp8_default_coef_probs_8x8[BLOCK_TYPES_8X8] - [COEF_BANDS] - [PREV_COEF_CONTEXTS] - [ENTROPY_NODES] = -{ - { /* block Type 0 */ - { /* Coeff Band 0 */ +[COEF_BANDS] +[PREV_COEF_CONTEXTS] +[ENTROPY_NODES] = { + { + /* block Type 0 */ + { + /* Coeff Band 0 */ { 128, 191, 223, 239, 247, 251, 253, 254, 254, 254, 254}, { 128, 191, 223, 239, 247, 251, 253, 254, 254, 254, 254}, { 128, 191, 223, 239, 247, 251, 253, 254, 254, 254, 254} }, - { /* Coeff Band 1 */ + { + /* Coeff Band 1 */ { 60, 140, 195, 255, 212, 214, 234, 244, 249, 252, 253}, { 75, 221, 231, 255, 203, 255, 255, 255, 255, 255, 255}, { 9, 212, 196, 251, 197, 207, 255, 185, 220, 237, 246} }, - { /* Coeff Band 2 */ + { + /* Coeff Band 2 */ { 1, 227, 226, 255, 215, 215, 235, 245, 250, 252, 253}, { 5, 163, 209, 255, 212, 212, 255, 255, 255, 255, 255}, { 1, 133, 203, 255, 210, 220, 255, 255, 255, 255, 255} }, - { /* Coeff Band 3 */ + { + /* Coeff Band 3 */ { 1, 226, 225, 255, 228, 237, 246, 250, 252, 253, 254}, { 6, 163, 208, 255, 224, 234, 255, 255, 255, 255, 255}, { 1, 122, 196, 253, 212, 248, 255, 255, 255, 255, 255} }, - { /* Coeff Band 4 */ + { + /* Coeff Band 4 */ { 1, 222, 198, 254, 193, 216, 255, 242, 248, 251, 253}, { 7, 140, 163, 251, 195, 211, 255, 238, 246, 250, 252}, { 1, 91, 152, 249, 181, 197, 255, 239, 247, 251, 253} }, - { /* Coeff Band 5 */ + { + /* Coeff Band 5 */ { 1, 226, 218, 255, 216, 242, 255, 255, 255, 255, 255}, { 6, 154, 191, 255, 218, 240, 255, 255, 255, 255, 255}, { 1, 111, 184, 255, 210, 225, 255, 255, 255, 255, 255} }, - { /* Coeff Band 6 */ + { + /* Coeff Band 6 */ { 1, 221, 217, 255, 208, 217, 255, 255, 255, 255, 255}, { 11, 155, 189, 254, 203, 211, 255, 249, 252, 253, 254}, { 1, 110, 171, 252, 191, 204, 255, 237, 246, 250, 252} }, - { /* Coeff Band 7 */ + { + /* Coeff Band 7 */ { 1, 207, 235, 255, 232, 241, 248, 251, 253, 254, 254}, { 58, 161, 216, 255, 230, 235, 255, 255, 255, 255, 255}, { 8, 133, 204, 255, 219, 231, 255, 255, 255, 255, 255} } }, - { /* block Type 1 */ - { /* Coeff Band 0 */ + { + /* block Type 1 */ + { + /* Coeff Band 0 */ { 134, 152, 233, 224, 234, 52, 255, 166, 210, 232, 243}, { 97, 132, 185, 234, 186, 189, 197, 171, 255, 212, 233}, { 84, 110, 185, 237, 182, 182, 145, 145, 255, 255, 255} }, - { /* Coeff Band 1 */ + { + /* Coeff Band 1 */ { 1, 124, 213, 247, 192, 212, 255, 255, 255, 255, 255}, { 88, 111, 178, 254, 189, 211, 255, 255, 255, 255, 255}, { 12, 59, 129, 236, 150, 179, 239, 195, 255, 255, 255} }, - { /* Coeff Band 2 */ + { + /* Coeff Band 2 */ { 1, 102, 225, 255, 210, 240, 247, 251, 253, 254, 254}, { 110, 78, 195, 254, 200, 191, 255, 255, 255, 255, 255}, { 37, 63, 177, 255, 194, 195, 225, 240, 247, 251, 253} }, - { /* Coeff Band 3 */ + { + /* Coeff Band 3 */ { 1, 1, 229, 255, 202, 224, 239, 247, 251, 253, 254}, { 150, 1, 192, 255, 206, 226, 240, 247, 251, 253, 254}, { 75, 1, 138, 255, 172, 228, 241, 248, 251, 253, 254} }, - { /* Coeff Band 4 */ + { + /* Coeff Band 4 */ { 128, 191, 223, 239, 247, 251, 253, 254, 254, 254, 254}, { 128, 191, 223, 239, 247, 251, 253, 254, 254, 254, 254}, { 128, 191, 223, 239, 247, 251, 253, 254, 254, 254, 254} }, - { /* Coeff Band 5 */ + { + /* Coeff Band 5 */ { 128, 191, 223, 239, 247, 251, 253, 254, 254, 254, 254}, { 128, 191, 223, 239, 247, 251, 253, 254, 254, 254, 254}, { 128, 191, 223, 239, 247, 251, 253, 254, 254, 254, 254} }, - { /* Coeff Band 6 */ + { + /* Coeff Band 6 */ { 128, 191, 223, 239, 247, 251, 253, 254, 254, 254, 254}, { 128, 191, 223, 239, 247, 251, 253, 254, 254, 254, 254}, { 128, 191, 223, 239, 247, 251, 253, 254, 254, 254, 254} }, - { /* Coeff Band 7 */ + { + /* Coeff Band 7 */ { 128, 191, 223, 239, 247, 251, 253, 254, 254, 254, 254}, { 128, 191, 223, 239, 247, 251, 253, 254, 254, 254, 254}, { 128, 191, 223, 239, 247, 251, 253, 254, 254, 254, 254} } }, - { /* block Type 2 */ - { /* Coeff Band 0 */ + { + /* block Type 2 */ + { + /* Coeff Band 0 */ { 11, 181, 226, 199, 183, 255, 255, 255, 255, 255, 255}, { 2, 147, 185, 248, 163, 180, 255, 236, 245, 250, 252}, { 1, 123, 157, 238, 154, 176, 255, 226, 255, 255, 255} }, - { /* Coeff Band 1 */ + { + /* Coeff Band 1 */ { 1, 150, 191, 246, 174, 188, 255, 235, 245, 250, 252}, { 1, 125, 166, 245, 165, 185, 255, 234, 244, 249, 252}, { 1, 79, 125, 240, 148, 179, 255, 234, 255, 255, 255} }, - { /* Coeff Band 2 */ + { + /* Coeff Band 2 */ { 1, 146, 184, 242, 167, 183, 255, 231, 243, 249, 252}, { 1, 119, 160, 239, 156, 178, 255, 231, 255, 255, 255}, { 1, 75, 115, 234, 142, 173, 255, 225, 255, 255, 255} }, - { /* Coeff Band 3 */ + { + /* Coeff Band 3 */ { 1, 150, 189, 244, 169, 183, 255, 234, 244, 249, 252}, { 1, 123, 162, 243, 161, 180, 255, 233, 244, 249, 252}, { 1, 76, 120, 238, 148, 178, 255, 230, 255, 255, 255} }, - { /* Coeff Band 4 */ + { + /* Coeff Band 4 */ { 1, 163, 202, 252, 188, 204, 255, 249, 252, 253, 254}, { 1, 136, 180, 251, 181, 201, 255, 247, 251, 253, 254}, { 1, 92, 146, 249, 170, 197, 255, 246, 250, 252, 253} }, - { /* Coeff Band 5 */ + { + /* Coeff Band 5 */ { 1, 156, 195, 249, 179, 193, 255, 242, 248, 251, 253}, { 1, 128, 169, 248, 171, 192, 255, 242, 248, 251, 253}, { 1, 84, 132, 245, 158, 187, 255, 240, 247, 251, 253} }, - { /* Coeff Band 6 */ + { + /* Coeff Band 6 */ { 1, 172, 209, 251, 192, 201, 255, 243, 249, 252, 253}, { 1, 143, 185, 250, 184, 199, 255, 242, 248, 251, 253}, { 1, 95, 147, 247, 168, 190, 255, 240, 247, 251, 253} }, - { /* Coeff Band 7 */ + { + /* Coeff Band 7 */ { 1, 178, 229, 255, 218, 223, 255, 255, 255, 255, 255}, { 36, 155, 210, 255, 212, 221, 255, 255, 255, 255, 255}, { 6, 117, 180, 254, 199, 216, 255, 252, 253, 254, 254} diff --git a/vp8/common/entropy.c b/vp8/common/entropy.c index 387742266..4c7caef82 100644 --- a/vp8/common/entropy.c +++ b/vp8/common/entropy.c @@ -28,24 +28,23 @@ typedef vp8_prob Prob; #include "coefupdateprobs.h" -DECLARE_ALIGNED(16, const unsigned char, vp8_norm[256]) = -{ - 0, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +DECLARE_ALIGNED(16, const unsigned char, vp8_norm[256]) = { + 0, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; DECLARE_ALIGNED(16, cuchar, vp8_coef_bands[16]) = @@ -55,15 +54,16 @@ DECLARE_ALIGNED(16, cuchar, vp8_prev_token_class[MAX_ENTROPY_TOKENS]) = #if CONFIG_EXPANDED_COEF_CONTEXT { 0, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 0}; #else -{ 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0}; + { + 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0 + }; #endif -DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]) = -{ - 0, 1, 4, 8, - 5, 2, 3, 6, - 9, 12, 13, 10, - 7, 11, 14, 15, +DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]) = { + 0, 1, 4, 8, + 5, 2, 3, 6, + 9, 12, 13, 10, + 7, 11, 14, 15, }; DECLARE_ALIGNED(64, cuchar, vp8_coef_bands_8x8[64]) = { 0, 1, 2, 3, 5, 4, 4, 5, 5, 3, 6, 3, 5, 4, 6, 6, @@ -73,34 +73,33 @@ DECLARE_ALIGNED(64, cuchar, vp8_coef_bands_8x8[64]) = { 0, 1, 2, 3, 5, 4, 4, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 -}; -DECLARE_ALIGNED(64, const int, vp8_default_zig_zag1d_8x8[64]) = -{ - 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, - 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, - 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, - 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63, + }; +DECLARE_ALIGNED(64, const int, vp8_default_zig_zag1d_8x8[64]) = { + 0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63, }; DECLARE_ALIGNED(16, short, vp8_default_zig_zag_mask[16]); -DECLARE_ALIGNED(64, short, vp8_default_zig_zag_mask_8x8[64]);//int64_t +DECLARE_ALIGNED(64, short, vp8_default_zig_zag_mask_8x8[64]);// int64_t /* Array indices are identical to previously-existing CONTEXT_NODE indices */ const vp8_tree_index vp8_coef_tree[ 22] = /* corresponding _CONTEXT_NODEs */ { - -DCT_EOB_TOKEN, 2, /* 0 = EOB */ - -ZERO_TOKEN, 4, /* 1 = ZERO */ - -ONE_TOKEN, 6, /* 2 = ONE */ - 8, 12, /* 3 = LOW_VAL */ - -TWO_TOKEN, 10, /* 4 = TWO */ - -THREE_TOKEN, -FOUR_TOKEN, /* 5 = THREE */ - 14, 16, /* 6 = HIGH_LOW */ - -DCT_VAL_CATEGORY1, -DCT_VAL_CATEGORY2, /* 7 = CAT_ONE */ - 18, 20, /* 8 = CAT_THREEFOUR */ - -DCT_VAL_CATEGORY3, -DCT_VAL_CATEGORY4, /* 9 = CAT_THREE */ - -DCT_VAL_CATEGORY5, -DCT_VAL_CATEGORY6 /* 10 = CAT_FIVE */ + -DCT_EOB_TOKEN, 2, /* 0 = EOB */ + -ZERO_TOKEN, 4, /* 1 = ZERO */ + -ONE_TOKEN, 6, /* 2 = ONE */ + 8, 12, /* 3 = LOW_VAL */ + -TWO_TOKEN, 10, /* 4 = TWO */ + -THREE_TOKEN, -FOUR_TOKEN, /* 5 = THREE */ + 14, 16, /* 6 = HIGH_LOW */ + -DCT_VAL_CATEGORY1, -DCT_VAL_CATEGORY2, /* 7 = CAT_ONE */ + 18, 20, /* 8 = CAT_THREEFOUR */ + -DCT_VAL_CATEGORY3, -DCT_VAL_CATEGORY4, /* 9 = CAT_THREE */ + -DCT_VAL_CATEGORY5, -DCT_VAL_CATEGORY6 /* 10 = CAT_FIVE */ }; struct vp8_token_struct vp8_coef_encodings[MAX_ENTROPY_TOKENS]; @@ -118,57 +117,50 @@ static const Prob Pcat6[] = static vp8_tree_index cat1[2], cat2[4], cat3[6], cat4[8], cat5[10], cat6[26]; -void vp8_init_scan_order_mask() -{ - int i; +void vp8_init_scan_order_mask() { + int i; - for (i = 0; i < 16; i++) - { - vp8_default_zig_zag_mask[vp8_default_zig_zag1d[i]] = 1 << i; - } - for (i = 0; i < 64; i++) - { - vp8_default_zig_zag_mask_8x8[vp8_default_zig_zag1d_8x8[i]] = 1 << i; - } + for (i = 0; i < 16; i++) { + vp8_default_zig_zag_mask[vp8_default_zig_zag1d[i]] = 1 << i; + } + for (i = 0; i < 64; i++) { + vp8_default_zig_zag_mask_8x8[vp8_default_zig_zag1d_8x8[i]] = 1 << i; + } } -static void init_bit_tree(vp8_tree_index *p, int n) -{ - int i = 0; +static void init_bit_tree(vp8_tree_index *p, int n) { + int i = 0; - while (++i < n) - { - p[0] = p[1] = i << 1; - p += 2; - } + while (++i < n) { + p[0] = p[1] = i << 1; + p += 2; + } - p[0] = p[1] = 0; + p[0] = p[1] = 0; } -static void init_bit_trees() -{ - init_bit_tree(cat1, 1); - init_bit_tree(cat2, 2); - init_bit_tree(cat3, 3); - init_bit_tree(cat4, 4); - init_bit_tree(cat5, 5); - init_bit_tree(cat6, 13); +static void init_bit_trees() { + init_bit_tree(cat1, 1); + init_bit_tree(cat2, 2); + init_bit_tree(cat3, 3); + init_bit_tree(cat4, 4); + init_bit_tree(cat5, 5); + init_bit_tree(cat6, 13); } -vp8_extra_bit_struct vp8_extra_bits[12] = -{ - { 0, 0, 0, 0}, - { 0, 0, 0, 1}, - { 0, 0, 0, 2}, - { 0, 0, 0, 3}, - { 0, 0, 0, 4}, - { cat1, Pcat1, 1, 5}, - { cat2, Pcat2, 2, 7}, - { cat3, Pcat3, 3, 11}, - { cat4, Pcat4, 4, 19}, - { cat5, Pcat5, 5, 35}, - { cat6, Pcat6, 13, 67}, - { 0, 0, 0, 0} +vp8_extra_bit_struct vp8_extra_bits[12] = { + { 0, 0, 0, 0}, + { 0, 0, 0, 1}, + { 0, 0, 0, 2}, + { 0, 0, 0, 3}, + { 0, 0, 0, 4}, + { cat1, Pcat1, 1, 5}, + { cat2, Pcat2, 2, 7}, + { cat3, Pcat3, 3, 11}, + { cat4, Pcat4, 4, 19}, + { cat5, Pcat5, 5, 35}, + { cat6, Pcat6, 13, 67}, + { 0, 0, 0, 0} }; #if CONFIG_NEWUPDATE @@ -177,25 +169,23 @@ const vp8_prob updprobs[4] = {128, 136, 120, 112}; #include "default_coef_probs.h" -void vp8_default_coef_probs(VP8_COMMON *pc) -{ - vpx_memcpy(pc->fc.coef_probs, default_coef_probs, - sizeof(default_coef_probs)); +void vp8_default_coef_probs(VP8_COMMON *pc) { + vpx_memcpy(pc->fc.coef_probs, default_coef_probs, + sizeof(default_coef_probs)); - vpx_memcpy(pc->fc.coef_probs_8x8, vp8_default_coef_probs_8x8, - sizeof(vp8_default_coef_probs_8x8)); + vpx_memcpy(pc->fc.coef_probs_8x8, vp8_default_coef_probs_8x8, + sizeof(vp8_default_coef_probs_8x8)); } -void vp8_coef_tree_initialize() -{ - init_bit_trees(); - vp8_tokens_from_tree(vp8_coef_encodings, vp8_coef_tree); +void vp8_coef_tree_initialize() { + init_bit_trees(); + vp8_tokens_from_tree(vp8_coef_encodings, vp8_coef_tree); } #if CONFIG_ADAPTIVE_ENTROPY -//#define COEF_COUNT_TESTING +// #define COEF_COUNT_TESTING #define COEF_COUNT_SAT 24 #define COEF_MAX_UPDATE_FACTOR 112 @@ -204,127 +194,111 @@ void vp8_coef_tree_initialize() #define COEF_COUNT_SAT_AFTER_KEY 24 #define COEF_MAX_UPDATE_FACTOR_AFTER_KEY 128 -void vp8_adapt_coef_probs(VP8_COMMON *cm) -{ - int t, i, j, k, count; - unsigned int branch_ct[ENTROPY_NODES][2]; - vp8_prob coef_probs[ENTROPY_NODES]; - int update_factor; /* denominator 256 */ - int factor; - int count_sat; - - //printf("Frame type: %d\n", cm->frame_type); - if (cm->frame_type == KEY_FRAME) - { - update_factor = COEF_MAX_UPDATE_FACTOR_KEY; - count_sat = COEF_COUNT_SAT_KEY; - } - else if (cm->last_frame_type == KEY_FRAME) - { - update_factor = COEF_MAX_UPDATE_FACTOR_AFTER_KEY; /* adapt quickly */ - count_sat = COEF_COUNT_SAT_AFTER_KEY; - } - else - { - update_factor = COEF_MAX_UPDATE_FACTOR; - count_sat = COEF_COUNT_SAT; - } +void vp8_adapt_coef_probs(VP8_COMMON *cm) { + int t, i, j, k, count; + unsigned int branch_ct[ENTROPY_NODES][2]; + vp8_prob coef_probs[ENTROPY_NODES]; + int update_factor; /* denominator 256 */ + int factor; + int count_sat; + + // printf("Frame type: %d\n", cm->frame_type); + if (cm->frame_type == KEY_FRAME) { + update_factor = COEF_MAX_UPDATE_FACTOR_KEY; + count_sat = COEF_COUNT_SAT_KEY; + } else if (cm->last_frame_type == KEY_FRAME) { + update_factor = COEF_MAX_UPDATE_FACTOR_AFTER_KEY; /* adapt quickly */ + count_sat = COEF_COUNT_SAT_AFTER_KEY; + } else { + update_factor = COEF_MAX_UPDATE_FACTOR; + count_sat = COEF_COUNT_SAT; + } #ifdef COEF_COUNT_TESTING - { - printf("static const unsigned int\ncoef_counts" - "[BLOCK_TYPES] [COEF_BANDS]" - "[PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS] = {\n"); - for (i = 0; i<BLOCK_TYPES; ++i) - { - printf(" {\n"); - for (j = 0; j<COEF_BANDS; ++j) - { - printf(" {\n"); - for (k = 0; k<PREV_COEF_CONTEXTS; ++k) - { - printf(" {"); - for (t = 0; t<MAX_ENTROPY_TOKENS; ++t) printf("%d, ", cm->fc.coef_counts[i][j][k][t]); - printf("},\n"); - } - printf(" },\n"); + { + printf("static const unsigned int\ncoef_counts" + "[BLOCK_TYPES] [COEF_BANDS]" + "[PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS] = {\n"); + for (i = 0; i < BLOCK_TYPES; ++i) { + printf(" {\n"); + for (j = 0; j < COEF_BANDS; ++j) { + printf(" {\n"); + for (k = 0; k < PREV_COEF_CONTEXTS; ++k) { + printf(" {"); + for (t = 0; t < MAX_ENTROPY_TOKENS; ++t) printf("%d, ", cm->fc.coef_counts[i][j][k][t]); + printf("},\n"); } - printf(" },\n"); + printf(" },\n"); } - printf("};\n"); - printf("static const unsigned int\ncoef_counts_8x8" - "[BLOCK_TYPES_8X8] [COEF_BANDS]" - "[PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS] = {\n"); - for (i = 0; i<BLOCK_TYPES_8X8; ++i) - { - printf(" {\n"); - for (j = 0; j<COEF_BANDS; ++j) - { - printf(" {\n"); - for (k = 0; k<PREV_COEF_CONTEXTS; ++k) - { - printf(" {"); - for (t = 0; t<MAX_ENTROPY_TOKENS; ++t) printf("%d, ", cm->fc.coef_counts_8x8[i][j][k][t]); - printf("},\n"); - } - printf(" },\n"); + printf(" },\n"); + } + printf("};\n"); + printf("static const unsigned int\ncoef_counts_8x8" + "[BLOCK_TYPES_8X8] [COEF_BANDS]" + "[PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS] = {\n"); + for (i = 0; i < BLOCK_TYPES_8X8; ++i) { + printf(" {\n"); + for (j = 0; j < COEF_BANDS; ++j) { + printf(" {\n"); + for (k = 0; k < PREV_COEF_CONTEXTS; ++k) { + printf(" {"); + for (t = 0; t < MAX_ENTROPY_TOKENS; ++t) printf("%d, ", cm->fc.coef_counts_8x8[i][j][k][t]); + printf("},\n"); } - printf(" },\n"); + printf(" },\n"); } - printf("};\n"); + printf(" },\n"); } + printf("};\n"); + } #endif - for (i = 0; i<BLOCK_TYPES; ++i) - for (j = 0; j<COEF_BANDS; ++j) - for (k = 0; k<PREV_COEF_CONTEXTS; ++k) - { + for (i = 0; i < BLOCK_TYPES; ++i) + for (j = 0; j < COEF_BANDS; ++j) + for (k = 0; k < PREV_COEF_CONTEXTS; ++k) { #if CONFIG_EXPANDED_COEF_CONTEXT - if (k >=3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) - continue; + if (k >= 3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) + continue; #endif - vp8_tree_probs_from_distribution( - MAX_ENTROPY_TOKENS, vp8_coef_encodings, vp8_coef_tree, - coef_probs, branch_ct, cm->fc.coef_counts [i][j][k], - 256, 1); - for (t=0; t<ENTROPY_NODES; ++t) - { - int prob; - count = branch_ct[t][0] + branch_ct[t][1]; - count = count > count_sat ? count_sat : count; - factor = (update_factor * count / count_sat); - prob = ((int)cm->fc.pre_coef_probs[i][j][k][t] * (256-factor) + - (int)coef_probs[t] * factor + 128) >> 8; - if (prob <= 0) cm->fc.coef_probs[i][j][k][t] = 1; - else if (prob > 255) cm->fc.coef_probs[i][j][k][t] = 255; - else cm->fc.coef_probs[i][j][k][t] = prob; - } - } - - for (i = 0; i<BLOCK_TYPES_8X8; ++i) - for (j = 0; j<COEF_BANDS; ++j) - for (k = 0; k<PREV_COEF_CONTEXTS; ++k) - { + vp8_tree_probs_from_distribution( + MAX_ENTROPY_TOKENS, vp8_coef_encodings, vp8_coef_tree, + coef_probs, branch_ct, cm->fc.coef_counts [i][j][k], + 256, 1); + for (t = 0; t < ENTROPY_NODES; ++t) { + int prob; + count = branch_ct[t][0] + branch_ct[t][1]; + count = count > count_sat ? count_sat : count; + factor = (update_factor * count / count_sat); + prob = ((int)cm->fc.pre_coef_probs[i][j][k][t] * (256 - factor) + + (int)coef_probs[t] * factor + 128) >> 8; + if (prob <= 0) cm->fc.coef_probs[i][j][k][t] = 1; + else if (prob > 255) cm->fc.coef_probs[i][j][k][t] = 255; + else cm->fc.coef_probs[i][j][k][t] = prob; + } + } + + for (i = 0; i < BLOCK_TYPES_8X8; ++i) + for (j = 0; j < COEF_BANDS; ++j) + for (k = 0; k < PREV_COEF_CONTEXTS; ++k) { #if CONFIG_EXPANDED_COEF_CONTEXT - if (k >=3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) - continue; + if (k >= 3 && ((i == 0 && j == 1) || (i > 0 && j == 0))) + continue; #endif - vp8_tree_probs_from_distribution( - MAX_ENTROPY_TOKENS, vp8_coef_encodings, vp8_coef_tree, - coef_probs, branch_ct, cm->fc.coef_counts_8x8 [i][j][k], - 256, 1); - for (t=0; t<ENTROPY_NODES; ++t) - { - int prob; - count = branch_ct[t][0] + branch_ct[t][1]; - count = count > count_sat ? count_sat : count; - factor = (update_factor * count / count_sat); - prob = ((int)cm->fc.pre_coef_probs_8x8[i][j][k][t] * (256-factor) + - (int)coef_probs[t] * factor + 128) >> 8; - if (prob <= 0) cm->fc.coef_probs_8x8[i][j][k][t] = 1; - else if (prob > 255) cm->fc.coef_probs_8x8[i][j][k][t] = 255; - else cm->fc.coef_probs_8x8[i][j][k][t] = prob; - } - } + vp8_tree_probs_from_distribution( + MAX_ENTROPY_TOKENS, vp8_coef_encodings, vp8_coef_tree, + coef_probs, branch_ct, cm->fc.coef_counts_8x8 [i][j][k], + 256, 1); + for (t = 0; t < ENTROPY_NODES; ++t) { + int prob; + count = branch_ct[t][0] + branch_ct[t][1]; + count = count > count_sat ? count_sat : count; + factor = (update_factor * count / count_sat); + prob = ((int)cm->fc.pre_coef_probs_8x8[i][j][k][t] * (256 - factor) + + (int)coef_probs[t] * factor + 128) >> 8; + if (prob <= 0) cm->fc.coef_probs_8x8[i][j][k][t] = 1; + else if (prob > 255) cm->fc.coef_probs_8x8[i][j][k][t] = 255; + else cm->fc.coef_probs_8x8[i][j][k][t] = prob; + } + } } #endif diff --git a/vp8/common/entropy.h b/vp8/common/entropy.h index 04339742b..bc6f16c5f 100644 --- a/vp8/common/entropy.h +++ b/vp8/common/entropy.h @@ -43,12 +43,11 @@ extern const vp8_tree_index vp8_coef_tree[]; extern struct vp8_token_struct vp8_coef_encodings[MAX_ENTROPY_TOKENS]; -typedef struct -{ - vp8_tree_p tree; - const vp8_prob *prob; - int Len; - int base_val; +typedef struct { + vp8_tree_p tree; + const vp8_prob *prob; + int Len; + int base_val; } vp8_extra_bit_struct; extern vp8_extra_bit_struct vp8_extra_bits[12]; /* indexed by token value */ @@ -110,7 +109,7 @@ void vp8_default_coef_probs(struct VP8Common *); extern DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]); extern short vp8_default_zig_zag_mask[16]; extern DECLARE_ALIGNED(64, const int, vp8_default_zig_zag1d_8x8[64]); -extern short vp8_default_zig_zag_mask_8x8[64];//int64_t +extern short vp8_default_zig_zag_mask_8x8[64];// int64_t void vp8_coef_tree_initialize(void); #if CONFIG_ADAPTIVE_ENTROPY diff --git a/vp8/common/entropymode.c b/vp8/common/entropymode.c index 26179bef2..9edfe2eda 100644 --- a/vp8/common/entropymode.c +++ b/vp8/common/entropymode.c @@ -16,309 +16,296 @@ #include "vpx_mem/vpx_mem.h" -const unsigned int kf_y_mode_cts[8][VP8_YMODES] = -{ +const unsigned int kf_y_mode_cts[8][VP8_YMODES] = { #if CONFIG_NEWINTRAMODES - /* DC V H D45 135 117 153 D27 D63 TM i8x8 BPRED */ - {12, 6, 5, 5, 5, 5, 5, 5, 5, 2, 22, 200}, - {25, 13, 13, 7, 7, 7, 7, 7, 7, 6, 27, 160}, - {31, 17, 18, 8, 8, 8, 8, 8, 8, 9, 26, 139}, - {40, 22, 23, 8, 8, 8, 8, 8, 8, 12, 27, 116}, - {53, 26, 28, 8, 8, 8, 8, 8, 8, 13, 26, 94}, - {68, 33, 35, 8, 8, 8, 8, 8, 8, 17, 20, 68}, - {78, 38, 38, 8, 8, 8, 8, 8, 8, 19, 16, 52}, - {89, 42, 42, 8, 8, 8, 8, 8, 8, 21, 12, 34}, + /* DC V H D45 135 117 153 D27 D63 TM i8x8 BPRED */ + {12, 6, 5, 5, 5, 5, 5, 5, 5, 2, 22, 200}, + {25, 13, 13, 7, 7, 7, 7, 7, 7, 6, 27, 160}, + {31, 17, 18, 8, 8, 8, 8, 8, 8, 9, 26, 139}, + {40, 22, 23, 8, 8, 8, 8, 8, 8, 12, 27, 116}, + {53, 26, 28, 8, 8, 8, 8, 8, 8, 13, 26, 94}, + {68, 33, 35, 8, 8, 8, 8, 8, 8, 17, 20, 68}, + {78, 38, 38, 8, 8, 8, 8, 8, 8, 19, 16, 52}, + {89, 42, 42, 8, 8, 8, 8, 8, 8, 21, 12, 34}, #else - {17, 6, 5, 2, 22, 203}, - {27, 13, 13, 6, 27, 170}, - {35, 17, 18, 9, 26, 152}, - {45, 22, 24, 12, 27, 126}, - {58, 26, 29, 13, 26, 104}, - {73, 33, 36, 17, 20, 78}, - {88, 38, 39, 19, 16, 57}, - {99, 42, 43, 21, 12, 39}, + {17, 6, 5, 2, 22, 203}, + {27, 13, 13, 6, 27, 170}, + {35, 17, 18, 9, 26, 152}, + {45, 22, 24, 12, 27, 126}, + {58, 26, 29, 13, 26, 104}, + {73, 33, 36, 17, 20, 78}, + {88, 38, 39, 19, 16, 57}, + {99, 42, 43, 21, 12, 39}, #endif }; static const unsigned int y_mode_cts [VP8_YMODES] = #if CONFIG_NEWINTRAMODES - /* DC V H D45 135 117 153 D27 D63 TM i8x8 BPRED */ - {98, 19, 15, 14, 14, 14, 14, 12, 12, 13, 16, 70}; + /* DC V H D45 135 117 153 D27 D63 TM i8x8 BPRED */ +{98, 19, 15, 14, 14, 14, 14, 12, 12, 13, 16, 70}; #else - {106, 25, 21, 13, 16, 74}; + { + 106, 25, 21, 13, 16, 74 + }; #endif -static const unsigned int uv_mode_cts [VP8_YMODES] [VP8_UV_MODES] ={ +static const unsigned int uv_mode_cts [VP8_YMODES] [VP8_UV_MODES] = { #if CONFIG_NEWINTRAMODES - /* DC V H D45 135 117 153 D27 D63 TM */ - { 200, 15, 15, 10, 10, 10, 10, 10, 10, 6}, /* DC */ - { 130, 75, 10, 10, 10, 10, 10, 10, 10, 6}, /* V */ - { 130, 10, 75, 10, 10, 10, 10, 10, 10, 6}, /* H */ - { 130, 15, 10, 75, 10, 10, 10, 10, 10, 6}, /* D45 */ - { 150, 15, 10, 10, 75, 10, 10, 10, 10, 6}, /* D135 */ - { 150, 15, 10, 10, 10, 75, 10, 10, 10, 6}, /* D117 */ - { 150, 15, 10, 10, 10, 10, 75, 10, 10, 6}, /* D153 */ - { 150, 15, 10, 10, 10, 10, 10, 75, 10, 6}, /* D27 */ - { 150, 15, 10, 10, 10, 10, 10, 10, 75, 6}, /* D63 */ - { 160, 30, 30, 10, 10, 10, 10, 10, 10, 16}, /* TM */ - { 132, 46, 40, 10, 10, 10, 10, 10, 10, 18}, /* i8x8 - never used */ - { 150, 35, 41, 10, 10, 10, 10, 10, 10, 10}, /* BPRED */ + /* DC V H D45 135 117 153 D27 D63 TM */ + { 200, 15, 15, 10, 10, 10, 10, 10, 10, 6}, /* DC */ + { 130, 75, 10, 10, 10, 10, 10, 10, 10, 6}, /* V */ + { 130, 10, 75, 10, 10, 10, 10, 10, 10, 6}, /* H */ + { 130, 15, 10, 75, 10, 10, 10, 10, 10, 6}, /* D45 */ + { 150, 15, 10, 10, 75, 10, 10, 10, 10, 6}, /* D135 */ + { 150, 15, 10, 10, 10, 75, 10, 10, 10, 6}, /* D117 */ + { 150, 15, 10, 10, 10, 10, 75, 10, 10, 6}, /* D153 */ + { 150, 15, 10, 10, 10, 10, 10, 75, 10, 6}, /* D27 */ + { 150, 15, 10, 10, 10, 10, 10, 10, 75, 6}, /* D63 */ + { 160, 30, 30, 10, 10, 10, 10, 10, 10, 16}, /* TM */ + { 132, 46, 40, 10, 10, 10, 10, 10, 10, 18}, /* i8x8 - never used */ + { 150, 35, 41, 10, 10, 10, 10, 10, 10, 10}, /* BPRED */ #else - { 210, 20, 20, 6}, - { 180, 60, 10, 6}, - { 150, 20, 80, 6}, - { 170, 35, 35, 16}, - { 142, 51, 45, 18}, /* never used */ - { 160, 40, 46, 10}, + { 210, 20, 20, 6}, + { 180, 60, 10, 6}, + { 150, 20, 80, 6}, + { 170, 35, 35, 16}, + { 142, 51, 45, 18}, /* never used */ + { 160, 40, 46, 10}, #endif }; static const unsigned int i8x8_mode_cts [VP8_I8X8_MODES] = #if CONFIG_NEWINTRAMODES - /* DC V H D45 135 117 153 D27 D63 TM */ - {73, 49, 61, 30, 30, 30, 30, 30, 30, 13}; + /* DC V H D45 135 117 153 D27 D63 TM */ +{73, 49, 61, 30, 30, 30, 30, 30, 30, 13}; #else - {93, 69, 81, 13}; + { + 93, 69, 81, 13 + }; #endif -static const unsigned int kf_uv_mode_cts [VP8_YMODES] [VP8_UV_MODES] ={ +static const unsigned int kf_uv_mode_cts [VP8_YMODES] [VP8_UV_MODES] = { #if CONFIG_NEWINTRAMODES - // DC V H D45 135 117 153 D27 D63 TM - { 160, 24, 24, 20, 20, 20, 20, 20, 20, 8}, /* DC */ - { 102, 64, 30, 20, 20, 20, 20, 20, 20, 10}, /* V */ - { 102, 30, 64, 20, 20, 20, 20, 20, 20, 10}, /* H */ - { 102, 33, 20, 64, 20, 20, 20, 20, 20, 14}, /* D45 */ - { 102, 33, 20, 20, 64, 20, 20, 20, 20, 14}, /* D135 */ - { 122, 33, 20, 20, 20, 64, 20, 20, 20, 14}, /* D117 */ - { 102, 33, 20, 20, 20, 20, 64, 20, 20, 14}, /* D153 */ - { 102, 33, 20, 20, 20, 20, 20, 64, 20, 14}, /* D27 */ - { 102, 33, 20, 20, 20, 20, 20, 20, 64, 14}, /* D63 */ - { 132, 36, 30, 20, 20, 20, 20, 20, 20, 18}, /* TM */ - { 122, 41, 35, 20, 20, 20, 20, 20, 20, 18}, /* i8x8 - never used */ - { 122, 41, 35, 20, 20, 20, 20, 20, 20, 18}, /* BPRED */ + // DC V H D45 135 117 153 D27 D63 TM + { 160, 24, 24, 20, 20, 20, 20, 20, 20, 8}, /* DC */ + { 102, 64, 30, 20, 20, 20, 20, 20, 20, 10}, /* V */ + { 102, 30, 64, 20, 20, 20, 20, 20, 20, 10}, /* H */ + { 102, 33, 20, 64, 20, 20, 20, 20, 20, 14}, /* D45 */ + { 102, 33, 20, 20, 64, 20, 20, 20, 20, 14}, /* D135 */ + { 122, 33, 20, 20, 20, 64, 20, 20, 20, 14}, /* D117 */ + { 102, 33, 20, 20, 20, 20, 64, 20, 20, 14}, /* D153 */ + { 102, 33, 20, 20, 20, 20, 20, 64, 20, 14}, /* D27 */ + { 102, 33, 20, 20, 20, 20, 20, 20, 64, 14}, /* D63 */ + { 132, 36, 30, 20, 20, 20, 20, 20, 20, 18}, /* TM */ + { 122, 41, 35, 20, 20, 20, 20, 20, 20, 18}, /* i8x8 - never used */ + { 122, 41, 35, 20, 20, 20, 20, 20, 20, 18}, /* BPRED */ #else - { 180, 34, 34, 8}, - { 132, 74, 40, 10}, - { 132, 40, 74, 10}, - { 152, 46, 40, 18}, - { 142, 51, 45, 18}, /* never used */ - { 142, 51, 45, 18}, + { 180, 34, 34, 8}, + { 132, 74, 40, 10}, + { 132, 40, 74, 10}, + { 152, 46, 40, 18}, + { 142, 51, 45, 18}, /* never used */ + { 142, 51, 45, 18}, #endif }; -static const unsigned int bmode_cts[VP8_BINTRAMODES] = -{ - /* DC TM VE HE LD RD VR VL HD HU */ - 43891, 17694, 10036, 3920, 3363, 2546, 5119, 3221, 2471, 1723 +static const unsigned int bmode_cts[VP8_BINTRAMODES] = { + /* DC TM VE HE LD RD VR VL HD HU */ + 43891, 17694, 10036, 3920, 3363, 2546, 5119, 3221, 2471, 1723 }; -typedef enum -{ - SUBMVREF_NORMAL, - SUBMVREF_LEFT_ZED, - SUBMVREF_ABOVE_ZED, - SUBMVREF_LEFT_ABOVE_SAME, - SUBMVREF_LEFT_ABOVE_ZED +typedef enum { + SUBMVREF_NORMAL, + SUBMVREF_LEFT_ZED, + SUBMVREF_ABOVE_ZED, + SUBMVREF_LEFT_ABOVE_SAME, + SUBMVREF_LEFT_ABOVE_ZED } sumvfref_t; -int vp8_mv_cont(const int_mv *l, const int_mv *a) -{ - int lez = (l->as_int == 0); - int aez = (a->as_int == 0); - int lea = (l->as_int == a->as_int); +int vp8_mv_cont(const int_mv *l, const int_mv *a) { + int lez = (l->as_int == 0); + int aez = (a->as_int == 0); + int lea = (l->as_int == a->as_int); - if (lea && lez) - return SUBMVREF_LEFT_ABOVE_ZED; + if (lea && lez) + return SUBMVREF_LEFT_ABOVE_ZED; - if (lea) - return SUBMVREF_LEFT_ABOVE_SAME; + if (lea) + return SUBMVREF_LEFT_ABOVE_SAME; - if (aez) - return SUBMVREF_ABOVE_ZED; + if (aez) + return SUBMVREF_ABOVE_ZED; - if (lez) - return SUBMVREF_LEFT_ZED; + if (lez) + return SUBMVREF_LEFT_ZED; - return SUBMVREF_NORMAL; + return SUBMVREF_NORMAL; } -const vp8_prob vp8_sub_mv_ref_prob [VP8_SUBMVREFS-1] = { 180, 162, 25}; +const vp8_prob vp8_sub_mv_ref_prob [VP8_SUBMVREFS - 1] = { 180, 162, 25}; -const vp8_prob vp8_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP8_SUBMVREFS-1] = -{ - { 147, 136, 18 }, - { 106, 145, 1 }, - { 179, 121, 1 }, - { 223, 1 , 34 }, - { 208, 1 , 1 } +const vp8_prob vp8_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP8_SUBMVREFS - 1] = { + { 147, 136, 18 }, + { 106, 145, 1 }, + { 179, 121, 1 }, + { 223, 1, 34 }, + { 208, 1, 1 } }; -vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS] = -{ - { - 0, 0, 0, 0, - 0, 0, 0, 0, - 1, 1, 1, 1, - 1, 1, 1, 1, - }, - { - 0, 0, 1, 1, - 0, 0, 1, 1, - 0, 0, 1, 1, - 0, 0, 1, 1, - }, - { - 0, 0, 1, 1, - 0, 0, 1, 1, - 2, 2, 3, 3, - 2, 2, 3, 3, - }, - { - 0, 1, 2, 3, - 4, 5, 6, 7, - 8, 9, 10, 11, - 12, 13, 14, 15, - }, +vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS] = { + { + 0, 0, 0, 0, + 0, 0, 0, 0, + 1, 1, 1, 1, + 1, 1, 1, 1, + }, + { + 0, 0, 1, 1, + 0, 0, 1, 1, + 0, 0, 1, 1, + 0, 0, 1, 1, + }, + { + 0, 0, 1, 1, + 0, 0, 1, 1, + 2, 2, 3, 3, + 2, 2, 3, 3, + }, + { + 0, 1, 2, 3, + 4, 5, 6, 7, + 8, 9, 10, 11, + 12, 13, 14, 15, + }, }; const int vp8_mbsplit_count [VP8_NUMMBSPLITS] = { 2, 2, 4, 16}; -const vp8_prob vp8_mbsplit_probs [VP8_NUMMBSPLITS-1] = { 110, 111, 150}; +const vp8_prob vp8_mbsplit_probs [VP8_NUMMBSPLITS - 1] = { 110, 111, 150}; /* Array indices are identical to previously-existing INTRAMODECONTEXTNODES. */ -const vp8_tree_index vp8_bmode_tree[VP8_BINTRAMODES*2-2] = /* INTRAMODECONTEXTNODE value */ +const vp8_tree_index vp8_bmode_tree[VP8_BINTRAMODES * 2 - 2] = /* INTRAMODECONTEXTNODE value */ { - -B_DC_PRED, 2, /* 0 = DC_NODE */ - -B_TM_PRED, 4, /* 1 = TM_NODE */ - -B_VE_PRED, 6, /* 2 = VE_NODE */ - 8, 12, /* 3 = COM_NODE */ - -B_HE_PRED, 10, /* 4 = HE_NODE */ - -B_RD_PRED, -B_VR_PRED, /* 5 = RD_NODE */ - -B_LD_PRED, 14, /* 6 = LD_NODE */ - -B_VL_PRED, 16, /* 7 = VL_NODE */ - -B_HD_PRED, -B_HU_PRED /* 8 = HD_NODE */ + -B_DC_PRED, 2, /* 0 = DC_NODE */ + -B_TM_PRED, 4, /* 1 = TM_NODE */ + -B_VE_PRED, 6, /* 2 = VE_NODE */ + 8, 12, /* 3 = COM_NODE */ + -B_HE_PRED, 10, /* 4 = HE_NODE */ + -B_RD_PRED, -B_VR_PRED, /* 5 = RD_NODE */ + -B_LD_PRED, 14, /* 6 = LD_NODE */ + -B_VL_PRED, 16, /* 7 = VL_NODE */ + -B_HD_PRED, -B_HU_PRED /* 8 = HD_NODE */ }; #if CONFIG_NEWINTRAMODES /* Again, these trees use the same probability indices as their explicitly-programmed predecessors. */ -const vp8_tree_index vp8_ymode_tree[VP8_YMODES*2-2] = -{ - 2, 14, - -DC_PRED, 4, - 6, 8, - -D45_PRED, -D135_PRED, - 10, 12, - -D117_PRED, -D153_PRED, - -D27_PRED, -D63_PRED, - 16, 18, - -V_PRED, -H_PRED, - -TM_PRED, 20, - -B_PRED, -I8X8_PRED +const vp8_tree_index vp8_ymode_tree[VP8_YMODES * 2 - 2] = { + 2, 14, + -DC_PRED, 4, + 6, 8, + -D45_PRED, -D135_PRED, + 10, 12, + -D117_PRED, -D153_PRED, + -D27_PRED, -D63_PRED, + 16, 18, + -V_PRED, -H_PRED, + -TM_PRED, 20, + -B_PRED, -I8X8_PRED }; -const vp8_tree_index vp8_kf_ymode_tree[VP8_YMODES*2-2] = -{ - 2, 14, - -DC_PRED, 4, - 6, 8, - -D45_PRED, -D135_PRED, - 10, 12, - -D117_PRED, -D153_PRED, - -D27_PRED, -D63_PRED, - 16, 18, - -V_PRED, -H_PRED, - -TM_PRED, 20, - -B_PRED, -I8X8_PRED +const vp8_tree_index vp8_kf_ymode_tree[VP8_YMODES * 2 - 2] = { + 2, 14, + -DC_PRED, 4, + 6, 8, + -D45_PRED, -D135_PRED, + 10, 12, + -D117_PRED, -D153_PRED, + -D27_PRED, -D63_PRED, + 16, 18, + -V_PRED, -H_PRED, + -TM_PRED, 20, + -B_PRED, -I8X8_PRED }; -const vp8_tree_index vp8_i8x8_mode_tree[VP8_I8X8_MODES*2-2] = -{ - 2, 14, - -DC_PRED, 4, - 6, 8, - -D45_PRED, -D135_PRED, - 10, 12, - -D117_PRED, -D153_PRED, - -D27_PRED, -D63_PRED, - -V_PRED, 16, - -H_PRED, -TM_PRED +const vp8_tree_index vp8_i8x8_mode_tree[VP8_I8X8_MODES * 2 - 2] = { + 2, 14, + -DC_PRED, 4, + 6, 8, + -D45_PRED, -D135_PRED, + 10, 12, + -D117_PRED, -D153_PRED, + -D27_PRED, -D63_PRED, + -V_PRED, 16, + -H_PRED, -TM_PRED }; -const vp8_tree_index vp8_uv_mode_tree[VP8_UV_MODES*2-2] = -{ - 2, 14, - -DC_PRED, 4, - 6, 8, - -D45_PRED, -D135_PRED, - 10, 12, - -D117_PRED, -D153_PRED, - -D27_PRED, -D63_PRED, - -V_PRED, 16, - -H_PRED, -TM_PRED +const vp8_tree_index vp8_uv_mode_tree[VP8_UV_MODES * 2 - 2] = { + 2, 14, + -DC_PRED, 4, + 6, 8, + -D45_PRED, -D135_PRED, + 10, 12, + -D117_PRED, -D153_PRED, + -D27_PRED, -D63_PRED, + -V_PRED, 16, + -H_PRED, -TM_PRED }; #else /* CONFIG_NEWINTRAMODES */ /* Again, these trees use the same probability indices as their explicitly-programmed predecessors. */ -const vp8_tree_index vp8_ymode_tree[10] = -{ - -DC_PRED, 2, - 4, 6, - -V_PRED, -H_PRED, - -TM_PRED, 8, - -B_PRED, -I8X8_PRED +const vp8_tree_index vp8_ymode_tree[10] = { + -DC_PRED, 2, + 4, 6, + -V_PRED, -H_PRED, + -TM_PRED, 8, + -B_PRED, -I8X8_PRED }; -const vp8_tree_index vp8_kf_ymode_tree[10] = -{ - -B_PRED, 2, - 4, 6, - -DC_PRED, -V_PRED, - -H_PRED, 8, - -TM_PRED, -I8X8_PRED +const vp8_tree_index vp8_kf_ymode_tree[10] = { + -B_PRED, 2, + 4, 6, + -DC_PRED, -V_PRED, + -H_PRED, 8, + -TM_PRED, -I8X8_PRED }; -const vp8_tree_index vp8_i8x8_mode_tree[6] = -{ - -DC_PRED, 2, - -V_PRED, 4, - -H_PRED, -TM_PRED +const vp8_tree_index vp8_i8x8_mode_tree[6] = { + -DC_PRED, 2, + -V_PRED, 4, + -H_PRED, -TM_PRED }; -const vp8_tree_index vp8_uv_mode_tree[6] = -{ - -DC_PRED, 2, - -V_PRED, 4, - -H_PRED, -TM_PRED +const vp8_tree_index vp8_uv_mode_tree[6] = { + -DC_PRED, 2, + -V_PRED, 4, + -H_PRED, -TM_PRED }; #endif /* CONFIG_NEWINTRAMODES */ -const vp8_tree_index vp8_mbsplit_tree[6] = -{ - -3, 2, - -2, 4, - -0, -1 +const vp8_tree_index vp8_mbsplit_tree[6] = { + -3, 2, + -2, 4, + -0, -1 }; -const vp8_tree_index vp8_mv_ref_tree[8] = -{ - -ZEROMV, 2, - -NEARESTMV, 4, - -NEARMV, 6, - -NEWMV, -SPLITMV +const vp8_tree_index vp8_mv_ref_tree[8] = { + -ZEROMV, 2, + -NEARESTMV, 4, + -NEARMV, 6, + -NEWMV, -SPLITMV }; -const vp8_tree_index vp8_sub_mv_ref_tree[6] = -{ - -LEFT4X4, 2, - -ABOVE4X4, 4, - -ZERO4X4, -NEW4X4 +const vp8_tree_index vp8_sub_mv_ref_tree[6] = { + -LEFT4X4, 2, + -ABOVE4X4, 4, + -ZERO4X4, -NEW4X4 }; @@ -334,404 +321,354 @@ struct vp8_token_struct vp8_sub_mv_ref_encoding_array [VP8_SUBMVREFS]; -void vp8_init_mbmode_probs(VP8_COMMON *x) -{ - unsigned int bct [VP8_YMODES] [2]; /* num Ymodes > num UV modes */ +void vp8_init_mbmode_probs(VP8_COMMON *x) { + unsigned int bct [VP8_YMODES] [2]; /* num Ymodes > num UV modes */ - vp8_tree_probs_from_distribution( - VP8_YMODES, vp8_ymode_encodings, vp8_ymode_tree, - x->fc.ymode_prob, bct, y_mode_cts, + vp8_tree_probs_from_distribution( + VP8_YMODES, vp8_ymode_encodings, vp8_ymode_tree, + x->fc.ymode_prob, bct, y_mode_cts, + 256, 1 + ); + { + int i; + for (i = 0; i < 8; i++) + vp8_tree_probs_from_distribution( + VP8_YMODES, vp8_kf_ymode_encodings, vp8_kf_ymode_tree, + x->kf_ymode_prob[i], bct, kf_y_mode_cts[i], 256, 1 - ); - { - int i; - for (i=0;i<8;i++) - vp8_tree_probs_from_distribution( - VP8_YMODES, vp8_kf_ymode_encodings, vp8_kf_ymode_tree, - x->kf_ymode_prob[i], bct, kf_y_mode_cts[i], - 256, 1 - ); - } - { - int i; - for (i=0;i<VP8_YMODES;i++) - { - vp8_tree_probs_from_distribution( - VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree, - x->kf_uv_mode_prob[i], bct, kf_uv_mode_cts[i], - 256, 1); - vp8_tree_probs_from_distribution( - VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree, - x->fc.uv_mode_prob[i], bct, uv_mode_cts[i], - 256, 1); - } + ); + } + { + int i; + for (i = 0; i < VP8_YMODES; i++) { + vp8_tree_probs_from_distribution( + VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree, + x->kf_uv_mode_prob[i], bct, kf_uv_mode_cts[i], + 256, 1); + vp8_tree_probs_from_distribution( + VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree, + x->fc.uv_mode_prob[i], bct, uv_mode_cts[i], + 256, 1); } + } - vp8_tree_probs_from_distribution( - VP8_I8X8_MODES, vp8_i8x8_mode_encodings, vp8_i8x8_mode_tree, - x->fc.i8x8_mode_prob, bct, i8x8_mode_cts, - 256, 1); + vp8_tree_probs_from_distribution( + VP8_I8X8_MODES, vp8_i8x8_mode_encodings, vp8_i8x8_mode_tree, + x->fc.i8x8_mode_prob, bct, i8x8_mode_cts, + 256, 1); - vpx_memcpy(x->fc.sub_mv_ref_prob, vp8_sub_mv_ref_prob2, sizeof(vp8_sub_mv_ref_prob2)); - vpx_memcpy(x->fc.mbsplit_prob, vp8_mbsplit_probs, sizeof(vp8_mbsplit_probs)); + vpx_memcpy(x->fc.sub_mv_ref_prob, vp8_sub_mv_ref_prob2, sizeof(vp8_sub_mv_ref_prob2)); + vpx_memcpy(x->fc.mbsplit_prob, vp8_mbsplit_probs, sizeof(vp8_mbsplit_probs)); } static void intra_bmode_probs_from_distribution( - vp8_prob p [VP8_BINTRAMODES-1], - unsigned int branch_ct [VP8_BINTRAMODES-1] [2], - const unsigned int events [VP8_BINTRAMODES] -) -{ - vp8_tree_probs_from_distribution( - VP8_BINTRAMODES, vp8_bmode_encodings, vp8_bmode_tree, - p, branch_ct, events, - 256, 1 - ); + vp8_prob p [VP8_BINTRAMODES - 1], + unsigned int branch_ct [VP8_BINTRAMODES - 1] [2], + const unsigned int events [VP8_BINTRAMODES] +) { + vp8_tree_probs_from_distribution( + VP8_BINTRAMODES, vp8_bmode_encodings, vp8_bmode_tree, + p, branch_ct, events, + 256, 1 + ); } -void vp8_default_bmode_probs(vp8_prob p [VP8_BINTRAMODES-1]) -{ - unsigned int branch_ct [VP8_BINTRAMODES-1] [2]; - intra_bmode_probs_from_distribution(p, branch_ct, bmode_cts); +void vp8_default_bmode_probs(vp8_prob p [VP8_BINTRAMODES - 1]) { + unsigned int branch_ct [VP8_BINTRAMODES - 1] [2]; + intra_bmode_probs_from_distribution(p, branch_ct, bmode_cts); } -void vp8_kf_default_bmode_probs(vp8_prob p [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1]) -{ - unsigned int branch_ct [VP8_BINTRAMODES-1] [2]; +void vp8_kf_default_bmode_probs(vp8_prob p [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES - 1]) { + unsigned int branch_ct [VP8_BINTRAMODES - 1] [2]; - int i = 0; + int i = 0; - do - { - int j = 0; + do { + int j = 0; - do - { - intra_bmode_probs_from_distribution( - p[i][j], branch_ct, vp8_kf_default_bmode_counts[i][j]); + do { + intra_bmode_probs_from_distribution( + p[i][j], branch_ct, vp8_kf_default_bmode_counts[i][j]); - } - while (++j < VP8_BINTRAMODES); - } - while (++i < VP8_BINTRAMODES); + } while (++j < VP8_BINTRAMODES); + } while (++i < VP8_BINTRAMODES); } -void vp8_entropy_mode_init() -{ - vp8_tokens_from_tree(vp8_bmode_encodings, vp8_bmode_tree); - vp8_tokens_from_tree(vp8_ymode_encodings, vp8_ymode_tree); - vp8_tokens_from_tree(vp8_kf_ymode_encodings, vp8_kf_ymode_tree); - vp8_tokens_from_tree(vp8_uv_mode_encodings, vp8_uv_mode_tree); - vp8_tokens_from_tree(vp8_i8x8_mode_encodings, vp8_i8x8_mode_tree); - vp8_tokens_from_tree(vp8_mbsplit_encodings, vp8_mbsplit_tree); - - vp8_tokens_from_tree_offset(vp8_mv_ref_encoding_array, - vp8_mv_ref_tree, NEARESTMV); - vp8_tokens_from_tree_offset(vp8_sub_mv_ref_encoding_array, - vp8_sub_mv_ref_tree, LEFT4X4); +void vp8_entropy_mode_init() { + vp8_tokens_from_tree(vp8_bmode_encodings, vp8_bmode_tree); + vp8_tokens_from_tree(vp8_ymode_encodings, vp8_ymode_tree); + vp8_tokens_from_tree(vp8_kf_ymode_encodings, vp8_kf_ymode_tree); + vp8_tokens_from_tree(vp8_uv_mode_encodings, vp8_uv_mode_tree); + vp8_tokens_from_tree(vp8_i8x8_mode_encodings, vp8_i8x8_mode_tree); + vp8_tokens_from_tree(vp8_mbsplit_encodings, vp8_mbsplit_tree); + + vp8_tokens_from_tree_offset(vp8_mv_ref_encoding_array, + vp8_mv_ref_tree, NEARESTMV); + vp8_tokens_from_tree_offset(vp8_sub_mv_ref_encoding_array, + vp8_sub_mv_ref_tree, LEFT4X4); } -void vp8_init_mode_contexts(VP8_COMMON *pc) -{ - vpx_memset(pc->fc.mv_ref_ct, 0, sizeof(pc->fc.mv_ref_ct)); - vpx_memset(pc->fc.mv_ref_ct_a, 0, sizeof(pc->fc.mv_ref_ct_a)); +void vp8_init_mode_contexts(VP8_COMMON *pc) { + vpx_memset(pc->fc.mv_ref_ct, 0, sizeof(pc->fc.mv_ref_ct)); + vpx_memset(pc->fc.mv_ref_ct_a, 0, sizeof(pc->fc.mv_ref_ct_a)); - vpx_memcpy( pc->fc.mode_context, - default_vp8_mode_contexts, - sizeof (pc->fc.mode_context)); - vpx_memcpy( pc->fc.mode_context_a, - default_vp8_mode_contexts, - sizeof (pc->fc.mode_context_a)); + vpx_memcpy(pc->fc.mode_context, + default_vp8_mode_contexts, + sizeof(pc->fc.mode_context)); + vpx_memcpy(pc->fc.mode_context_a, + default_vp8_mode_contexts, + sizeof(pc->fc.mode_context_a)); } void vp8_accum_mv_refs(VP8_COMMON *pc, MB_PREDICTION_MODE m, - const int ct[4]) -{ - int (*mv_ref_ct)[4][2]; - - if(pc->refresh_alt_ref_frame) - mv_ref_ct = pc->fc.mv_ref_ct_a; - else - mv_ref_ct = pc->fc.mv_ref_ct; - - if (m == ZEROMV) - { - ++mv_ref_ct [ct[0]] [0] [0]; - } - else - { - ++mv_ref_ct [ct[0]] [0] [1]; - if (m == NEARESTMV) - { - ++mv_ref_ct [ct[1]] [1] [0]; - } - else - { - ++mv_ref_ct [ct[1]] [1] [1]; - if (m == NEARMV) - { - ++mv_ref_ct [ct[2]] [2] [0]; - } - else - { - ++mv_ref_ct [ct[2]] [2] [1]; - if (m == NEWMV) - { - ++mv_ref_ct [ct[3]] [3] [0]; - } - else - { - ++mv_ref_ct [ct[3]] [3] [1]; - } - } + const int ct[4]) { + int (*mv_ref_ct)[4][2]; + + if (pc->refresh_alt_ref_frame) + mv_ref_ct = pc->fc.mv_ref_ct_a; + else + mv_ref_ct = pc->fc.mv_ref_ct; + + if (m == ZEROMV) { + ++mv_ref_ct [ct[0]] [0] [0]; + } else { + ++mv_ref_ct [ct[0]] [0] [1]; + if (m == NEARESTMV) { + ++mv_ref_ct [ct[1]] [1] [0]; + } else { + ++mv_ref_ct [ct[1]] [1] [1]; + if (m == NEARMV) { + ++mv_ref_ct [ct[2]] [2] [0]; + } else { + ++mv_ref_ct [ct[2]] [2] [1]; + if (m == NEWMV) { + ++mv_ref_ct [ct[3]] [3] [0]; + } else { + ++mv_ref_ct [ct[3]] [3] [1]; } + } } + } } #define MVREF_COUNT_SAT 20 #define MVREF_MAX_UPDATE_FACTOR 128 -void vp8_update_mode_context(VP8_COMMON *pc) -{ - int i, j; - int (*mv_ref_ct)[4][2]; - int (*mode_context)[4]; - - if(pc->refresh_alt_ref_frame) - { - mv_ref_ct = pc->fc.mv_ref_ct_a; - mode_context = pc->fc.mode_context_a; - } - else - { - mv_ref_ct = pc->fc.mv_ref_ct; - mode_context = pc->fc.mode_context; - } - - for (j = 0; j < 6; j++) - { - for (i = 0; i < 4; i++) - { - int this_prob; - int count = mv_ref_ct[j][i][0] + mv_ref_ct[j][i][1]; +void vp8_update_mode_context(VP8_COMMON *pc) { + int i, j; + int (*mv_ref_ct)[4][2]; + int (*mode_context)[4]; + + if (pc->refresh_alt_ref_frame) { + mv_ref_ct = pc->fc.mv_ref_ct_a; + mode_context = pc->fc.mode_context_a; + } else { + mv_ref_ct = pc->fc.mv_ref_ct; + mode_context = pc->fc.mode_context; + } + + for (j = 0; j < 6; j++) { + for (i = 0; i < 4; i++) { + int this_prob; + int count = mv_ref_ct[j][i][0] + mv_ref_ct[j][i][1]; #if CONFIG_ADAPTIVE_ENTROPY - int factor; - { - this_prob = count > 0 ? 256 * mv_ref_ct[j][i][0] / count : 128; - count = count > MVREF_COUNT_SAT ? MVREF_COUNT_SAT : count; - factor = (MVREF_MAX_UPDATE_FACTOR * count / MVREF_COUNT_SAT); - this_prob = (pc->fc.vp8_mode_contexts[j][i] * (256 - factor) + - this_prob * factor + 128) >> 8; - this_prob = this_prob? (this_prob<255?this_prob:255):1; - mode_context[j][i] = this_prob; - } + int factor; + { + this_prob = count > 0 ? 256 * mv_ref_ct[j][i][0] / count : 128; + count = count > MVREF_COUNT_SAT ? MVREF_COUNT_SAT : count; + factor = (MVREF_MAX_UPDATE_FACTOR * count / MVREF_COUNT_SAT); + this_prob = (pc->fc.vp8_mode_contexts[j][i] * (256 - factor) + + this_prob * factor + 128) >> 8; + this_prob = this_prob ? (this_prob < 255 ? this_prob : 255) : 1; + mode_context[j][i] = this_prob; + } #else - /* preventing rare occurances from skewing the probs */ - if (count>=4) - { - this_prob = 256 * mv_ref_ct[j][i][0] / count; - this_prob = this_prob? (this_prob<255?this_prob:255):1; - mode_context[j][i] = this_prob; - } + /* preventing rare occurances from skewing the probs */ + if (count >= 4) { + this_prob = 256 * mv_ref_ct[j][i][0] / count; + this_prob = this_prob ? (this_prob < 255 ? this_prob : 255) : 1; + mode_context[j][i] = this_prob; + } #endif - } } + } } #include "vp8/common/modecont.h" -void print_mode_contexts(VP8_COMMON *pc) -{ - int j, i; - printf("\n====================\n"); - for(j=0; j<6; j++) - { - for (i = 0; i < 4; i++) - { - printf( "%4d ", pc->fc.mode_context[j][i]); - } - printf("\n"); +void print_mode_contexts(VP8_COMMON *pc) { + int j, i; + printf("\n====================\n"); + for (j = 0; j < 6; j++) { + for (i = 0; i < 4; i++) { + printf("%4d ", pc->fc.mode_context[j][i]); } - printf("====================\n"); - for(j=0; j<6; j++) - { - for (i = 0; i < 4; i++) - { - printf( "%4d ", pc->fc.mode_context_a[j][i]); - } - printf("\n"); + printf("\n"); + } + printf("====================\n"); + for (j = 0; j < 6; j++) { + for (i = 0; i < 4; i++) { + printf("%4d ", pc->fc.mode_context_a[j][i]); } + printf("\n"); + } } -void print_mv_ref_cts(VP8_COMMON *pc) -{ - int j, i; - for(j=0; j<6; j++) - { - for (i = 0; i < 4; i++) - { - printf("(%4d:%4d) ", - pc->fc.mv_ref_ct[j][i][0], - pc->fc.mv_ref_ct[j][i][1]); - } - printf("\n"); +void print_mv_ref_cts(VP8_COMMON *pc) { + int j, i; + for (j = 0; j < 6; j++) { + for (i = 0; i < 4; i++) { + printf("(%4d:%4d) ", + pc->fc.mv_ref_ct[j][i][0], + pc->fc.mv_ref_ct[j][i][1]); } + printf("\n"); + } } #if CONFIG_ADAPTIVE_ENTROPY -//#define MODE_COUNT_TESTING +// #define MODE_COUNT_TESTING #define MODE_COUNT_SAT 16 #define MODE_MAX_UPDATE_FACTOR 128 -void vp8_adapt_mode_probs(VP8_COMMON *cm) -{ - int i, t, count, factor; - unsigned int branch_ct[32][2]; - vp8_prob ymode_probs[VP8_YMODES-1]; - vp8_prob uvmode_probs[VP8_UV_MODES-1]; - vp8_prob bmode_probs[VP8_BINTRAMODES-1]; - vp8_prob i8x8_mode_probs[VP8_I8X8_MODES-1]; - vp8_prob sub_mv_ref_probs[VP8_SUBMVREFS-1]; - vp8_prob mbsplit_probs[VP8_NUMMBSPLITS-1]; +void vp8_adapt_mode_probs(VP8_COMMON *cm) { + int i, t, count, factor; + unsigned int branch_ct[32][2]; + vp8_prob ymode_probs[VP8_YMODES - 1]; + vp8_prob uvmode_probs[VP8_UV_MODES - 1]; + vp8_prob bmode_probs[VP8_BINTRAMODES - 1]; + vp8_prob i8x8_mode_probs[VP8_I8X8_MODES - 1]; + vp8_prob sub_mv_ref_probs[VP8_SUBMVREFS - 1]; + vp8_prob mbsplit_probs[VP8_NUMMBSPLITS - 1]; #ifdef MODE_COUNT_TESTING - printf("static const unsigned int\nymode_counts" - "[VP8_YMODES] = {\n"); - for (t = 0; t<VP8_YMODES; ++t) printf("%d, ", cm->fc.ymode_counts[t]); - printf("};\n"); - printf("static const unsigned int\nuv_mode_counts" - "[VP8_YMODES] [VP8_UV_MODES] = {\n"); - for (i = 0; i < VP8_YMODES; ++i) - { - printf(" {"); - for (t = 0; t < VP8_UV_MODES; ++t) printf("%d, ", cm->fc.uv_mode_counts[i][t]); - printf("},\n"); - } - printf("};\n"); - printf("static const unsigned int\nbmode_counts" - "[VP8_BINTRAMODES] = {\n"); - for (t = 0; t<VP8_BINTRAMODES; ++t) printf("%d, ", cm->fc.bmode_counts[t]); - printf("};\n"); - printf("static const unsigned int\ni8x8_mode_counts" - "[VP8_I8X8_MODES] = {\n"); - for (t = 0; t<VP8_I8X8_MODES; ++t) printf("%d, ", cm->fc.i8x8_mode_counts[t]); - printf("};\n"); - printf("static const unsigned int\nsub_mv_ref_counts" - "[SUBMVREF_COUNT] [VP8_SUBMVREFS] = {\n"); - for (i = 0; i < SUBMVREF_COUNT; ++i) - { - printf(" {"); - for (t = 0; t < VP8_SUBMVREFS; ++t) printf("%d, ", cm->fc.sub_mv_ref_counts[i][t]); - printf("},\n"); - } - printf("};\n"); - printf("static const unsigned int\nmbsplit_counts" - "[VP8_NUMMBSPLITS] = {\n"); - for (t = 0; t<VP8_NUMMBSPLITS; ++t) printf("%d, ", cm->fc.mbsplit_counts[t]); - printf("};\n"); + printf("static const unsigned int\nymode_counts" + "[VP8_YMODES] = {\n"); + for (t = 0; t < VP8_YMODES; ++t) printf("%d, ", cm->fc.ymode_counts[t]); + printf("};\n"); + printf("static const unsigned int\nuv_mode_counts" + "[VP8_YMODES] [VP8_UV_MODES] = {\n"); + for (i = 0; i < VP8_YMODES; ++i) { + printf(" {"); + for (t = 0; t < VP8_UV_MODES; ++t) printf("%d, ", cm->fc.uv_mode_counts[i][t]); + printf("},\n"); + } + printf("};\n"); + printf("static const unsigned int\nbmode_counts" + "[VP8_BINTRAMODES] = {\n"); + for (t = 0; t < VP8_BINTRAMODES; ++t) printf("%d, ", cm->fc.bmode_counts[t]); + printf("};\n"); + printf("static const unsigned int\ni8x8_mode_counts" + "[VP8_I8X8_MODES] = {\n"); + for (t = 0; t < VP8_I8X8_MODES; ++t) printf("%d, ", cm->fc.i8x8_mode_counts[t]); + printf("};\n"); + printf("static const unsigned int\nsub_mv_ref_counts" + "[SUBMVREF_COUNT] [VP8_SUBMVREFS] = {\n"); + for (i = 0; i < SUBMVREF_COUNT; ++i) { + printf(" {"); + for (t = 0; t < VP8_SUBMVREFS; ++t) printf("%d, ", cm->fc.sub_mv_ref_counts[i][t]); + printf("},\n"); + } + printf("};\n"); + printf("static const unsigned int\nmbsplit_counts" + "[VP8_NUMMBSPLITS] = {\n"); + for (t = 0; t < VP8_NUMMBSPLITS; ++t) printf("%d, ", cm->fc.mbsplit_counts[t]); + printf("};\n"); #endif + vp8_tree_probs_from_distribution( + VP8_YMODES, vp8_ymode_encodings, vp8_ymode_tree, + ymode_probs, branch_ct, cm->fc.ymode_counts, + 256, 1); + for (t = 0; t < VP8_YMODES - 1; ++t) { + int prob; + count = branch_ct[t][0] + branch_ct[t][1]; + count = count > MODE_COUNT_SAT ? MODE_COUNT_SAT : count; + factor = (MODE_MAX_UPDATE_FACTOR * count / MODE_COUNT_SAT); + prob = ((int)cm->fc.pre_ymode_prob[t] * (256 - factor) + + (int)ymode_probs[t] * factor + 128) >> 8; + if (prob <= 0) cm->fc.ymode_prob[t] = 1; + else if (prob > 255) cm->fc.ymode_prob[t] = 255; + else cm->fc.ymode_prob[t] = prob; + } + for (i = 0; i < VP8_YMODES; ++i) { vp8_tree_probs_from_distribution( - VP8_YMODES, vp8_ymode_encodings, vp8_ymode_tree, - ymode_probs, branch_ct, cm->fc.ymode_counts, - 256, 1); - for (t=0; t<VP8_YMODES-1; ++t) - { - int prob; - count = branch_ct[t][0] + branch_ct[t][1]; - count = count > MODE_COUNT_SAT ? MODE_COUNT_SAT : count; - factor = (MODE_MAX_UPDATE_FACTOR * count / MODE_COUNT_SAT); - prob = ((int)cm->fc.pre_ymode_prob[t] * (256-factor) + - (int)ymode_probs[t] * factor + 128) >> 8; - if (prob <= 0) cm->fc.ymode_prob[t] = 1; - else if (prob > 255) cm->fc.ymode_prob[t] = 255; - else cm->fc.ymode_prob[t] = prob; - } - for (i = 0; i < VP8_YMODES; ++i) - { - vp8_tree_probs_from_distribution( - VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree, - uvmode_probs, branch_ct, cm->fc.uv_mode_counts[i], - 256, 1); - for (t = 0; t < VP8_UV_MODES-1; ++t) - { - int prob; - count = branch_ct[t][0] + branch_ct[t][1]; - count = count > MODE_COUNT_SAT ? MODE_COUNT_SAT : count; - factor = (MODE_MAX_UPDATE_FACTOR * count / MODE_COUNT_SAT); - prob = ((int)cm->fc.pre_uv_mode_prob[i][t] * (256-factor) + - (int)uvmode_probs[t] * factor + 128) >> 8; - if (prob <= 0) cm->fc.uv_mode_prob[i][t] = 1; - else if (prob > 255) cm->fc.uv_mode_prob[i][t] = 255; - else cm->fc.uv_mode_prob[i][t] = prob; - } - } - vp8_tree_probs_from_distribution( - VP8_BINTRAMODES, vp8_bmode_encodings, vp8_bmode_tree, - bmode_probs, branch_ct, cm->fc.bmode_counts, - 256, 1); - for (t=0; t<VP8_BINTRAMODES-1; ++t) - { - int prob; - count = branch_ct[t][0] + branch_ct[t][1]; - count = count > MODE_COUNT_SAT ? MODE_COUNT_SAT : count; - factor = (MODE_MAX_UPDATE_FACTOR * count / MODE_COUNT_SAT); - prob = ((int)cm->fc.pre_bmode_prob[t] * (256-factor) + - (int)bmode_probs[t] * factor + 128) >> 8; - if (prob <= 0) cm->fc.bmode_prob[t] = 1; - else if (prob > 255) cm->fc.bmode_prob[t] = 255; - else cm->fc.bmode_prob[t] = prob; - } - vp8_tree_probs_from_distribution( - VP8_I8X8_MODES, vp8_i8x8_mode_encodings, vp8_i8x8_mode_tree, - i8x8_mode_probs, branch_ct, cm->fc.i8x8_mode_counts, - 256, 1); - for (t=0; t<VP8_I8X8_MODES-1; ++t) - { - int prob; - count = branch_ct[t][0] + branch_ct[t][1]; - count = count > MODE_COUNT_SAT ? MODE_COUNT_SAT : count; - factor = (MODE_MAX_UPDATE_FACTOR * count / MODE_COUNT_SAT); - prob = ((int)cm->fc.pre_i8x8_mode_prob[t] * (256-factor) + - (int)i8x8_mode_probs[t] * factor + 128) >> 8; - if (prob <= 0) cm->fc.i8x8_mode_prob[t] = 1; - else if (prob > 255) cm->fc.i8x8_mode_prob[t] = 255; - else cm->fc.i8x8_mode_prob[t] = prob; - } - for (i = 0; i < SUBMVREF_COUNT; ++i) - { - vp8_tree_probs_from_distribution( - VP8_SUBMVREFS, vp8_sub_mv_ref_encoding_array, vp8_sub_mv_ref_tree, - sub_mv_ref_probs, branch_ct, cm->fc.sub_mv_ref_counts[i], - 256, 1); - for (t = 0; t < VP8_SUBMVREFS-1; ++t) - { - int prob; - count = branch_ct[t][0] + branch_ct[t][1]; - count = count > MODE_COUNT_SAT ? MODE_COUNT_SAT : count; - factor = (MODE_MAX_UPDATE_FACTOR * count / MODE_COUNT_SAT); - prob = ((int)cm->fc.pre_sub_mv_ref_prob[i][t] * (256-factor) + - (int)sub_mv_ref_probs[t] * factor + 128) >> 8; - if (prob <= 0) cm->fc.sub_mv_ref_prob[i][t] = 1; - else if (prob > 255) cm->fc.sub_mv_ref_prob[i][t] = 255; - else cm->fc.sub_mv_ref_prob[i][t] = prob; - } + VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree, + uvmode_probs, branch_ct, cm->fc.uv_mode_counts[i], + 256, 1); + for (t = 0; t < VP8_UV_MODES - 1; ++t) { + int prob; + count = branch_ct[t][0] + branch_ct[t][1]; + count = count > MODE_COUNT_SAT ? MODE_COUNT_SAT : count; + factor = (MODE_MAX_UPDATE_FACTOR * count / MODE_COUNT_SAT); + prob = ((int)cm->fc.pre_uv_mode_prob[i][t] * (256 - factor) + + (int)uvmode_probs[t] * factor + 128) >> 8; + if (prob <= 0) cm->fc.uv_mode_prob[i][t] = 1; + else if (prob > 255) cm->fc.uv_mode_prob[i][t] = 255; + else cm->fc.uv_mode_prob[i][t] = prob; } + } + vp8_tree_probs_from_distribution( + VP8_BINTRAMODES, vp8_bmode_encodings, vp8_bmode_tree, + bmode_probs, branch_ct, cm->fc.bmode_counts, + 256, 1); + for (t = 0; t < VP8_BINTRAMODES - 1; ++t) { + int prob; + count = branch_ct[t][0] + branch_ct[t][1]; + count = count > MODE_COUNT_SAT ? MODE_COUNT_SAT : count; + factor = (MODE_MAX_UPDATE_FACTOR * count / MODE_COUNT_SAT); + prob = ((int)cm->fc.pre_bmode_prob[t] * (256 - factor) + + (int)bmode_probs[t] * factor + 128) >> 8; + if (prob <= 0) cm->fc.bmode_prob[t] = 1; + else if (prob > 255) cm->fc.bmode_prob[t] = 255; + else cm->fc.bmode_prob[t] = prob; + } + vp8_tree_probs_from_distribution( + VP8_I8X8_MODES, vp8_i8x8_mode_encodings, vp8_i8x8_mode_tree, + i8x8_mode_probs, branch_ct, cm->fc.i8x8_mode_counts, + 256, 1); + for (t = 0; t < VP8_I8X8_MODES - 1; ++t) { + int prob; + count = branch_ct[t][0] + branch_ct[t][1]; + count = count > MODE_COUNT_SAT ? MODE_COUNT_SAT : count; + factor = (MODE_MAX_UPDATE_FACTOR * count / MODE_COUNT_SAT); + prob = ((int)cm->fc.pre_i8x8_mode_prob[t] * (256 - factor) + + (int)i8x8_mode_probs[t] * factor + 128) >> 8; + if (prob <= 0) cm->fc.i8x8_mode_prob[t] = 1; + else if (prob > 255) cm->fc.i8x8_mode_prob[t] = 255; + else cm->fc.i8x8_mode_prob[t] = prob; + } + for (i = 0; i < SUBMVREF_COUNT; ++i) { vp8_tree_probs_from_distribution( - VP8_NUMMBSPLITS, vp8_mbsplit_encodings, vp8_mbsplit_tree, - mbsplit_probs, branch_ct, cm->fc.mbsplit_counts, - 256, 1); - for (t = 0; t < VP8_NUMMBSPLITS-1; ++t) - { - int prob; - count = branch_ct[t][0] + branch_ct[t][1]; - count = count > MODE_COUNT_SAT ? MODE_COUNT_SAT : count; - factor = (MODE_MAX_UPDATE_FACTOR * count / MODE_COUNT_SAT); - prob = ((int)cm->fc.pre_mbsplit_prob[t] * (256 - factor) + - (int)mbsplit_probs[t] * factor + 128) >> 8; - if (prob <= 0) cm->fc.mbsplit_prob[t] = 1; - else if (prob > 255) cm->fc.mbsplit_prob[t] = 255; - else cm->fc.mbsplit_prob[t] = prob; + VP8_SUBMVREFS, vp8_sub_mv_ref_encoding_array, vp8_sub_mv_ref_tree, + sub_mv_ref_probs, branch_ct, cm->fc.sub_mv_ref_counts[i], + 256, 1); + for (t = 0; t < VP8_SUBMVREFS - 1; ++t) { + int prob; + count = branch_ct[t][0] + branch_ct[t][1]; + count = count > MODE_COUNT_SAT ? MODE_COUNT_SAT : count; + factor = (MODE_MAX_UPDATE_FACTOR * count / MODE_COUNT_SAT); + prob = ((int)cm->fc.pre_sub_mv_ref_prob[i][t] * (256 - factor) + + (int)sub_mv_ref_probs[t] * factor + 128) >> 8; + if (prob <= 0) cm->fc.sub_mv_ref_prob[i][t] = 1; + else if (prob > 255) cm->fc.sub_mv_ref_prob[i][t] = 255; + else cm->fc.sub_mv_ref_prob[i][t] = prob; } + } + vp8_tree_probs_from_distribution( + VP8_NUMMBSPLITS, vp8_mbsplit_encodings, vp8_mbsplit_tree, + mbsplit_probs, branch_ct, cm->fc.mbsplit_counts, + 256, 1); + for (t = 0; t < VP8_NUMMBSPLITS - 1; ++t) { + int prob; + count = branch_ct[t][0] + branch_ct[t][1]; + count = count > MODE_COUNT_SAT ? MODE_COUNT_SAT : count; + factor = (MODE_MAX_UPDATE_FACTOR * count / MODE_COUNT_SAT); + prob = ((int)cm->fc.pre_mbsplit_prob[t] * (256 - factor) + + (int)mbsplit_probs[t] * factor + 128) >> 8; + if (prob <= 0) cm->fc.mbsplit_prob[t] = 1; + else if (prob > 255) cm->fc.mbsplit_prob[t] = 255; + else cm->fc.mbsplit_prob[t] = prob; + } } #endif diff --git a/vp8/common/entropymode.h b/vp8/common/entropymode.h index e8f22df9b..5d753f7e3 100644 --- a/vp8/common/entropymode.h +++ b/vp8/common/entropymode.h @@ -21,12 +21,12 @@ extern vp8_mbsplit vp8_mbsplits [VP8_NUMMBSPLITS]; extern const int vp8_mbsplit_count [VP8_NUMMBSPLITS]; /* # of subsets */ -extern const vp8_prob vp8_mbsplit_probs [VP8_NUMMBSPLITS-1]; +extern const vp8_prob vp8_mbsplit_probs [VP8_NUMMBSPLITS - 1]; extern int vp8_mv_cont(const int_mv *l, const int_mv *a); -extern const vp8_prob vp8_sub_mv_ref_prob [VP8_SUBMVREFS-1]; -extern const vp8_prob vp8_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP8_SUBMVREFS-1]; +extern const vp8_prob vp8_sub_mv_ref_prob [VP8_SUBMVREFS - 1]; +extern const vp8_prob vp8_sub_mv_ref_prob2 [SUBMVREF_COUNT][VP8_SUBMVREFS - 1]; extern const unsigned int vp8_kf_default_bmode_counts [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES]; @@ -60,11 +60,11 @@ void vp8_init_mbmode_probs(VP8_COMMON *x); extern void vp8_init_mode_contexts(VP8_COMMON *pc); extern void vp8_update_mode_context(VP8_COMMON *pc);; extern void vp8_accum_mv_refs(VP8_COMMON *pc, - MB_PREDICTION_MODE m, - const int ct[4]); + MB_PREDICTION_MODE m, + const int ct[4]); -void vp8_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES-1]); -void vp8_kf_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1]); +void vp8_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES - 1]); +void vp8_kf_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES - 1]); #if CONFIG_ADAPTIVE_ENTROPY void vp8_adapt_mode_probs(struct VP8Common *); diff --git a/vp8/common/entropymv.c b/vp8/common/entropymv.c index 2c27b0913..6c91e364a 100644 --- a/vp8/common/entropymv.c +++ b/vp8/common/entropymv.c @@ -13,427 +13,403 @@ #include "entropymv.h" #if CONFIG_HIGH_PRECISION_MV -const MV_CONTEXT_HP vp8_mv_update_probs_hp[2] = -{ - {{ - 237, - 246, - 253, 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, - 254, 254, 254, 254, 254, 250, 250, 252, 254, 254, 254 - }}, - {{ - 231, - 243, - 245, 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, - 254, 254, 254, 254, 254, 251, 251, 254, 254, 254, 254 - }} +const MV_CONTEXT_HP vp8_mv_update_probs_hp[2] = { + {{ + 237, + 246, + 253, 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, + 254, 254, 254, 254, 254, 250, 250, 252, 254, 254, 254 + } + }, + {{ + 231, + 243, + 245, 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, + 254, 254, 254, 254, 254, 251, 251, 254, 254, 254, 254 + } + } }; -const MV_CONTEXT_HP vp8_default_mv_context_hp[2] = -{ - {{ - /* row */ - 162, /* is short */ - 128, /* sign */ - 220, 204, 180, 192, 192, 119, 192, 192, 180, 140, 192, 192, 224, 224, 224, /* short tree */ - 128, 129, 132, 75, 145, 178, 206, 239, 254, 254, 254 /* long bits */ - }}, - {{ - /* same for column */ - 164, /* is short */ - 128, - 220, 204, 180, 192, 192, 119, 192, 192, 180, 140, 192, 192, 224, 224, 224, /* short tree */ - 128, 130, 130, 74, 148, 180, 203, 236, 254, 254, 254 /* long bits */ - }} +const MV_CONTEXT_HP vp8_default_mv_context_hp[2] = { + {{ + /* row */ + 162, /* is short */ + 128, /* sign */ + 220, 204, 180, 192, 192, 119, 192, 192, 180, 140, 192, 192, 224, 224, 224, /* short tree */ + 128, 129, 132, 75, 145, 178, 206, 239, 254, 254, 254 /* long bits */ + } + }, + {{ + /* same for column */ + 164, /* is short */ + 128, + 220, 204, 180, 192, 192, 119, 192, 192, 180, 140, 192, 192, 224, 224, 224, /* short tree */ + 128, 130, 130, 74, 148, 180, 203, 236, 254, 254, 254 /* long bits */ + } + } }; #endif /* CONFIG_HIGH_PRECISION_MV */ -const MV_CONTEXT vp8_mv_update_probs[2] = -{ - {{ - 237, - 246, - 253, 253, 254, 254, 254, 254, 254, - 254, 254, 254, 254, 254, 250, 250, 252, 254, 254 - }}, - {{ - 231, - 243, - 245, 253, 254, 254, 254, 254, 254, - 254, 254, 254, 254, 254, 251, 251, 254, 254, 254 - }} +const MV_CONTEXT vp8_mv_update_probs[2] = { + {{ + 237, + 246, + 253, 253, 254, 254, 254, 254, 254, + 254, 254, 254, 254, 254, 250, 250, 252, 254, 254 + } + }, + {{ + 231, + 243, + 245, 253, 254, 254, 254, 254, 254, + 254, 254, 254, 254, 254, 251, 251, 254, 254, 254 + } + } }; -const MV_CONTEXT vp8_default_mv_context[2] = -{ - {{ - /* row */ - 162, /* is short */ - 128, /* sign */ - 225, 146, 172, 147, 214, 39, 156, /* short tree */ - 128, 129, 132, 75, 145, 178, 206, 239, 254, 254 /* long bits */ - }}, - {{ - /* same for column */ - 164, /* is short */ - 128, - 204, 170, 119, 235, 140, 230, 228, - 128, 130, 130, 74, 148, 180, 203, 236, 254, 254 /* long bits */ - }} +const MV_CONTEXT vp8_default_mv_context[2] = { + {{ + /* row */ + 162, /* is short */ + 128, /* sign */ + 225, 146, 172, 147, 214, 39, 156, /* short tree */ + 128, 129, 132, 75, 145, 178, 206, 239, 254, 254 /* long bits */ + } + }, + {{ + /* same for column */ + 164, /* is short */ + 128, + 204, 170, 119, 235, 140, 230, 228, + 128, 130, 130, 74, 148, 180, 203, 236, 254, 254 /* long bits */ + } + } }; #if CONFIG_HIGH_PRECISION_MV -const vp8_tree_index vp8_small_mvtree_hp [30] = -{ - 2, 16, - 4, 10, - 6, 8, - -0, -1, - -2, -3, - 12, 14, - -4, -5, - -6, -7, - 18, 24, - 20, 22, - -8, -9, - -10, -11, - 26, 28, - -12, -13, - -14, -15 +const vp8_tree_index vp8_small_mvtree_hp [30] = { + 2, 16, + 4, 10, + 6, 8, + -0, -1, + -2, -3, + 12, 14, + -4, -5, + -6, -7, + 18, 24, + 20, 22, + -8, -9, + -10, -11, + 26, 28, + -12, -13, + -14, -15 }; struct vp8_token_struct vp8_small_mvencodings_hp [16]; #endif /* CONFIG_HIGH_PRECISION_MV */ -const vp8_tree_index vp8_small_mvtree [14] = -{ - 2, 8, - 4, 6, - -0, -1, - -2, -3, - 10, 12, - -4, -5, - -6, -7 +const vp8_tree_index vp8_small_mvtree [14] = { + 2, 8, + 4, 6, + -0, -1, + -2, -3, + 10, 12, + -4, -5, + -6, -7 }; struct vp8_token_struct vp8_small_mvencodings [8]; -__inline static void calc_prob(vp8_prob *p, const unsigned int ct[2], int pbits) -{ - const unsigned int tot = ct[0] + ct[1]; - if (tot) - { - const vp8_prob x = ((ct[0] * 255) / tot) & -(1<<(8-pbits)); - *p = x ? x : 1; - } +__inline static void calc_prob(vp8_prob *p, const unsigned int ct[2], int pbits) { + const unsigned int tot = ct[0] + ct[1]; + if (tot) { + const vp8_prob x = ((ct[0] * 255) / tot) & -(1 << (8 - pbits)); + *p = x ? x : 1; + } } static void compute_component_probs( - const unsigned int events [MVvals], - vp8_prob Pnew [MVPcount], - unsigned int is_short_ct[2], - unsigned int sign_ct[2], - unsigned int bit_ct [mvlong_width] [2], - unsigned int short_ct [mvnum_short], - unsigned int short_bct [mvnum_short-1] [2] -) -{ - is_short_ct[0] = is_short_ct[1] = 0; - sign_ct[0] = sign_ct[1] = 0; - vpx_memset(bit_ct, 0, sizeof(unsigned int)*mvlong_width*2); - vpx_memset(short_ct, 0, sizeof(unsigned int)*mvnum_short); - vpx_memset(short_bct, 0, sizeof(unsigned int)*(mvnum_short-1)*2); - - { - const int c = events [mv_max]; - is_short_ct [0] += c; // Short vector - short_ct [0] += c; // Magnitude distribution - } - { - int j = 1; - do - { - const int c1 = events [mv_max + j]; //positive - const int c2 = events [mv_max - j]; //negative - const int c = c1 + c2; - int a = j; - - sign_ct [0] += c1; - sign_ct [1] += c2; - - if (a < mvnum_short) - { - is_short_ct [0] += c; // Short vector - short_ct [a] += c; // Magnitude distribution - } - else - { - int k = mvlong_width - 1; - is_short_ct [1] += c; // Long vector - - do - bit_ct [k] [(a >> k) & 1] += c; - - while (--k >= 0); - } - } - while (++j <= mv_max); - } - calc_prob(Pnew + mvpis_short, is_short_ct, 8); - - calc_prob(Pnew + MVPsign, sign_ct, 8); - - { - vp8_prob p [mvnum_short - 1]; /* actually only need branch ct */ - int j = 0; - - vp8_tree_probs_from_distribution( - mvnum_short, vp8_small_mvencodings, vp8_small_mvtree, - p, short_bct, short_ct, - 256, 1 - ); + const unsigned int events [MVvals], + vp8_prob Pnew [MVPcount], + unsigned int is_short_ct[2], + unsigned int sign_ct[2], + unsigned int bit_ct [mvlong_width] [2], + unsigned int short_ct [mvnum_short], + unsigned int short_bct [mvnum_short - 1] [2] +) { + is_short_ct[0] = is_short_ct[1] = 0; + sign_ct[0] = sign_ct[1] = 0; + vpx_memset(bit_ct, 0, sizeof(unsigned int)*mvlong_width * 2); + vpx_memset(short_ct, 0, sizeof(unsigned int)*mvnum_short); + vpx_memset(short_bct, 0, sizeof(unsigned int) * (mvnum_short - 1) * 2); + + { + const int c = events [mv_max]; + is_short_ct [0] += c; // Short vector + short_ct [0] += c; // Magnitude distribution + } + { + int j = 1; + do { + const int c1 = events [mv_max + j]; // positive + const int c2 = events [mv_max - j]; // negative + const int c = c1 + c2; + int a = j; + + sign_ct [0] += c1; + sign_ct [1] += c2; + + if (a < mvnum_short) { + is_short_ct [0] += c; // Short vector + short_ct [a] += c; // Magnitude distribution + } else { + int k = mvlong_width - 1; + is_short_ct [1] += c; // Long vector do - calc_prob(Pnew + MVPshort + j, short_bct[j], 8); - while (++j < mvnum_short - 1); - } - - { - int j = 0; - do - calc_prob(Pnew + MVPbits + j, bit_ct[j], 8); - while (++j < mvlong_width); - } + bit_ct [k] [(a >> k) & 1] += c; + + while (--k >= 0); + } + } while (++j <= mv_max); + } + calc_prob(Pnew + mvpis_short, is_short_ct, 8); + + calc_prob(Pnew + MVPsign, sign_ct, 8); + + { + vp8_prob p [mvnum_short - 1]; /* actually only need branch ct */ + int j = 0; + + vp8_tree_probs_from_distribution( + mvnum_short, vp8_small_mvencodings, vp8_small_mvtree, + p, short_bct, short_ct, + 256, 1 + ); + + do + calc_prob(Pnew + MVPshort + j, short_bct[j], 8); + while (++j < mvnum_short - 1); + } + + { + int j = 0; + do + calc_prob(Pnew + MVPbits + j, bit_ct[j], 8); + while (++j < mvlong_width); + } } #if CONFIG_HIGH_PRECISION_MV static void compute_component_probs_hp( - const unsigned int events [MVvals_hp], - vp8_prob Pnew [MVPcount_hp], - unsigned int is_short_ct[2], - unsigned int sign_ct[2], - unsigned int bit_ct [mvlong_width_hp] [2], - unsigned int short_ct [mvnum_short_hp], - unsigned int short_bct [mvnum_short_hp-1] [2] -) -{ - is_short_ct[0] = is_short_ct[1] = 0; - sign_ct[0] = sign_ct[1] = 0; - vpx_memset(bit_ct, 0, sizeof(unsigned int)*mvlong_width_hp*2); - vpx_memset(short_ct, 0, sizeof(unsigned int)*mvnum_short_hp); - vpx_memset(short_bct, 0, sizeof(unsigned int)*(mvnum_short_hp-1)*2); - - { - const int c = events [mv_max_hp]; - is_short_ct [0] += c; // Short vector - short_ct [0] += c; // Magnitude distribution - } - { - int j = 1; - do - { - const int c1 = events [mv_max_hp + j]; //positive - const int c2 = events [mv_max_hp - j]; //negative - const int c = c1 + c2; - int a = j; - - sign_ct [0] += c1; - sign_ct [1] += c2; - - if (a < mvnum_short_hp) - { - is_short_ct [0] += c; // Short vector - short_ct [a] += c; // Magnitude distribution - } - else - { - int k = mvlong_width_hp - 1; - is_short_ct [1] += c; // Long vector - - do - bit_ct [k] [(a >> k) & 1] += c; - - while (--k >= 0); - } - } - while (++j <= mv_max_hp); - } - calc_prob(Pnew + mvpis_short_hp, is_short_ct, 8); - - calc_prob(Pnew + MVPsign_hp, sign_ct, 8); - - { - vp8_prob p [mvnum_short_hp - 1]; /* actually only need branch ct */ - int j = 0; + const unsigned int events [MVvals_hp], + vp8_prob Pnew [MVPcount_hp], + unsigned int is_short_ct[2], + unsigned int sign_ct[2], + unsigned int bit_ct [mvlong_width_hp] [2], + unsigned int short_ct [mvnum_short_hp], + unsigned int short_bct [mvnum_short_hp - 1] [2] +) { + is_short_ct[0] = is_short_ct[1] = 0; + sign_ct[0] = sign_ct[1] = 0; + vpx_memset(bit_ct, 0, sizeof(unsigned int)*mvlong_width_hp * 2); + vpx_memset(short_ct, 0, sizeof(unsigned int)*mvnum_short_hp); + vpx_memset(short_bct, 0, sizeof(unsigned int) * (mvnum_short_hp - 1) * 2); + + { + const int c = events [mv_max_hp]; + is_short_ct [0] += c; // Short vector + short_ct [0] += c; // Magnitude distribution + } + { + int j = 1; + do { + const int c1 = events [mv_max_hp + j]; // positive + const int c2 = events [mv_max_hp - j]; // negative + const int c = c1 + c2; + int a = j; + + sign_ct [0] += c1; + sign_ct [1] += c2; + + if (a < mvnum_short_hp) { + is_short_ct [0] += c; // Short vector + short_ct [a] += c; // Magnitude distribution + } else { + int k = mvlong_width_hp - 1; + is_short_ct [1] += c; // Long vector - vp8_tree_probs_from_distribution( - mvnum_short_hp, vp8_small_mvencodings_hp, vp8_small_mvtree_hp, - p, short_bct, short_ct, - 256, 1 - ); - - do - calc_prob(Pnew + MVPshort_hp + j, short_bct[j], 8); - while (++j < mvnum_short_hp - 1); - } - - { - int j = 0; do - calc_prob(Pnew + MVPbits_hp + j, bit_ct[j], 8); - while (++j < mvlong_width_hp); - } + bit_ct [k] [(a >> k) & 1] += c; + + while (--k >= 0); + } + } while (++j <= mv_max_hp); + } + calc_prob(Pnew + mvpis_short_hp, is_short_ct, 8); + + calc_prob(Pnew + MVPsign_hp, sign_ct, 8); + + { + vp8_prob p [mvnum_short_hp - 1]; /* actually only need branch ct */ + int j = 0; + + vp8_tree_probs_from_distribution( + mvnum_short_hp, vp8_small_mvencodings_hp, vp8_small_mvtree_hp, + p, short_bct, short_ct, + 256, 1 + ); + + do + calc_prob(Pnew + MVPshort_hp + j, short_bct[j], 8); + while (++j < mvnum_short_hp - 1); + } + + { + int j = 0; + do + calc_prob(Pnew + MVPbits_hp + j, bit_ct[j], 8); + while (++j < mvlong_width_hp); + } } #endif /* CONFIG_HIGH_PRECISION_MV */ -void vp8_entropy_mv_init() -{ - vp8_tokens_from_tree(vp8_small_mvencodings, vp8_small_mvtree); +void vp8_entropy_mv_init() { + vp8_tokens_from_tree(vp8_small_mvencodings, vp8_small_mvtree); #if CONFIG_HIGH_PRECISION_MV - vp8_tokens_from_tree(vp8_small_mvencodings_hp, vp8_small_mvtree_hp); + vp8_tokens_from_tree(vp8_small_mvencodings_hp, vp8_small_mvtree_hp); #endif } #if CONFIG_ADAPTIVE_ENTROPY -//#define MV_COUNT_TESTING +// #define MV_COUNT_TESTING #define MV_COUNT_SAT 16 #define MV_MAX_UPDATE_FACTOR 128 -void vp8_adapt_mv_probs(VP8_COMMON *cm) -{ - int i, t, count, factor; +void vp8_adapt_mv_probs(VP8_COMMON *cm) { + int i, t, count, factor; #ifdef MV_COUNT_TESTING - printf("static const unsigned int\nMVcount[2][MVvals]={\n"); - for (i = 0; i < 2; ++i) - { - printf(" { "); - for (t = 0; t < MVvals; t++) - { - printf("%d, ", cm->fc.MVcount[i][t]); - if (t%16 == 15 && t!=MVvals-1) printf("\n "); - } - printf("},\n"); + printf("static const unsigned int\nMVcount[2][MVvals]={\n"); + for (i = 0; i < 2; ++i) { + printf(" { "); + for (t = 0; t < MVvals; t++) { + printf("%d, ", cm->fc.MVcount[i][t]); + if (t % 16 == 15 && t != MVvals - 1) printf("\n "); } - printf("};\n"); + printf("},\n"); + } + printf("};\n"); #if CONFIG_HIGH_PRECISION_MV - printf("static const unsigned int\nMVcount_hp[2][MVvals_hp]={\n"); - for (i = 0; i < 2; ++i) - { - printf(" { "); - for (t = 0; t < MVvals_hp; t++) - { - printf("%d, ", cm->fc.MVcount_hp[i][t]); - if (t%16 == 15 && t!=MVvals_hp-1) printf("\n "); - } - printf("},\n"); + printf("static const unsigned int\nMVcount_hp[2][MVvals_hp]={\n"); + for (i = 0; i < 2; ++i) { + printf(" { "); + for (t = 0; t < MVvals_hp; t++) { + printf("%d, ", cm->fc.MVcount_hp[i][t]); + if (t % 16 == 15 && t != MVvals_hp - 1) printf("\n "); } - printf("};\n"); + printf("},\n"); + } + printf("};\n"); #endif #endif /* MV_COUNT_TESTING */ - for (i = 0; i < 2; ++i) - { - int prob; - unsigned int is_short_ct[2]; - unsigned int sign_ct[2]; - unsigned int bit_ct [mvlong_width] [2]; - unsigned int short_ct [mvnum_short]; - unsigned int short_bct [mvnum_short-1] [2]; - vp8_prob Pnew [MVPcount]; - compute_component_probs(cm->fc.MVcount[i], Pnew, - is_short_ct, sign_ct, - bit_ct, short_ct, short_bct); - count = is_short_ct[0] + is_short_ct[1]; - count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count; - factor = (MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT); - prob = ((int)cm->fc.pre_mvc[i].prob[mvpis_short] * (256-factor) + - (int)Pnew[mvpis_short] * factor + 128) >> 8; - if (prob <= 0) cm->fc.mvc[i].prob[mvpis_short] = 1; - else if (prob > 255) cm->fc.mvc[i].prob[mvpis_short] = 255; - else cm->fc.mvc[i].prob[mvpis_short] = prob; - - count = sign_ct[0] + sign_ct[1]; - count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count; - factor = (MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT); - prob = ((int)cm->fc.pre_mvc[i].prob[MVPsign] * (256-factor) + - (int)Pnew[MVPsign] * factor + 128) >> 8; - if (prob <= 0) cm->fc.mvc[i].prob[MVPsign] = 1; - else if (prob > 255) cm->fc.mvc[i].prob[MVPsign] = 255; - else cm->fc.mvc[i].prob[MVPsign] = prob; - - for (t = 0; t < mvnum_short - 1; ++t) - { - count = short_bct[t][0] + short_bct[t][1]; - count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count; - factor = (MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT); - prob = ((int)cm->fc.pre_mvc[i].prob[MVPshort+t] * (256-factor) + - (int)Pnew[MVPshort+t] * factor + 128) >> 8; - if (prob <= 0) cm->fc.mvc[i].prob[MVPshort+t] = 1; - else if (prob > 255) cm->fc.mvc[i].prob[MVPshort+t] = 255; - else cm->fc.mvc[i].prob[MVPshort+t] = prob; - } - for (t = 0; t < mvlong_width; ++t) - { - count = bit_ct[t][0] + bit_ct[t][1]; - count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count; - factor = (MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT); - prob = ((int)cm->fc.pre_mvc[i].prob[MVPbits+t] * (256-factor) + - (int)Pnew[MVPbits+t] * factor + 128) >> 8; - if (prob <= 0) cm->fc.mvc[i].prob[MVPbits+t] = 1; - else if (prob > 255) cm->fc.mvc[i].prob[MVPbits+t] = 255; - else cm->fc.mvc[i].prob[MVPbits+t] = prob; - } + for (i = 0; i < 2; ++i) { + int prob; + unsigned int is_short_ct[2]; + unsigned int sign_ct[2]; + unsigned int bit_ct [mvlong_width] [2]; + unsigned int short_ct [mvnum_short]; + unsigned int short_bct [mvnum_short - 1] [2]; + vp8_prob Pnew [MVPcount]; + compute_component_probs(cm->fc.MVcount[i], Pnew, + is_short_ct, sign_ct, + bit_ct, short_ct, short_bct); + count = is_short_ct[0] + is_short_ct[1]; + count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count; + factor = (MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT); + prob = ((int)cm->fc.pre_mvc[i].prob[mvpis_short] * (256 - factor) + + (int)Pnew[mvpis_short] * factor + 128) >> 8; + if (prob <= 0) cm->fc.mvc[i].prob[mvpis_short] = 1; + else if (prob > 255) cm->fc.mvc[i].prob[mvpis_short] = 255; + else cm->fc.mvc[i].prob[mvpis_short] = prob; + + count = sign_ct[0] + sign_ct[1]; + count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count; + factor = (MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT); + prob = ((int)cm->fc.pre_mvc[i].prob[MVPsign] * (256 - factor) + + (int)Pnew[MVPsign] * factor + 128) >> 8; + if (prob <= 0) cm->fc.mvc[i].prob[MVPsign] = 1; + else if (prob > 255) cm->fc.mvc[i].prob[MVPsign] = 255; + else cm->fc.mvc[i].prob[MVPsign] = prob; + + for (t = 0; t < mvnum_short - 1; ++t) { + count = short_bct[t][0] + short_bct[t][1]; + count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count; + factor = (MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT); + prob = ((int)cm->fc.pre_mvc[i].prob[MVPshort + t] * (256 - factor) + + (int)Pnew[MVPshort + t] * factor + 128) >> 8; + if (prob <= 0) cm->fc.mvc[i].prob[MVPshort + t] = 1; + else if (prob > 255) cm->fc.mvc[i].prob[MVPshort + t] = 255; + else cm->fc.mvc[i].prob[MVPshort + t] = prob; + } + for (t = 0; t < mvlong_width; ++t) { + count = bit_ct[t][0] + bit_ct[t][1]; + count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count; + factor = (MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT); + prob = ((int)cm->fc.pre_mvc[i].prob[MVPbits + t] * (256 - factor) + + (int)Pnew[MVPbits + t] * factor + 128) >> 8; + if (prob <= 0) cm->fc.mvc[i].prob[MVPbits + t] = 1; + else if (prob > 255) cm->fc.mvc[i].prob[MVPbits + t] = 255; + else cm->fc.mvc[i].prob[MVPbits + t] = prob; } + } #if CONFIG_HIGH_PRECISION_MV - for (i = 0; i < 2; ++i) - { - int prob; - unsigned int is_short_ct[2]; - unsigned int sign_ct[2]; - unsigned int bit_ct [mvlong_width_hp] [2]; - unsigned int short_ct [mvnum_short_hp]; - unsigned int short_bct [mvnum_short_hp-1] [2]; - vp8_prob Pnew [MVPcount_hp]; - compute_component_probs_hp(cm->fc.MVcount_hp[i], Pnew, - is_short_ct, sign_ct, - bit_ct, short_ct, short_bct); - count = is_short_ct[0] + is_short_ct[1]; - count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count; - factor = (MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT); - prob = ((int)cm->fc.pre_mvc_hp[i].prob[mvpis_short_hp] * (256-factor) + - (int)Pnew[mvpis_short_hp] * factor + 128) >> 8; - if (prob <= 0) cm->fc.mvc_hp[i].prob[mvpis_short_hp] = 1; - else if (prob > 255) cm->fc.mvc_hp[i].prob[mvpis_short_hp] = 255; - else cm->fc.mvc_hp[i].prob[mvpis_short_hp] = prob; - - count = sign_ct[0] + sign_ct[1]; - count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count; - factor = (MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT); - prob = ((int)cm->fc.pre_mvc_hp[i].prob[MVPsign_hp] * (256-factor) + - (int)Pnew[MVPsign_hp] * factor + 128) >> 8; - if (prob <= 0) cm->fc.mvc_hp[i].prob[MVPsign_hp] = 1; - else if (prob > 255) cm->fc.mvc_hp[i].prob[MVPsign_hp] = 255; - else cm->fc.mvc_hp[i].prob[MVPsign_hp] = prob; - - for (t = 0; t < mvnum_short_hp - 1; ++t) - { - count = short_bct[t][0] + short_bct[t][1]; - count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count; - factor = (MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT); - prob = ((int)cm->fc.pre_mvc_hp[i].prob[MVPshort_hp+t] * (256-factor) + - (int)Pnew[MVPshort_hp+t] * factor + 128) >> 8; - if (prob <= 0) cm->fc.mvc_hp[i].prob[MVPshort_hp+t] = 1; - else if (prob > 255) cm->fc.mvc_hp[i].prob[MVPshort_hp+t] = 255; - else cm->fc.mvc_hp[i].prob[MVPshort_hp+t] = prob; - } - for (t = 0; t < mvlong_width_hp; ++t) - { - count = bit_ct[t][0] + bit_ct[t][1]; - count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count; - factor = (MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT); - prob = ((int)cm->fc.pre_mvc_hp[i].prob[MVPbits_hp+t] * (256-factor) + - (int)Pnew[MVPbits_hp+t] * factor + 128) >> 8; - if (prob <= 0) cm->fc.mvc_hp[i].prob[MVPbits_hp+t] = 1; - else if (prob > 255) cm->fc.mvc_hp[i].prob[MVPbits_hp+t] = 255; - else cm->fc.mvc_hp[i].prob[MVPbits_hp+t] = prob; - } + for (i = 0; i < 2; ++i) { + int prob; + unsigned int is_short_ct[2]; + unsigned int sign_ct[2]; + unsigned int bit_ct [mvlong_width_hp] [2]; + unsigned int short_ct [mvnum_short_hp]; + unsigned int short_bct [mvnum_short_hp - 1] [2]; + vp8_prob Pnew [MVPcount_hp]; + compute_component_probs_hp(cm->fc.MVcount_hp[i], Pnew, + is_short_ct, sign_ct, + bit_ct, short_ct, short_bct); + count = is_short_ct[0] + is_short_ct[1]; + count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count; + factor = (MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT); + prob = ((int)cm->fc.pre_mvc_hp[i].prob[mvpis_short_hp] * (256 - factor) + + (int)Pnew[mvpis_short_hp] * factor + 128) >> 8; + if (prob <= 0) cm->fc.mvc_hp[i].prob[mvpis_short_hp] = 1; + else if (prob > 255) cm->fc.mvc_hp[i].prob[mvpis_short_hp] = 255; + else cm->fc.mvc_hp[i].prob[mvpis_short_hp] = prob; + + count = sign_ct[0] + sign_ct[1]; + count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count; + factor = (MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT); + prob = ((int)cm->fc.pre_mvc_hp[i].prob[MVPsign_hp] * (256 - factor) + + (int)Pnew[MVPsign_hp] * factor + 128) >> 8; + if (prob <= 0) cm->fc.mvc_hp[i].prob[MVPsign_hp] = 1; + else if (prob > 255) cm->fc.mvc_hp[i].prob[MVPsign_hp] = 255; + else cm->fc.mvc_hp[i].prob[MVPsign_hp] = prob; + + for (t = 0; t < mvnum_short_hp - 1; ++t) { + count = short_bct[t][0] + short_bct[t][1]; + count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count; + factor = (MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT); + prob = ((int)cm->fc.pre_mvc_hp[i].prob[MVPshort_hp + t] * (256 - factor) + + (int)Pnew[MVPshort_hp + t] * factor + 128) >> 8; + if (prob <= 0) cm->fc.mvc_hp[i].prob[MVPshort_hp + t] = 1; + else if (prob > 255) cm->fc.mvc_hp[i].prob[MVPshort_hp + t] = 255; + else cm->fc.mvc_hp[i].prob[MVPshort_hp + t] = prob; + } + for (t = 0; t < mvlong_width_hp; ++t) { + count = bit_ct[t][0] + bit_ct[t][1]; + count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count; + factor = (MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT); + prob = ((int)cm->fc.pre_mvc_hp[i].prob[MVPbits_hp + t] * (256 - factor) + + (int)Pnew[MVPbits_hp + t] * factor + 128) >> 8; + if (prob <= 0) cm->fc.mvc_hp[i].prob[MVPbits_hp + t] = 1; + else if (prob > 255) cm->fc.mvc_hp[i].prob[MVPbits_hp + t] = 255; + else cm->fc.mvc_hp[i].prob[MVPbits_hp + t] = prob; } + } #endif } #endif /* CONFIG_ADAPTIVE_ENTROPY */ diff --git a/vp8/common/entropymv.h b/vp8/common/entropymv.h index 09c2587d2..96ea7ffae 100644 --- a/vp8/common/entropymv.h +++ b/vp8/common/entropymv.h @@ -15,59 +15,55 @@ #include "treecoder.h" #include "vpx_config.h" -enum -{ - mv_max = 1023, /* max absolute value of a MV component */ - MVvals = (2 * mv_max) + 1, /* # possible values "" */ - mvlong_width = 10, /* Large MVs have 9 bit magnitudes */ - mvnum_short = 8, /* magnitudes 0 through 7 */ - mvnum_short_bits = 3, /* number of bits for short mvs */ +enum { + mv_max = 1023, /* max absolute value of a MV component */ + MVvals = (2 * mv_max) + 1, /* # possible values "" */ + mvlong_width = 10, /* Large MVs have 9 bit magnitudes */ + mvnum_short = 8, /* magnitudes 0 through 7 */ + mvnum_short_bits = 3, /* number of bits for short mvs */ - mvfp_max = 255, /* max absolute value of a full pixel MV component */ - MVfpvals = (2 * mvfp_max) + 1, /* # possible full pixel MV values */ + mvfp_max = 255, /* max absolute value of a full pixel MV component */ + MVfpvals = (2 * mvfp_max) + 1, /* # possible full pixel MV values */ - /* probability offsets for coding each MV component */ + /* probability offsets for coding each MV component */ - mvpis_short = 0, /* short (<= 7) vs long (>= 8) */ - MVPsign, /* sign for non-zero */ - MVPshort, /* 8 short values = 7-position tree */ + mvpis_short = 0, /* short (<= 7) vs long (>= 8) */ + MVPsign, /* sign for non-zero */ + MVPshort, /* 8 short values = 7-position tree */ - MVPbits = MVPshort + mvnum_short - 1, /* mvlong_width long value bits */ - MVPcount = MVPbits + mvlong_width /* (with independent probabilities) */ + MVPbits = MVPshort + mvnum_short - 1, /* mvlong_width long value bits */ + MVPcount = MVPbits + mvlong_width /* (with independent probabilities) */ }; -typedef struct mv_context -{ - vp8_prob prob[MVPcount]; /* often come in row, col pairs */ +typedef struct mv_context { + vp8_prob prob[MVPcount]; /* often come in row, col pairs */ } MV_CONTEXT; extern const MV_CONTEXT vp8_mv_update_probs[2], vp8_default_mv_context[2]; #if CONFIG_HIGH_PRECISION_MV -enum -{ - mv_max_hp = 2047, /* max absolute value of a MV component */ - MVvals_hp = (2 * mv_max_hp) + 1, /* # possible values "" */ - mvlong_width_hp = 11, /* Large MVs have 9 bit magnitudes */ - mvnum_short_hp = 16, /* magnitudes 0 through 15 */ - mvnum_short_bits_hp = 4, /* number of bits for short mvs */ +enum { + mv_max_hp = 2047, /* max absolute value of a MV component */ + MVvals_hp = (2 * mv_max_hp) + 1, /* # possible values "" */ + mvlong_width_hp = 11, /* Large MVs have 9 bit magnitudes */ + mvnum_short_hp = 16, /* magnitudes 0 through 15 */ + mvnum_short_bits_hp = 4, /* number of bits for short mvs */ - mvfp_max_hp = 255, /* max absolute value of a full pixel MV component */ - MVfpvals_hp = (2 * mvfp_max_hp) + 1, /* # possible full pixel MV values */ + mvfp_max_hp = 255, /* max absolute value of a full pixel MV component */ + MVfpvals_hp = (2 * mvfp_max_hp) + 1, /* # possible full pixel MV values */ - /* probability offsets for coding each MV component */ + /* probability offsets for coding each MV component */ - mvpis_short_hp = 0, /* short (<= 7) vs long (>= 8) */ - MVPsign_hp, /* sign for non-zero */ - MVPshort_hp, /* 8 short values = 7-position tree */ + mvpis_short_hp = 0, /* short (<= 7) vs long (>= 8) */ + MVPsign_hp, /* sign for non-zero */ + MVPshort_hp, /* 8 short values = 7-position tree */ - MVPbits_hp = MVPshort_hp + mvnum_short_hp - 1, /* mvlong_width long value bits */ - MVPcount_hp = MVPbits_hp + mvlong_width_hp /* (with independent probabilities) */ + MVPbits_hp = MVPshort_hp + mvnum_short_hp - 1, /* mvlong_width long value bits */ + MVPcount_hp = MVPbits_hp + mvlong_width_hp /* (with independent probabilities) */ }; -typedef struct mv_context_hp -{ - vp8_prob prob[MVPcount_hp]; /* often come in row, col pairs */ +typedef struct mv_context_hp { + vp8_prob prob[MVPcount_hp]; /* often come in row, col pairs */ } MV_CONTEXT_HP; extern const MV_CONTEXT_HP vp8_mv_update_probs_hp[2], vp8_default_mv_context_hp[2]; diff --git a/vp8/common/extend.c b/vp8/common/extend.c index 9089e1629..6ea745605 100644 --- a/vp8/common/extend.c +++ b/vp8/common/extend.c @@ -15,171 +15,162 @@ static void copy_and_extend_plane ( - unsigned char *s, /* source */ - int sp, /* source pitch */ - unsigned char *d, /* destination */ - int dp, /* destination pitch */ - int h, /* height */ - int w, /* width */ - int et, /* extend top border */ - int el, /* extend left border */ - int eb, /* extend bottom border */ - int er /* extend right border */ -) -{ - int i; - unsigned char *src_ptr1, *src_ptr2; - unsigned char *dest_ptr1, *dest_ptr2; - int linesize; - - /* copy the left and right most columns out */ - src_ptr1 = s; - src_ptr2 = s + w - 1; - dest_ptr1 = d - el; - dest_ptr2 = d + w; - - for (i = 0; i < h; i++) - { - vpx_memset(dest_ptr1, src_ptr1[0], el); - vpx_memcpy(dest_ptr1 + el, src_ptr1, w); - vpx_memset(dest_ptr2, src_ptr2[0], er); - src_ptr1 += sp; - src_ptr2 += sp; - dest_ptr1 += dp; - dest_ptr2 += dp; - } - - /* Now copy the top and bottom lines into each line of the respective - * borders - */ - src_ptr1 = d - el; - src_ptr2 = d + dp * (h - 1) - el; - dest_ptr1 = d + dp * (-et) - el; - dest_ptr2 = d + dp * (h) - el; - linesize = el + er + w; - - for (i = 0; i < et; i++) - { - vpx_memcpy(dest_ptr1, src_ptr1, linesize); - dest_ptr1 += dp; - } - - for (i = 0; i < eb; i++) - { - vpx_memcpy(dest_ptr2, src_ptr2, linesize); - dest_ptr2 += dp; - } + unsigned char *s, /* source */ + int sp, /* source pitch */ + unsigned char *d, /* destination */ + int dp, /* destination pitch */ + int h, /* height */ + int w, /* width */ + int et, /* extend top border */ + int el, /* extend left border */ + int eb, /* extend bottom border */ + int er /* extend right border */ +) { + int i; + unsigned char *src_ptr1, *src_ptr2; + unsigned char *dest_ptr1, *dest_ptr2; + int linesize; + + /* copy the left and right most columns out */ + src_ptr1 = s; + src_ptr2 = s + w - 1; + dest_ptr1 = d - el; + dest_ptr2 = d + w; + + for (i = 0; i < h; i++) { + vpx_memset(dest_ptr1, src_ptr1[0], el); + vpx_memcpy(dest_ptr1 + el, src_ptr1, w); + vpx_memset(dest_ptr2, src_ptr2[0], er); + src_ptr1 += sp; + src_ptr2 += sp; + dest_ptr1 += dp; + dest_ptr2 += dp; + } + + /* Now copy the top and bottom lines into each line of the respective + * borders + */ + src_ptr1 = d - el; + src_ptr2 = d + dp * (h - 1) - el; + dest_ptr1 = d + dp * (-et) - el; + dest_ptr2 = d + dp * (h) - el; + linesize = el + er + w; + + for (i = 0; i < et; i++) { + vpx_memcpy(dest_ptr1, src_ptr1, linesize); + dest_ptr1 += dp; + } + + for (i = 0; i < eb; i++) { + vpx_memcpy(dest_ptr2, src_ptr2, linesize); + dest_ptr2 += dp; + } } void vp8_copy_and_extend_frame(YV12_BUFFER_CONFIG *src, - YV12_BUFFER_CONFIG *dst) -{ - int et = dst->border; - int el = dst->border; - int eb = dst->border + dst->y_height - src->y_height; - int er = dst->border + dst->y_width - src->y_width; - - copy_and_extend_plane(src->y_buffer, src->y_stride, - dst->y_buffer, dst->y_stride, - src->y_height, src->y_width, - et, el, eb, er); - - et = dst->border >> 1; - el = dst->border >> 1; - eb = (dst->border >> 1) + dst->uv_height - src->uv_height; - er = (dst->border >> 1) + dst->uv_width - src->uv_width; - - copy_and_extend_plane(src->u_buffer, src->uv_stride, - dst->u_buffer, dst->uv_stride, - src->uv_height, src->uv_width, - et, el, eb, er); - - copy_and_extend_plane(src->v_buffer, src->uv_stride, - dst->v_buffer, dst->uv_stride, - src->uv_height, src->uv_width, - et, el, eb, er); + YV12_BUFFER_CONFIG *dst) { + int et = dst->border; + int el = dst->border; + int eb = dst->border + dst->y_height - src->y_height; + int er = dst->border + dst->y_width - src->y_width; + + copy_and_extend_plane(src->y_buffer, src->y_stride, + dst->y_buffer, dst->y_stride, + src->y_height, src->y_width, + et, el, eb, er); + + et = dst->border >> 1; + el = dst->border >> 1; + eb = (dst->border >> 1) + dst->uv_height - src->uv_height; + er = (dst->border >> 1) + dst->uv_width - src->uv_width; + + copy_and_extend_plane(src->u_buffer, src->uv_stride, + dst->u_buffer, dst->uv_stride, + src->uv_height, src->uv_width, + et, el, eb, er); + + copy_and_extend_plane(src->v_buffer, src->uv_stride, + dst->v_buffer, dst->uv_stride, + src->uv_height, src->uv_width, + et, el, eb, er); } void vp8_copy_and_extend_frame_with_rect(YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst, int srcy, int srcx, - int srch, int srcw) -{ - int et = dst->border; - int el = dst->border; - int eb = dst->border + dst->y_height - src->y_height; - int er = dst->border + dst->y_width - src->y_width; - int src_y_offset = srcy * src->y_stride + srcx; - int dst_y_offset = srcy * dst->y_stride + srcx; - int src_uv_offset = ((srcy * src->uv_stride) >> 1) + (srcx >> 1); - int dst_uv_offset = ((srcy * dst->uv_stride) >> 1) + (srcx >> 1); - - // If the side is not touching the bounder then don't extend. - if (srcy) - et = 0; - if (srcx) - el = 0; - if (srcy + srch != src->y_height) - eb = 0; - if (srcx + srcw != src->y_width) - er = 0; - - copy_and_extend_plane(src->y_buffer + src_y_offset, - src->y_stride, - dst->y_buffer + dst_y_offset, - dst->y_stride, - srch, srcw, - et, el, eb, er); - - et = (et + 1) >> 1; - el = (el + 1) >> 1; - eb = (eb + 1) >> 1; - er = (er + 1) >> 1; - srch = (srch + 1) >> 1; - srcw = (srcw + 1) >> 1; - - copy_and_extend_plane(src->u_buffer + src_uv_offset, - src->uv_stride, - dst->u_buffer + dst_uv_offset, - dst->uv_stride, - srch, srcw, - et, el, eb, er); - - copy_and_extend_plane(src->v_buffer + src_uv_offset, - src->uv_stride, - dst->v_buffer + dst_uv_offset, - dst->uv_stride, - srch, srcw, - et, el, eb, er); + int srch, int srcw) { + int et = dst->border; + int el = dst->border; + int eb = dst->border + dst->y_height - src->y_height; + int er = dst->border + dst->y_width - src->y_width; + int src_y_offset = srcy * src->y_stride + srcx; + int dst_y_offset = srcy * dst->y_stride + srcx; + int src_uv_offset = ((srcy * src->uv_stride) >> 1) + (srcx >> 1); + int dst_uv_offset = ((srcy * dst->uv_stride) >> 1) + (srcx >> 1); + + // If the side is not touching the bounder then don't extend. + if (srcy) + et = 0; + if (srcx) + el = 0; + if (srcy + srch != src->y_height) + eb = 0; + if (srcx + srcw != src->y_width) + er = 0; + + copy_and_extend_plane(src->y_buffer + src_y_offset, + src->y_stride, + dst->y_buffer + dst_y_offset, + dst->y_stride, + srch, srcw, + et, el, eb, er); + + et = (et + 1) >> 1; + el = (el + 1) >> 1; + eb = (eb + 1) >> 1; + er = (er + 1) >> 1; + srch = (srch + 1) >> 1; + srcw = (srcw + 1) >> 1; + + copy_and_extend_plane(src->u_buffer + src_uv_offset, + src->uv_stride, + dst->u_buffer + dst_uv_offset, + dst->uv_stride, + srch, srcw, + et, el, eb, er); + + copy_and_extend_plane(src->v_buffer + src_uv_offset, + src->uv_stride, + dst->v_buffer + dst_uv_offset, + dst->uv_stride, + srch, srcw, + et, el, eb, er); } /* note the extension is only for the last row, for intra prediction purpose */ -void vp8_extend_mb_row(YV12_BUFFER_CONFIG *ybf, unsigned char *YPtr, unsigned char *UPtr, unsigned char *VPtr) -{ - int i; - - YPtr += ybf->y_stride * 14; - UPtr += ybf->uv_stride * 6; - VPtr += ybf->uv_stride * 6; - - for (i = 0; i < 4; i++) - { - YPtr[i] = YPtr[-1]; - UPtr[i] = UPtr[-1]; - VPtr[i] = VPtr[-1]; - } - - YPtr += ybf->y_stride; - UPtr += ybf->uv_stride; - VPtr += ybf->uv_stride; - - for (i = 0; i < 4; i++) - { - YPtr[i] = YPtr[-1]; - UPtr[i] = UPtr[-1]; - VPtr[i] = VPtr[-1]; - } +void vp8_extend_mb_row(YV12_BUFFER_CONFIG *ybf, unsigned char *YPtr, unsigned char *UPtr, unsigned char *VPtr) { + int i; + + YPtr += ybf->y_stride * 14; + UPtr += ybf->uv_stride * 6; + VPtr += ybf->uv_stride * 6; + + for (i = 0; i < 4; i++) { + YPtr[i] = YPtr[-1]; + UPtr[i] = UPtr[-1]; + VPtr[i] = VPtr[-1]; + } + + YPtr += ybf->y_stride; + UPtr += ybf->uv_stride; + VPtr += ybf->uv_stride; + + for (i = 0; i < 4; i++) { + YPtr[i] = YPtr[-1]; + UPtr[i] = UPtr[-1]; + VPtr[i] = VPtr[-1]; + } } diff --git a/vp8/common/filter.c b/vp8/common/filter.c index 55e84e4c5..856bad5a6 100644 --- a/vp8/common/filter.c +++ b/vp8/common/filter.c @@ -13,34 +13,33 @@ #include "filter.h" #include "vpx_ports/mem.h" -DECLARE_ALIGNED(16, const short, vp8_bilinear_filters[SUBPEL_SHIFTS][2]) = -{ +DECLARE_ALIGNED(16, const short, vp8_bilinear_filters[SUBPEL_SHIFTS][2]) = { #if SUBPEL_SHIFTS==16 - { 128, 0 }, - { 120, 8 }, - { 112, 16 }, - { 104, 24 }, - { 96, 32 }, - { 88, 40 }, - { 80, 48 }, - { 72, 56 }, - { 64, 64 }, - { 56, 72 }, - { 48, 80 }, - { 40, 88 }, - { 32, 96 }, - { 24, 104 }, - { 16, 112 }, - { 8, 120 } + { 128, 0 }, + { 120, 8 }, + { 112, 16 }, + { 104, 24 }, + { 96, 32 }, + { 88, 40 }, + { 80, 48 }, + { 72, 56 }, + { 64, 64 }, + { 56, 72 }, + { 48, 80 }, + { 40, 88 }, + { 32, 96 }, + { 24, 104 }, + { 16, 112 }, + { 8, 120 } #else - { 128, 0 }, - { 112, 16 }, - { 96, 32 }, - { 80, 48 }, - { 64, 64 }, - { 48, 80 }, - { 32, 96 }, - { 16, 112 } + { 128, 0 }, + { 112, 16 }, + { 96, 32 }, + { 80, 48 }, + { 64, 64 }, + { 48, 80 }, + { 32, 96 }, + { 16, 112 } #endif /* SUBPEL_SHIFTS==16 */ }; @@ -48,318 +47,309 @@ DECLARE_ALIGNED(16, const short, vp8_bilinear_filters[SUBPEL_SHIFTS][2]) = #define FILTER_ALPHA 0 #define FILTER_ALPHA_SHARP 60 -DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters_8[SUBPEL_SHIFTS][2*INTERP_EXTEND]) = -{ +DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters_8[SUBPEL_SHIFTS][2 * INTERP_EXTEND]) = { #if SUBPEL_SHIFTS==16 #if FILTER_ALPHA == 0 - /* Lagrangian interpolation filter */ - { 0, 0, 0, 128, 0, 0, 0, 0}, - { 0, 1, -5, 126, 8, -3, 1, 0}, - {-1, 3, -10, 122, 18, -6, 2, 0}, - {-1, 4, -13, 118, 27, -9, 3, -1}, - {-1, 4, -16, 112, 37, -11, 4, -1}, - {-1, 5, -18, 105, 48, -14, 4, -1}, - {-1, 5, -19, 97, 58, -16, 5, -1}, - {-1, 6, -19, 88, 68, -18, 5, -1}, - {-1, 6, -19, 78, 78, -19, 6, -1}, - {-1, 5, -18, 68, 88, -19, 6, -1}, - {-1, 5, -16, 58, 97, -19, 5, -1}, - {-1, 4, -14, 48, 105, -18, 5, -1}, - {-1, 4, -11, 37, 112, -16, 4, -1}, - {-1, 3, -9, 27, 118, -13, 4, -1}, - { 0, 2, -6, 18, 122, -10, 3, -1}, - { 0, 1, -3, 8, 126, -5, 1, 0} + /* Lagrangian interpolation filter */ + { 0, 0, 0, 128, 0, 0, 0, 0}, + { 0, 1, -5, 126, 8, -3, 1, 0}, + { -1, 3, -10, 122, 18, -6, 2, 0}, + { -1, 4, -13, 118, 27, -9, 3, -1}, + { -1, 4, -16, 112, 37, -11, 4, -1}, + { -1, 5, -18, 105, 48, -14, 4, -1}, + { -1, 5, -19, 97, 58, -16, 5, -1}, + { -1, 6, -19, 88, 68, -18, 5, -1}, + { -1, 6, -19, 78, 78, -19, 6, -1}, + { -1, 5, -18, 68, 88, -19, 6, -1}, + { -1, 5, -16, 58, 97, -19, 5, -1}, + { -1, 4, -14, 48, 105, -18, 5, -1}, + { -1, 4, -11, 37, 112, -16, 4, -1}, + { -1, 3, -9, 27, 118, -13, 4, -1}, + { 0, 2, -6, 18, 122, -10, 3, -1}, + { 0, 1, -3, 8, 126, -5, 1, 0} #elif FILTER_ALPHA == 50 - /* Generated using MATLAB: - * alpha = 0.5; - * b=intfilt(8,4,alpha); - * bi=round(128*b); - * ba=flipud(reshape([bi 0], 8, 8)); - * disp(num2str(ba, '%d,')) - */ - { 0, 0, 0, 128, 0, 0, 0, 0}, - { 0, 1, -5, 126, 8, -3, 1, 0}, - { 0, 2, -10, 122, 18, -6, 2, 0}, - {-1, 3, -13, 118, 27, -9, 3, 0}, - {-1, 4, -16, 112, 37, -11, 3, 0}, - {-1, 5, -17, 104, 48, -14, 4, -1}, - {-1, 5, -18, 96, 58, -16, 5, -1}, - {-1, 5, -19, 88, 68, -17, 5, -1}, - {-1, 5, -18, 78, 78, -18, 5, -1}, - {-1, 5, -17, 68, 88, -19, 5, -1}, - {-1, 5, -16, 58, 96, -18, 5, -1}, - {-1, 4, -14, 48, 104, -17, 5, -1}, - { 0, 3, -11, 37, 112, -16, 4, -1}, - { 0, 3, -9, 27, 118, -13, 3, -1}, - { 0, 2, -6, 18, 122, -10, 2, 0}, - { 0, 1, -3, 8, 126, -5, 1, 0} + /* Generated using MATLAB: + * alpha = 0.5; + * b=intfilt(8,4,alpha); + * bi=round(128*b); + * ba=flipud(reshape([bi 0], 8, 8)); + * disp(num2str(ba, '%d,')) + */ + { 0, 0, 0, 128, 0, 0, 0, 0}, + { 0, 1, -5, 126, 8, -3, 1, 0}, + { 0, 2, -10, 122, 18, -6, 2, 0}, + { -1, 3, -13, 118, 27, -9, 3, 0}, + { -1, 4, -16, 112, 37, -11, 3, 0}, + { -1, 5, -17, 104, 48, -14, 4, -1}, + { -1, 5, -18, 96, 58, -16, 5, -1}, + { -1, 5, -19, 88, 68, -17, 5, -1}, + { -1, 5, -18, 78, 78, -18, 5, -1}, + { -1, 5, -17, 68, 88, -19, 5, -1}, + { -1, 5, -16, 58, 96, -18, 5, -1}, + { -1, 4, -14, 48, 104, -17, 5, -1}, + { 0, 3, -11, 37, 112, -16, 4, -1}, + { 0, 3, -9, 27, 118, -13, 3, -1}, + { 0, 2, -6, 18, 122, -10, 2, 0}, + { 0, 1, -3, 8, 126, -5, 1, 0} #elif FILTER_ALPHA == 45 - /* alpha = 0.45 */ - { 0, 0, 0, 128, 0, 0, 0, 0}, - { 0, 1, -5, 126, 8, -3, 1, 0}, - { 0, 2, -9, 122, 17, -6, 2, 0}, - { 0, 3, -13, 117, 27, -8, 2, 0}, - {-1, 4, -15, 111, 37, -11, 3, 0}, - {-1, 4, -17, 104, 47, -13, 4, 0}, - {-1, 5, -18, 96, 58, -15, 4, -1}, - {-1, 5, -18, 87, 68, -17, 5, -1}, - {-1, 5, -18, 78, 78, -18, 5, -1}, - {-1, 5, -17, 68, 87, -18, 5, -1}, - {-1, 4, -15, 58, 96, -18, 5, -1}, - { 0, 4, -13, 47, 104, -17, 4, -1}, - { 0, 3, -11, 37, 111, -15, 4, -1}, - { 0, 2, -8, 27, 117, -13, 3, 0}, - { 0, 2, -6, 17, 122, -9, 2, 0}, - { 0, 1, -3, 8, 126, -5, 1, 0} + /* alpha = 0.45 */ + { 0, 0, 0, 128, 0, 0, 0, 0}, + { 0, 1, -5, 126, 8, -3, 1, 0}, + { 0, 2, -9, 122, 17, -6, 2, 0}, + { 0, 3, -13, 117, 27, -8, 2, 0}, + { -1, 4, -15, 111, 37, -11, 3, 0}, + { -1, 4, -17, 104, 47, -13, 4, 0}, + { -1, 5, -18, 96, 58, -15, 4, -1}, + { -1, 5, -18, 87, 68, -17, 5, -1}, + { -1, 5, -18, 78, 78, -18, 5, -1}, + { -1, 5, -17, 68, 87, -18, 5, -1}, + { -1, 4, -15, 58, 96, -18, 5, -1}, + { 0, 4, -13, 47, 104, -17, 4, -1}, + { 0, 3, -11, 37, 111, -15, 4, -1}, + { 0, 2, -8, 27, 117, -13, 3, 0}, + { 0, 2, -6, 17, 122, -9, 2, 0}, + { 0, 1, -3, 8, 126, -5, 1, 0} #endif /* FILTER_ALPHA */ #else /* SUBPEL_SHIFTS==16 */ #if FILTER_ALPHA == 0 - { 0, 0, 0, 128, 0, 0, 0, 0}, - {-1, 3, -10, 122, 18, -6, 2, 0}, - {-1, 4, -16, 112, 37, -11, 4, -1}, - {-1, 5, -19, 97, 58, -16, 5, -1}, - {-1, 6, -19, 78, 78, -19, 6, -1}, - {-1, 5, -16, 58, 97, -19, 5, -1}, - {-1, 4, -11, 37, 112, -16, 4, -1}, - { 0, 2, -6, 18, 122, -10, 3, -1}, + { 0, 0, 0, 128, 0, 0, 0, 0}, + { -1, 3, -10, 122, 18, -6, 2, 0}, + { -1, 4, -16, 112, 37, -11, 4, -1}, + { -1, 5, -19, 97, 58, -16, 5, -1}, + { -1, 6, -19, 78, 78, -19, 6, -1}, + { -1, 5, -16, 58, 97, -19, 5, -1}, + { -1, 4, -11, 37, 112, -16, 4, -1}, + { 0, 2, -6, 18, 122, -10, 3, -1}, #elif FILTER_ALPHA == 50 - /* alpha = 0.50 */ - { 0, 0, 0, 128, 0, 0, 0, 0}, - { 0, 2, -10, 122, 18, -6, 2, 0}, - {-1, 4, -16, 112, 37, -11, 3, 0}, - {-1, 5, -18, 96, 58, -16, 5, -1}, - {-1, 5, -18, 78, 78, -18, 5, -1}, - {-1, 5, -16, 58, 96, -18, 5, -1}, - { 0, 3, -11, 37, 112, -16, 4, -1}, - { 0, 2, -6, 18, 122, -10, 2, 0} + /* alpha = 0.50 */ + { 0, 0, 0, 128, 0, 0, 0, 0}, + { 0, 2, -10, 122, 18, -6, 2, 0}, + { -1, 4, -16, 112, 37, -11, 3, 0}, + { -1, 5, -18, 96, 58, -16, 5, -1}, + { -1, 5, -18, 78, 78, -18, 5, -1}, + { -1, 5, -16, 58, 96, -18, 5, -1}, + { 0, 3, -11, 37, 112, -16, 4, -1}, + { 0, 2, -6, 18, 122, -10, 2, 0} #elif FILTER_ALPHA == 45 - /* alpha = 0.45 */ - { 0, 0, 0, 128, 0, 0, 0, 0}, - { 0, 2, -9, 122, 17, -6, 2, 0}, - {-1, 4, -15, 111, 37, -11, 3, 0}, - {-1, 5, -18, 96, 58, -15, 4, -1}, - {-1, 5, -18, 78, 78, -18, 5, -1}, - {-1, 4, -15, 58, 96, -18, 5, -1}, - { 0, 3, -11, 37, 111, -15, 4, -1}, - { 0, 2, -6, 17, 122, -9, 2, 0}, + /* alpha = 0.45 */ + { 0, 0, 0, 128, 0, 0, 0, 0}, + { 0, 2, -9, 122, 17, -6, 2, 0}, + { -1, 4, -15, 111, 37, -11, 3, 0}, + { -1, 5, -18, 96, 58, -15, 4, -1}, + { -1, 5, -18, 78, 78, -18, 5, -1}, + { -1, 4, -15, 58, 96, -18, 5, -1}, + { 0, 3, -11, 37, 111, -15, 4, -1}, + { 0, 2, -6, 17, 122, -9, 2, 0}, #endif /* FILTER_ALPHA */ #endif /* SUBPEL_SHIFTS==16 */ }; -DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters_8s[SUBPEL_SHIFTS][2*INTERP_EXTEND]) = -{ +DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters_8s[SUBPEL_SHIFTS][2 * INTERP_EXTEND]) = { #if SUBPEL_SHIFTS==16 #if FILTER_ALPHA_SHARP == 65 - /* alpha = 0.65 */ - { 0, 0, 0, 128, 0, 0, 0, 0}, - { 0, 2, -6, 126, 8, -3, 1, 0}, - {-1, 3, -10, 123, 18, -6, 2, -1}, - {-1, 5, -14, 118, 27, -10, 4, -1}, - {-1, 5, -17, 112, 38, -13, 5, -1}, - {-2, 6, -19, 106, 48, -15, 5, -1}, - {-2, 7, -21, 98, 59, -17, 6, -2}, - {-2, 7, -21, 89, 69, -19, 7, -2}, - {-2, 7, -20, 79, 79, -20, 7, -2}, - {-2, 7, -19, 69, 89, -21, 7, -2}, - {-2, 6, -17, 59, 98, -21, 7, -2}, - {-1, 5, -15, 48, 106, -19, 6, -2}, - {-1, 5, -13, 38, 112, -17, 5, -1}, - {-1, 4, -10, 27, 118, -14, 5, -1}, - {-1, 2, -6, 18, 123, -10, 3, -1}, - { 0, 1, -3, 8, 126, -6, 2, 0} + /* alpha = 0.65 */ + { 0, 0, 0, 128, 0, 0, 0, 0}, + { 0, 2, -6, 126, 8, -3, 1, 0}, + { -1, 3, -10, 123, 18, -6, 2, -1}, + { -1, 5, -14, 118, 27, -10, 4, -1}, + { -1, 5, -17, 112, 38, -13, 5, -1}, + { -2, 6, -19, 106, 48, -15, 5, -1}, + { -2, 7, -21, 98, 59, -17, 6, -2}, + { -2, 7, -21, 89, 69, -19, 7, -2}, + { -2, 7, -20, 79, 79, -20, 7, -2}, + { -2, 7, -19, 69, 89, -21, 7, -2}, + { -2, 6, -17, 59, 98, -21, 7, -2}, + { -1, 5, -15, 48, 106, -19, 6, -2}, + { -1, 5, -13, 38, 112, -17, 5, -1}, + { -1, 4, -10, 27, 118, -14, 5, -1}, + { -1, 2, -6, 18, 123, -10, 3, -1}, + { 0, 1, -3, 8, 126, -6, 2, 0} #elif FILTER_ALPHA_SHARP == 60 - /* alpha = 0.60 */ - { 0, 0, 0, 128, 0, 0, 0, 0}, - { 0, 2, -6, 126, 8, -3, 1, 0}, - {-1, 3, -10, 123, 18, -6, 2, -1}, - {-1, 4, -14, 118, 28, -9, 3, -1}, - {-1, 5, -17, 112, 38, -12, 4, -1}, - {-1, 6, -19, 105, 48, -15, 5, -1}, - {-1, 6, -20, 97, 58, -17, 6, -1}, - {-1, 6, -20, 88, 69, -19, 6, -1}, - {-1, 6, -20, 79, 79, -20, 6, -1}, - {-1, 6, -19, 69, 88, -20, 6, -1}, - {-1, 6, -17, 58, 97, -20, 6, -1}, - {-1, 5, -15, 48, 105, -19, 6, -1}, - {-1, 4, -12, 38, 112, -17, 5, -1}, - {-1, 3, -9, 28, 118, -14, 4, -1}, - {-1, 2, -6, 18, 123, -10, 3, -1}, - { 0, 1, -3, 8, 126, -6, 2, 0} + /* alpha = 0.60 */ + { 0, 0, 0, 128, 0, 0, 0, 0}, + { 0, 2, -6, 126, 8, -3, 1, 0}, + { -1, 3, -10, 123, 18, -6, 2, -1}, + { -1, 4, -14, 118, 28, -9, 3, -1}, + { -1, 5, -17, 112, 38, -12, 4, -1}, + { -1, 6, -19, 105, 48, -15, 5, -1}, + { -1, 6, -20, 97, 58, -17, 6, -1}, + { -1, 6, -20, 88, 69, -19, 6, -1}, + { -1, 6, -20, 79, 79, -20, 6, -1}, + { -1, 6, -19, 69, 88, -20, 6, -1}, + { -1, 6, -17, 58, 97, -20, 6, -1}, + { -1, 5, -15, 48, 105, -19, 6, -1}, + { -1, 4, -12, 38, 112, -17, 5, -1}, + { -1, 3, -9, 28, 118, -14, 4, -1}, + { -1, 2, -6, 18, 123, -10, 3, -1}, + { 0, 1, -3, 8, 126, -6, 2, 0} #elif FILTER_ALPHA_SHARP == 55 - /* alpha = 0.55 */ - { 0, 0, 0, 128, 0, 0, 0, 0}, - { 0, 1, -5, 126, 8, -3, 1, 0}, - {-1, 2, -10, 123, 18, -6, 2, 0}, - {-1, 4, -13, 118, 27, -9, 3, -1}, - {-1, 5, -16, 112, 37, -12, 4, -1}, - {-1, 5, -18, 105, 48, -14, 4, -1}, - {-1, 5, -19, 97, 58, -16, 5, -1}, - {-1, 6, -19, 88, 68, -18, 5, -1}, - {-1, 6, -19, 78, 78, -19, 6, -1}, - {-1, 5, -18, 68, 88, -19, 6, -1}, - {-1, 5, -16, 58, 97, -19, 5, -1}, - {-1, 4, -14, 48, 105, -18, 5, -1}, - {-1, 4, -12, 37, 112, -16, 5, -1}, - {-1, 3, -9, 27, 118, -13, 4, -1}, - { 0, 2, -6, 18, 123, -10, 2, -1}, - { 0, 1, -3, 8, 126, -5, 1, 0} + /* alpha = 0.55 */ + { 0, 0, 0, 128, 0, 0, 0, 0}, + { 0, 1, -5, 126, 8, -3, 1, 0}, + { -1, 2, -10, 123, 18, -6, 2, 0}, + { -1, 4, -13, 118, 27, -9, 3, -1}, + { -1, 5, -16, 112, 37, -12, 4, -1}, + { -1, 5, -18, 105, 48, -14, 4, -1}, + { -1, 5, -19, 97, 58, -16, 5, -1}, + { -1, 6, -19, 88, 68, -18, 5, -1}, + { -1, 6, -19, 78, 78, -19, 6, -1}, + { -1, 5, -18, 68, 88, -19, 6, -1}, + { -1, 5, -16, 58, 97, -19, 5, -1}, + { -1, 4, -14, 48, 105, -18, 5, -1}, + { -1, 4, -12, 37, 112, -16, 5, -1}, + { -1, 3, -9, 27, 118, -13, 4, -1}, + { 0, 2, -6, 18, 123, -10, 2, -1}, + { 0, 1, -3, 8, 126, -5, 1, 0} #endif /* FILTER_ALPHA_SHARP */ #else /* SUBPEL_SHIFTS==16 */ #if FILTER_ALPHA_SHARP == 65 - /* alpha = 0.65 */ - { 0, 0, 0, 128, 0, 0, 0, 0}, - {-1, 3, -10, 123, 18, -6, 2, -1}, - {-1, 5, -17, 112, 38, -13, 5, -1}, - {-2, 7, -21, 98, 59, -17, 6, -2}, - {-2, 7, -20, 79, 79, -20, 7, -2}, - {-2, 6, -17, 59, 98, -21, 7, -2}, - {-1, 5, -13, 38, 112, -17, 5, -1}, - {-1, 2, -6, 18, 123, -10, 3, -1} + /* alpha = 0.65 */ + { 0, 0, 0, 128, 0, 0, 0, 0}, + { -1, 3, -10, 123, 18, -6, 2, -1}, + { -1, 5, -17, 112, 38, -13, 5, -1}, + { -2, 7, -21, 98, 59, -17, 6, -2}, + { -2, 7, -20, 79, 79, -20, 7, -2}, + { -2, 6, -17, 59, 98, -21, 7, -2}, + { -1, 5, -13, 38, 112, -17, 5, -1}, + { -1, 2, -6, 18, 123, -10, 3, -1} #elif FILTER_ALPHA_SHARP == 60 - /* alpha = 0.60 */ - { 0, 0, 0, 128, 0, 0, 0, 0}, - {-1, 3, -10, 123, 18, -6, 2, -1}, - {-1, 5, -17, 112, 38, -12, 4, -1}, - {-1, 6, -20, 97, 58, -17, 6, -1}, - {-1, 6, -20, 79, 79, -20, 6, -1}, - {-1, 6, -17, 58, 97, -20, 6, -1}, - {-1, 4, -12, 38, 112, -17, 5, -1}, - {-1, 2, -6, 18, 123, -10, 3, -1} + /* alpha = 0.60 */ + { 0, 0, 0, 128, 0, 0, 0, 0}, + { -1, 3, -10, 123, 18, -6, 2, -1}, + { -1, 5, -17, 112, 38, -12, 4, -1}, + { -1, 6, -20, 97, 58, -17, 6, -1}, + { -1, 6, -20, 79, 79, -20, 6, -1}, + { -1, 6, -17, 58, 97, -20, 6, -1}, + { -1, 4, -12, 38, 112, -17, 5, -1}, + { -1, 2, -6, 18, 123, -10, 3, -1} #elif FILTER_ALPHA_SHARP == 55 - /* alpha = 0.55 */ - { 0, 0, 0, 128, 0, 0, 0, 0}, - {-1, 2, -10, 123, 18, -6, 2, 0}, - {-1, 5, -16, 112, 37, -12, 4, -1}, - {-1, 5, -19, 97, 58, -16, 5, -1}, - {-1, 6, -19, 78, 78, -19, 6, -1}, - {-1, 5, -16, 58, 97, -19, 5, -1}, - {-1, 4, -12, 37, 112, -16, 5, -1}, - { 0, 2, -6, 18, 123, -10, 2, -1} + /* alpha = 0.55 */ + { 0, 0, 0, 128, 0, 0, 0, 0}, + { -1, 2, -10, 123, 18, -6, 2, 0}, + { -1, 5, -16, 112, 37, -12, 4, -1}, + { -1, 5, -19, 97, 58, -16, 5, -1}, + { -1, 6, -19, 78, 78, -19, 6, -1}, + { -1, 5, -16, 58, 97, -19, 5, -1}, + { -1, 4, -12, 37, 112, -16, 5, -1}, + { 0, 2, -6, 18, 123, -10, 2, -1} #endif /* FILTER_ALPHA_SHARP */ #endif /* SUBPEL_SHIFTS==16 */ }; #endif // CONFIG_ENHANCED_INTERP -DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters_6[SUBPEL_SHIFTS][6]) = -{ +DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters_6[SUBPEL_SHIFTS][6]) = { #if SUBPEL_SHIFTS==16 - {0, 0, 128, 0, 0, 0}, - {1, -5, 125, 8, -2, 1}, - {1, -8, 122, 17, -5, 1}, - {2, -11, 116, 27, -8, 2}, - {3, -14, 110, 37, -10, 2}, - {3, -15, 103, 47, -12, 2}, - {3, -16, 95, 57, -14, 3}, - {3, -16, 86, 67, -15, 3}, - {3, -16, 77, 77, -16, 3}, - {3, -15, 67, 86, -16, 3}, - {3, -14, 57, 95, -16, 3}, - {2, -12, 47, 103, -15, 3}, - {2, -10, 37, 110, -14, 3}, - {2, -8, 27, 116, -11, 2}, - {1, -5, 17, 122, -8, 1}, - {1, -2, 8, 125, -5, 1} + {0, 0, 128, 0, 0, 0}, + {1, -5, 125, 8, -2, 1}, + {1, -8, 122, 17, -5, 1}, + {2, -11, 116, 27, -8, 2}, + {3, -14, 110, 37, -10, 2}, + {3, -15, 103, 47, -12, 2}, + {3, -16, 95, 57, -14, 3}, + {3, -16, 86, 67, -15, 3}, + {3, -16, 77, 77, -16, 3}, + {3, -15, 67, 86, -16, 3}, + {3, -14, 57, 95, -16, 3}, + {2, -12, 47, 103, -15, 3}, + {2, -10, 37, 110, -14, 3}, + {2, -8, 27, 116, -11, 2}, + {1, -5, 17, 122, -8, 1}, + {1, -2, 8, 125, -5, 1} #else - { 0, 0, 128, 0, 0, 0 }, /* note that 1/8 pel positions are just as per alpha -0.5 bicubic */ - { 0, -6, 123, 12, -1, 0 }, - { 2, -11, 108, 36, -8, 1 }, /* New 1/4 pel 6 tap filter */ - { 0, -9, 93, 50, -6, 0 }, - { 3, -16, 77, 77, -16, 3 }, /* New 1/2 pel 6 tap filter */ - { 0, -6, 50, 93, -9, 0 }, - { 1, -8, 36, 108, -11, 2 }, /* New 1/4 pel 6 tap filter */ - { 0, -1, 12, 123, -6, 0 }, + { 0, 0, 128, 0, 0, 0 }, /* note that 1/8 pel positions are just as per alpha -0.5 bicubic */ + { 0, -6, 123, 12, -1, 0 }, + { 2, -11, 108, 36, -8, 1 }, /* New 1/4 pel 6 tap filter */ + { 0, -9, 93, 50, -6, 0 }, + { 3, -16, 77, 77, -16, 3 }, /* New 1/2 pel 6 tap filter */ + { 0, -6, 50, 93, -9, 0 }, + { 1, -8, 36, 108, -11, 2 }, /* New 1/4 pel 6 tap filter */ + { 0, -1, 12, 123, -6, 0 }, #endif /* SUBPEL_SHIFTS==16 */ }; static void filter_block2d_first_pass_6 ( - unsigned char *src_ptr, - int *output_ptr, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter -) -{ - unsigned int i, j; - int Temp; - - for (i = 0; i < output_height; i++) - { - for (j = 0; j < output_width; j++) - { - Temp = ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[0]) + - ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[1]) + - ((int)src_ptr[0] * vp8_filter[2]) + - ((int)src_ptr[pixel_step] * vp8_filter[3]) + - ((int)src_ptr[2*pixel_step] * vp8_filter[4]) + - ((int)src_ptr[3*pixel_step] * vp8_filter[5]) + - (VP8_FILTER_WEIGHT >> 1); /* Rounding */ - - /* Normalize back to 0-255 */ - Temp = Temp >> VP8_FILTER_SHIFT; - - if (Temp < 0) - Temp = 0; - else if (Temp > 255) - Temp = 255; - - output_ptr[j] = Temp; - src_ptr++; - } - - /* Next row... */ - src_ptr += src_pixels_per_line - output_width; - output_ptr += output_width; + unsigned char *src_ptr, + int *output_ptr, + unsigned int src_pixels_per_line, + unsigned int pixel_step, + unsigned int output_height, + unsigned int output_width, + const short *vp8_filter +) { + unsigned int i, j; + int Temp; + + for (i = 0; i < output_height; i++) { + for (j = 0; j < output_width; j++) { + Temp = ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[0]) + + ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[1]) + + ((int)src_ptr[0] * vp8_filter[2]) + + ((int)src_ptr[pixel_step] * vp8_filter[3]) + + ((int)src_ptr[2 * pixel_step] * vp8_filter[4]) + + ((int)src_ptr[3 * pixel_step] * vp8_filter[5]) + + (VP8_FILTER_WEIGHT >> 1); /* Rounding */ + + /* Normalize back to 0-255 */ + Temp = Temp >> VP8_FILTER_SHIFT; + + if (Temp < 0) + Temp = 0; + else if (Temp > 255) + Temp = 255; + + output_ptr[j] = Temp; + src_ptr++; } + + /* Next row... */ + src_ptr += src_pixels_per_line - output_width; + output_ptr += output_width; + } } static void filter_block2d_second_pass_6 ( - int *src_ptr, - unsigned char *output_ptr, - int output_pitch, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter -) -{ - unsigned int i, j; - int Temp; - - for (i = 0; i < output_height; i++) - { - for (j = 0; j < output_width; j++) - { - /* Apply filter */ - Temp = ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[0]) + - ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[1]) + - ((int)src_ptr[0] * vp8_filter[2]) + - ((int)src_ptr[pixel_step] * vp8_filter[3]) + - ((int)src_ptr[2*pixel_step] * vp8_filter[4]) + - ((int)src_ptr[3*pixel_step] * vp8_filter[5]) + - (VP8_FILTER_WEIGHT >> 1); /* Rounding */ - - /* Normalize back to 0-255 */ - Temp = Temp >> VP8_FILTER_SHIFT; - - if (Temp < 0) - Temp = 0; - else if (Temp > 255) - Temp = 255; - - output_ptr[j] = (unsigned char)Temp; - src_ptr++; - } - - /* Start next row */ - src_ptr += src_pixels_per_line - output_width; - output_ptr += output_pitch; + int *src_ptr, + unsigned char *output_ptr, + int output_pitch, + unsigned int src_pixels_per_line, + unsigned int pixel_step, + unsigned int output_height, + unsigned int output_width, + const short *vp8_filter +) { + unsigned int i, j; + int Temp; + + for (i = 0; i < output_height; i++) { + for (j = 0; j < output_width; j++) { + /* Apply filter */ + Temp = ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[0]) + + ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[1]) + + ((int)src_ptr[0] * vp8_filter[2]) + + ((int)src_ptr[pixel_step] * vp8_filter[3]) + + ((int)src_ptr[2 * pixel_step] * vp8_filter[4]) + + ((int)src_ptr[3 * pixel_step] * vp8_filter[5]) + + (VP8_FILTER_WEIGHT >> 1); /* Rounding */ + + /* Normalize back to 0-255 */ + Temp = Temp >> VP8_FILTER_SHIFT; + + if (Temp < 0) + Temp = 0; + else if (Temp > 255) + Temp = 255; + + output_ptr[j] = (unsigned char)Temp; + src_ptr++; } + + /* Start next row */ + src_ptr += src_pixels_per_line - output_width; + output_ptr += output_pitch; + } } /* @@ -372,89 +362,84 @@ static void filter_block2d_second_pass_6 */ static void filter_block2d_second_pass_avg_6 ( - int *src_ptr, - unsigned char *output_ptr, - int output_pitch, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter -) -{ - unsigned int i, j; - int Temp; - - for (i = 0; i < output_height; i++) - { - for (j = 0; j < output_width; j++) - { - /* Apply filter */ - Temp = ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[0]) + - ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[1]) + - ((int)src_ptr[0] * vp8_filter[2]) + - ((int)src_ptr[pixel_step] * vp8_filter[3]) + - ((int)src_ptr[2*pixel_step] * vp8_filter[4]) + - ((int)src_ptr[3*pixel_step] * vp8_filter[5]) + - (VP8_FILTER_WEIGHT >> 1); /* Rounding */ - - /* Normalize back to 0-255 */ - Temp = Temp >> VP8_FILTER_SHIFT; - - if (Temp < 0) - Temp = 0; - else if (Temp > 255) - Temp = 255; - - output_ptr[j] = (unsigned char) ((output_ptr[j] + Temp + 1) >> 1); - src_ptr++; - } - - /* Start next row */ - src_ptr += src_pixels_per_line - output_width; - output_ptr += output_pitch; + int *src_ptr, + unsigned char *output_ptr, + int output_pitch, + unsigned int src_pixels_per_line, + unsigned int pixel_step, + unsigned int output_height, + unsigned int output_width, + const short *vp8_filter +) { + unsigned int i, j; + int Temp; + + for (i = 0; i < output_height; i++) { + for (j = 0; j < output_width; j++) { + /* Apply filter */ + Temp = ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[0]) + + ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[1]) + + ((int)src_ptr[0] * vp8_filter[2]) + + ((int)src_ptr[pixel_step] * vp8_filter[3]) + + ((int)src_ptr[2 * pixel_step] * vp8_filter[4]) + + ((int)src_ptr[3 * pixel_step] * vp8_filter[5]) + + (VP8_FILTER_WEIGHT >> 1); /* Rounding */ + + /* Normalize back to 0-255 */ + Temp = Temp >> VP8_FILTER_SHIFT; + + if (Temp < 0) + Temp = 0; + else if (Temp > 255) + Temp = 255; + + output_ptr[j] = (unsigned char)((output_ptr[j] + Temp + 1) >> 1); + src_ptr++; } + + /* Start next row */ + src_ptr += src_pixels_per_line - output_width; + output_ptr += output_pitch; + } } #define Interp_Extend 3 static void filter_block2d_6 ( - unsigned char *src_ptr, - unsigned char *output_ptr, - unsigned int src_pixels_per_line, - int output_pitch, - const short *HFilter, - const short *VFilter -) -{ - int FData[(3+Interp_Extend*2)*4]; /* Temp data buffer used in filtering */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_6(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, src_pixels_per_line, 1, - 3+Interp_Extend*2, 4, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass_6(FData + 4*(Interp_Extend-1), output_ptr, output_pitch, 4, 4, 4, 4, VFilter); + unsigned char *src_ptr, + unsigned char *output_ptr, + unsigned int src_pixels_per_line, + int output_pitch, + const short *HFilter, + const short *VFilter +) { + int FData[(3 + Interp_Extend * 2) * 4]; /* Temp data buffer used in filtering */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_6(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, + 3 + Interp_Extend * 2, 4, HFilter); + + /* then filter verticaly... */ + filter_block2d_second_pass_6(FData + 4 * (Interp_Extend - 1), output_ptr, output_pitch, 4, 4, 4, 4, VFilter); } void vp8_sixtap_predict_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_sub_pel_filters_6[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_6[yoffset]; /* 6 tap */ - - filter_block2d_6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_sub_pel_filters_6[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_6[yoffset]; /* 6 tap */ + + filter_block2d_6(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter); } /* @@ -466,180 +451,173 @@ void vp8_sixtap_predict_c */ static void filter_block2d_avg_6 ( - unsigned char *src_ptr, - unsigned char *output_ptr, - unsigned int src_pixels_per_line, - int output_pitch, - const short *HFilter, - const short *VFilter -) -{ - int FData[(3+Interp_Extend*2)*4]; /* Temp data buffer used in filtering */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_6(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), - FData, src_pixels_per_line, 1, - 3+Interp_Extend*2, 4, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass_avg_6(FData + 4*(Interp_Extend-1), output_ptr, - output_pitch, 4, 4, 4, 4, VFilter); + unsigned char *src_ptr, + unsigned char *output_ptr, + unsigned int src_pixels_per_line, + int output_pitch, + const short *HFilter, + const short *VFilter +) { + int FData[(3 + Interp_Extend * 2) * 4]; /* Temp data buffer used in filtering */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_6(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), + FData, src_pixels_per_line, 1, + 3 + Interp_Extend * 2, 4, HFilter); + + /* then filter verticaly... */ + filter_block2d_second_pass_avg_6(FData + 4 * (Interp_Extend - 1), output_ptr, + output_pitch, 4, 4, 4, 4, VFilter); } void vp8_sixtap_predict_avg_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_sub_pel_filters_6[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_6[yoffset]; /* 6 tap */ - - filter_block2d_avg_6(src_ptr, dst_ptr, src_pixels_per_line, - dst_pitch, HFilter, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_sub_pel_filters_6[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_6[yoffset]; /* 6 tap */ + + filter_block2d_avg_6(src_ptr, dst_ptr, src_pixels_per_line, + dst_pitch, HFilter, VFilter); } void vp8_sixtap_predict8x8_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ - int FData[(7+Interp_Extend*2)*8]; /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters_6[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_6[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_6(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, src_pixels_per_line, 1, - 7+Interp_Extend*2, 8, HFilter); - - - /* then filter verticaly... */ - filter_block2d_second_pass_6(FData + 8*(Interp_Extend-1), dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ + int FData[(7 + Interp_Extend * 2) * 8]; /* Temp data buffer used in filtering */ + + HFilter = vp8_sub_pel_filters_6[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_6[yoffset]; /* 6 tap */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_6(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, + 7 + Interp_Extend * 2, 8, HFilter); + + + /* then filter verticaly... */ + filter_block2d_second_pass_6(FData + 8 * (Interp_Extend - 1), dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter); } void vp8_sixtap_predict_avg8x8_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ - int FData[(7+Interp_Extend*2)*8]; /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters_6[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_6[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_6(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, src_pixels_per_line, 1, - 7+Interp_Extend*2, 8, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass_avg_6(FData + 8*(Interp_Extend-1), dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ + int FData[(7 + Interp_Extend * 2) * 8]; /* Temp data buffer used in filtering */ + + HFilter = vp8_sub_pel_filters_6[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_6[yoffset]; /* 6 tap */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_6(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, + 7 + Interp_Extend * 2, 8, HFilter); + + /* then filter verticaly... */ + filter_block2d_second_pass_avg_6(FData + 8 * (Interp_Extend - 1), dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter); } void vp8_sixtap_predict8x4_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ - int FData[(3+Interp_Extend*2)*8]; /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters_6[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_6[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_6(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, src_pixels_per_line, 1, - 3+Interp_Extend*2, 8, HFilter); - - - /* then filter verticaly... */ - filter_block2d_second_pass_6(FData + 8*(Interp_Extend-1), dst_ptr, dst_pitch, 8, 8, 4, 8, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ + int FData[(3 + Interp_Extend * 2) * 8]; /* Temp data buffer used in filtering */ + + HFilter = vp8_sub_pel_filters_6[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_6[yoffset]; /* 6 tap */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_6(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, + 3 + Interp_Extend * 2, 8, HFilter); + + + /* then filter verticaly... */ + filter_block2d_second_pass_6(FData + 8 * (Interp_Extend - 1), dst_ptr, dst_pitch, 8, 8, 4, 8, VFilter); } void vp8_sixtap_predict16x16_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - // int FData[(15+Interp_Extend*2)*24]; /* Temp data buffer used in filtering */ - int FData[(15+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ - - - HFilter = vp8_sub_pel_filters_6[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_6[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_6(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, src_pixels_per_line, 1, - 15+Interp_Extend*2, 16, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass_6(FData + 16*(Interp_Extend-1), dst_ptr, dst_pitch, 16, 16, 16, 16, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + // int FData[(15+Interp_Extend*2)*24]; /* Temp data buffer used in filtering */ + int FData[(15 + Interp_Extend * 2) * 16]; /* Temp data buffer used in filtering */ + + + HFilter = vp8_sub_pel_filters_6[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_6[yoffset]; /* 6 tap */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_6(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, + 15 + Interp_Extend * 2, 16, HFilter); + + /* then filter verticaly... */ + filter_block2d_second_pass_6(FData + 16 * (Interp_Extend - 1), dst_ptr, dst_pitch, 16, 16, 16, 16, VFilter); } void vp8_sixtap_predict_avg16x16_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - // int FData[(15+Interp_Extend*2)*24]; /* Temp data buffer used in filtering */ - int FData[(15+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters_6[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_6[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_6(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, - src_pixels_per_line, 1, 15+Interp_Extend*2, 16, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass_avg_6(FData + 16*(Interp_Extend-1), dst_ptr, dst_pitch, + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + // int FData[(15+Interp_Extend*2)*24]; /* Temp data buffer used in filtering */ + int FData[(15 + Interp_Extend * 2) * 16]; /* Temp data buffer used in filtering */ + + HFilter = vp8_sub_pel_filters_6[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_6[yoffset]; /* 6 tap */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_6(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, + src_pixels_per_line, 1, 15 + Interp_Extend * 2, 16, HFilter); + + /* then filter verticaly... */ + filter_block2d_second_pass_avg_6(FData + 16 * (Interp_Extend - 1), dst_ptr, dst_pitch, 16, 16, 16, 16, VFilter); } @@ -650,124 +628,118 @@ void vp8_sixtap_predict_avg16x16_c static void filter_block2d_first_pass_8 ( - unsigned char *src_ptr, - int *output_ptr, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter -) -{ - unsigned int i, j; - int Temp; - - for (i = 0; i < output_height; i++) - { - for (j = 0; j < output_width; j++) - { + unsigned char *src_ptr, + int *output_ptr, + unsigned int src_pixels_per_line, + unsigned int pixel_step, + unsigned int output_height, + unsigned int output_width, + const short *vp8_filter +) { + unsigned int i, j; + int Temp; + + for (i = 0; i < output_height; i++) { + for (j = 0; j < output_width; j++) { #if Interp_Extend == 4 - Temp = ((int)src_ptr[-3 * (int)pixel_step] * vp8_filter[0]) + - ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[1]) + - ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[2]) + - ((int)src_ptr[0] * vp8_filter[3]) + - ((int)src_ptr[pixel_step] * vp8_filter[4]) + - ((int)src_ptr[2 * pixel_step] * vp8_filter[5]) + - ((int)src_ptr[3 * pixel_step] * vp8_filter[6]) + - ((int)src_ptr[4 * pixel_step] * vp8_filter[7]) + - (VP8_FILTER_WEIGHT >> 1); /* Rounding */ + Temp = ((int)src_ptr[-3 * (int)pixel_step] * vp8_filter[0]) + + ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[1]) + + ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[2]) + + ((int)src_ptr[0] * vp8_filter[3]) + + ((int)src_ptr[pixel_step] * vp8_filter[4]) + + ((int)src_ptr[2 * pixel_step] * vp8_filter[5]) + + ((int)src_ptr[3 * pixel_step] * vp8_filter[6]) + + ((int)src_ptr[4 * pixel_step] * vp8_filter[7]) + + (VP8_FILTER_WEIGHT >> 1); /* Rounding */ #elif Interp_Extend == 5 - Temp = ((int)src_ptr[-4 * (int)pixel_step] * vp8_filter[0]) + - ((int)src_ptr[-3 * (int)pixel_step] * vp8_filter[1]) + - ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[2]) + - ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[3]) + - ((int)src_ptr[0] * vp8_filter[4]) + - ((int)src_ptr[pixel_step] * vp8_filter[5]) + - ((int)src_ptr[2 * pixel_step] * vp8_filter[6]) + - ((int)src_ptr[3 * pixel_step] * vp8_filter[7]) + - ((int)src_ptr[4 * pixel_step] * vp8_filter[8]) + - ((int)src_ptr[5 * pixel_step] * vp8_filter[9]) + - (VP8_FILTER_WEIGHT >> 1); /* Rounding */ + Temp = ((int)src_ptr[-4 * (int)pixel_step] * vp8_filter[0]) + + ((int)src_ptr[-3 * (int)pixel_step] * vp8_filter[1]) + + ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[2]) + + ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[3]) + + ((int)src_ptr[0] * vp8_filter[4]) + + ((int)src_ptr[pixel_step] * vp8_filter[5]) + + ((int)src_ptr[2 * pixel_step] * vp8_filter[6]) + + ((int)src_ptr[3 * pixel_step] * vp8_filter[7]) + + ((int)src_ptr[4 * pixel_step] * vp8_filter[8]) + + ((int)src_ptr[5 * pixel_step] * vp8_filter[9]) + + (VP8_FILTER_WEIGHT >> 1); /* Rounding */ #endif - /* Normalize back to 0-255 */ - Temp = Temp >> VP8_FILTER_SHIFT; + /* Normalize back to 0-255 */ + Temp = Temp >> VP8_FILTER_SHIFT; - if (Temp < 0) - Temp = 0; - else if (Temp > 255) - Temp = 255; + if (Temp < 0) + Temp = 0; + else if (Temp > 255) + Temp = 255; - output_ptr[j] = Temp; - src_ptr++; - } - - /* Next row... */ - src_ptr += src_pixels_per_line - output_width; - output_ptr += output_width; + output_ptr[j] = Temp; + src_ptr++; } + + /* Next row... */ + src_ptr += src_pixels_per_line - output_width; + output_ptr += output_width; + } } static void filter_block2d_second_pass_8 ( - int *src_ptr, - unsigned char *output_ptr, - int output_pitch, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter -) -{ - unsigned int i, j; - int Temp; - - for (i = 0; i < output_height; i++) - { - for (j = 0; j < output_width; j++) - { - /* Apply filter */ + int *src_ptr, + unsigned char *output_ptr, + int output_pitch, + unsigned int src_pixels_per_line, + unsigned int pixel_step, + unsigned int output_height, + unsigned int output_width, + const short *vp8_filter +) { + unsigned int i, j; + int Temp; + + for (i = 0; i < output_height; i++) { + for (j = 0; j < output_width; j++) { + /* Apply filter */ #if Interp_Extend == 4 - Temp = ((int)src_ptr[-3 * (int)pixel_step] * vp8_filter[0]) + - ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[1]) + - ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[2]) + - ((int)src_ptr[0] * vp8_filter[3]) + - ((int)src_ptr[pixel_step] * vp8_filter[4]) + - ((int)src_ptr[2 * pixel_step] * vp8_filter[5]) + - ((int)src_ptr[3 * pixel_step] * vp8_filter[6]) + - ((int)src_ptr[4 * pixel_step] * vp8_filter[7]) + - (VP8_FILTER_WEIGHT >> 1); /* Rounding */ + Temp = ((int)src_ptr[-3 * (int)pixel_step] * vp8_filter[0]) + + ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[1]) + + ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[2]) + + ((int)src_ptr[0] * vp8_filter[3]) + + ((int)src_ptr[pixel_step] * vp8_filter[4]) + + ((int)src_ptr[2 * pixel_step] * vp8_filter[5]) + + ((int)src_ptr[3 * pixel_step] * vp8_filter[6]) + + ((int)src_ptr[4 * pixel_step] * vp8_filter[7]) + + (VP8_FILTER_WEIGHT >> 1); /* Rounding */ #elif Interp_Extend == 5 - Temp = ((int)src_ptr[-4 * (int)pixel_step] * vp8_filter[0]) + - ((int)src_ptr[-3 * (int)pixel_step] * vp8_filter[1]) + - ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[2]) + - ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[3]) + - ((int)src_ptr[0] * vp8_filter[4]) + - ((int)src_ptr[pixel_step] * vp8_filter[5]) + - ((int)src_ptr[2 * pixel_step] * vp8_filter[6]) + - ((int)src_ptr[3 * pixel_step] * vp8_filter[7]) + - ((int)src_ptr[4 * pixel_step] * vp8_filter[8]) + - ((int)src_ptr[5 * pixel_step] * vp8_filter[9]) + - (VP8_FILTER_WEIGHT >> 1); /* Rounding */ + Temp = ((int)src_ptr[-4 * (int)pixel_step] * vp8_filter[0]) + + ((int)src_ptr[-3 * (int)pixel_step] * vp8_filter[1]) + + ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[2]) + + ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[3]) + + ((int)src_ptr[0] * vp8_filter[4]) + + ((int)src_ptr[pixel_step] * vp8_filter[5]) + + ((int)src_ptr[2 * pixel_step] * vp8_filter[6]) + + ((int)src_ptr[3 * pixel_step] * vp8_filter[7]) + + ((int)src_ptr[4 * pixel_step] * vp8_filter[8]) + + ((int)src_ptr[5 * pixel_step] * vp8_filter[9]) + + (VP8_FILTER_WEIGHT >> 1); /* Rounding */ #endif - /* Normalize back to 0-255 */ - Temp = Temp >> VP8_FILTER_SHIFT; - - if (Temp < 0) - Temp = 0; - else if (Temp > 255) - Temp = 255; + /* Normalize back to 0-255 */ + Temp = Temp >> VP8_FILTER_SHIFT; - output_ptr[j] = (unsigned char)Temp; - src_ptr++; - } + if (Temp < 0) + Temp = 0; + else if (Temp > 255) + Temp = 255; - /* Start next row */ - src_ptr += src_pixels_per_line - output_width; - output_ptr += output_pitch; + output_ptr[j] = (unsigned char)Temp; + src_ptr++; } + + /* Start next row */ + src_ptr += src_pixels_per_line - output_width; + output_ptr += output_pitch; + } } /* @@ -780,449 +752,430 @@ static void filter_block2d_second_pass_8 */ static void filter_block2d_second_pass_avg_8 ( - int *src_ptr, - unsigned char *output_ptr, - int output_pitch, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter -) -{ - unsigned int i, j; - int Temp; - - for (i = 0; i < output_height; i++) - { - for (j = 0; j < output_width; j++) - { - /* Apply filter */ + int *src_ptr, + unsigned char *output_ptr, + int output_pitch, + unsigned int src_pixels_per_line, + unsigned int pixel_step, + unsigned int output_height, + unsigned int output_width, + const short *vp8_filter +) { + unsigned int i, j; + int Temp; + + for (i = 0; i < output_height; i++) { + for (j = 0; j < output_width; j++) { + /* Apply filter */ #if Interp_Extend == 4 - Temp = ((int)src_ptr[-3 * (int)pixel_step] * vp8_filter[0]) + - ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[1]) + - ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[2]) + - ((int)src_ptr[0] * vp8_filter[3]) + - ((int)src_ptr[pixel_step] * vp8_filter[4]) + - ((int)src_ptr[2 * pixel_step] * vp8_filter[5]) + - ((int)src_ptr[3 * pixel_step] * vp8_filter[6]) + - ((int)src_ptr[4 * pixel_step] * vp8_filter[7]) + - (VP8_FILTER_WEIGHT >> 1); /* Rounding */ + Temp = ((int)src_ptr[-3 * (int)pixel_step] * vp8_filter[0]) + + ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[1]) + + ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[2]) + + ((int)src_ptr[0] * vp8_filter[3]) + + ((int)src_ptr[pixel_step] * vp8_filter[4]) + + ((int)src_ptr[2 * pixel_step] * vp8_filter[5]) + + ((int)src_ptr[3 * pixel_step] * vp8_filter[6]) + + ((int)src_ptr[4 * pixel_step] * vp8_filter[7]) + + (VP8_FILTER_WEIGHT >> 1); /* Rounding */ #elif Interp_Extend == 5 - Temp = ((int)src_ptr[-4 * (int)pixel_step] * vp8_filter[0]) + - ((int)src_ptr[-3 * (int)pixel_step] * vp8_filter[1]) + - ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[2]) + - ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[3]) + - ((int)src_ptr[0] * vp8_filter[4]) + - ((int)src_ptr[pixel_step] * vp8_filter[5]) + - ((int)src_ptr[2 * pixel_step] * vp8_filter[6]) + - ((int)src_ptr[3 * pixel_step] * vp8_filter[7]) + - ((int)src_ptr[4 * pixel_step] * vp8_filter[8]) + - ((int)src_ptr[5 * pixel_step] * vp8_filter[9]) + - (VP8_FILTER_WEIGHT >> 1); /* Rounding */ + Temp = ((int)src_ptr[-4 * (int)pixel_step] * vp8_filter[0]) + + ((int)src_ptr[-3 * (int)pixel_step] * vp8_filter[1]) + + ((int)src_ptr[-2 * (int)pixel_step] * vp8_filter[2]) + + ((int)src_ptr[-1 * (int)pixel_step] * vp8_filter[3]) + + ((int)src_ptr[0] * vp8_filter[4]) + + ((int)src_ptr[pixel_step] * vp8_filter[5]) + + ((int)src_ptr[2 * pixel_step] * vp8_filter[6]) + + ((int)src_ptr[3 * pixel_step] * vp8_filter[7]) + + ((int)src_ptr[4 * pixel_step] * vp8_filter[8]) + + ((int)src_ptr[5 * pixel_step] * vp8_filter[9]) + + (VP8_FILTER_WEIGHT >> 1); /* Rounding */ #endif - /* Normalize back to 0-255 */ - Temp = Temp >> VP8_FILTER_SHIFT; - - if (Temp < 0) - Temp = 0; - else if (Temp > 255) - Temp = 255; + /* Normalize back to 0-255 */ + Temp = Temp >> VP8_FILTER_SHIFT; - output_ptr[j] = (unsigned char) ((output_ptr[j] + Temp + 1) >> 1); - src_ptr++; - } + if (Temp < 0) + Temp = 0; + else if (Temp > 255) + Temp = 255; - /* Start next row */ - src_ptr += src_pixels_per_line - output_width; - output_ptr += output_pitch; + output_ptr[j] = (unsigned char)((output_ptr[j] + Temp + 1) >> 1); + src_ptr++; } + + /* Start next row */ + src_ptr += src_pixels_per_line - output_width; + output_ptr += output_pitch; + } } static void filter_block2d_8 ( - unsigned char *src_ptr, - unsigned char *output_ptr, - unsigned int src_pixels_per_line, - int output_pitch, - const short *HFilter, - const short *VFilter -) -{ - int FData[(3+Interp_Extend*2)*4]; /* Temp data buffer used in filtering */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_8(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, src_pixels_per_line, 1, - 3+Interp_Extend*2, 4, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass_8(FData + 4*(Interp_Extend-1), output_ptr, output_pitch, 4, 4, 4, 4, VFilter); + unsigned char *src_ptr, + unsigned char *output_ptr, + unsigned int src_pixels_per_line, + int output_pitch, + const short *HFilter, + const short *VFilter +) { + int FData[(3 + Interp_Extend * 2) * 4]; /* Temp data buffer used in filtering */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_8(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, + 3 + Interp_Extend * 2, 4, HFilter); + + /* then filter verticaly... */ + filter_block2d_second_pass_8(FData + 4 * (Interp_Extend - 1), output_ptr, output_pitch, 4, 4, 4, 4, VFilter); } static void filter_block2d_avg_8 ( - unsigned char *src_ptr, - unsigned char *output_ptr, - unsigned int src_pixels_per_line, - int output_pitch, - const short *HFilter, - const short *VFilter -) -{ - int FData[(3+Interp_Extend*2)*4]; /* Temp data buffer used in filtering */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_8(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, src_pixels_per_line, 1, - 3+Interp_Extend*2, 4, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass_avg_8(FData + 4*(Interp_Extend-1), output_ptr, output_pitch, 4, 4, 4, 4, VFilter); + unsigned char *src_ptr, + unsigned char *output_ptr, + unsigned int src_pixels_per_line, + int output_pitch, + const short *HFilter, + const short *VFilter +) { + int FData[(3 + Interp_Extend * 2) * 4]; /* Temp data buffer used in filtering */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_8(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, + 3 + Interp_Extend * 2, 4, HFilter); + + /* then filter verticaly... */ + filter_block2d_second_pass_avg_8(FData + 4 * (Interp_Extend - 1), output_ptr, output_pitch, 4, 4, 4, 4, VFilter); } void vp8_eighttap_predict_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_sub_pel_filters_8[xoffset]; /* 8 tap */ - VFilter = vp8_sub_pel_filters_8[yoffset]; /* 8 tap */ - - filter_block2d_8(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_sub_pel_filters_8[xoffset]; /* 8 tap */ + VFilter = vp8_sub_pel_filters_8[yoffset]; /* 8 tap */ + + filter_block2d_8(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter); } void vp8_eighttap_predict_avg4x4_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_sub_pel_filters_8[xoffset]; /* 8 tap */ - VFilter = vp8_sub_pel_filters_8[yoffset]; /* 8 tap */ - - filter_block2d_avg_8(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_sub_pel_filters_8[xoffset]; /* 8 tap */ + VFilter = vp8_sub_pel_filters_8[yoffset]; /* 8 tap */ + + filter_block2d_avg_8(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter); } void vp8_eighttap_predict_sharp_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_sub_pel_filters_8s[xoffset]; /* 8 tap */ - VFilter = vp8_sub_pel_filters_8s[yoffset]; /* 8 tap */ - - filter_block2d_8(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_sub_pel_filters_8s[xoffset]; /* 8 tap */ + VFilter = vp8_sub_pel_filters_8s[yoffset]; /* 8 tap */ + + filter_block2d_8(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter); } void vp8_eighttap_predict_avg4x4_sharp_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_sub_pel_filters_8s[xoffset]; /* 8 tap */ - VFilter = vp8_sub_pel_filters_8s[yoffset]; /* 8 tap */ - - filter_block2d_avg_8(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_sub_pel_filters_8s[xoffset]; /* 8 tap */ + VFilter = vp8_sub_pel_filters_8s[yoffset]; /* 8 tap */ + + filter_block2d_avg_8(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter); } void vp8_eighttap_predict8x8_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ - int FData[(7+Interp_Extend*2)*8]; /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters_8[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_8[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_8(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, src_pixels_per_line, 1, - 7+Interp_Extend*2, 8, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass_8(FData + 8*(Interp_Extend-1), dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ + int FData[(7 + Interp_Extend * 2) * 8]; /* Temp data buffer used in filtering */ + + HFilter = vp8_sub_pel_filters_8[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_8[yoffset]; /* 6 tap */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_8(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, + 7 + Interp_Extend * 2, 8, HFilter); + + /* then filter verticaly... */ + filter_block2d_second_pass_8(FData + 8 * (Interp_Extend - 1), dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter); } void vp8_eighttap_predict8x8_sharp_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ - int FData[(7+Interp_Extend*2)*8]; /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters_8s[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_8s[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_8(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, src_pixels_per_line, 1, - 7+Interp_Extend*2, 8, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass_8(FData + 8*(Interp_Extend-1), dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ + int FData[(7 + Interp_Extend * 2) * 8]; /* Temp data buffer used in filtering */ + + HFilter = vp8_sub_pel_filters_8s[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_8s[yoffset]; /* 6 tap */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_8(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, + 7 + Interp_Extend * 2, 8, HFilter); + + /* then filter verticaly... */ + filter_block2d_second_pass_8(FData + 8 * (Interp_Extend - 1), dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter); } void vp8_eighttap_predict_avg8x8_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ - int FData[(7+Interp_Extend*2)*8]; /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters_8[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_8[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_8(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, src_pixels_per_line, 1, - 7+Interp_Extend*2, 8, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass_avg_8(FData + 8*(Interp_Extend-1), dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ + int FData[(7 + Interp_Extend * 2) * 8]; /* Temp data buffer used in filtering */ + + HFilter = vp8_sub_pel_filters_8[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_8[yoffset]; /* 6 tap */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_8(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, + 7 + Interp_Extend * 2, 8, HFilter); + + /* then filter verticaly... */ + filter_block2d_second_pass_avg_8(FData + 8 * (Interp_Extend - 1), dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter); } void vp8_eighttap_predict_avg8x8_sharp_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ - int FData[(7+Interp_Extend*2)*8]; /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters_8s[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_8s[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_8(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, src_pixels_per_line, 1, - 7+Interp_Extend*2, 8, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass_avg_8(FData + 8*(Interp_Extend-1), dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ + int FData[(7 + Interp_Extend * 2) * 8]; /* Temp data buffer used in filtering */ + + HFilter = vp8_sub_pel_filters_8s[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_8s[yoffset]; /* 6 tap */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_8(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, + 7 + Interp_Extend * 2, 8, HFilter); + + /* then filter verticaly... */ + filter_block2d_second_pass_avg_8(FData + 8 * (Interp_Extend - 1), dst_ptr, dst_pitch, 8, 8, 8, 8, VFilter); } void vp8_eighttap_predict8x4_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ - int FData[(3+Interp_Extend*2)*8]; /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters_8[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_8[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_8(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, src_pixels_per_line, 1, - 3+Interp_Extend*2, 8, HFilter); - - - /* then filter verticaly... */ - filter_block2d_second_pass_8(FData + 8*(Interp_Extend-1), dst_ptr, dst_pitch, 8, 8, 4, 8, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ + int FData[(3 + Interp_Extend * 2) * 8]; /* Temp data buffer used in filtering */ + + HFilter = vp8_sub_pel_filters_8[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_8[yoffset]; /* 6 tap */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_8(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, + 3 + Interp_Extend * 2, 8, HFilter); + + + /* then filter verticaly... */ + filter_block2d_second_pass_8(FData + 8 * (Interp_Extend - 1), dst_ptr, dst_pitch, 8, 8, 4, 8, VFilter); } void vp8_eighttap_predict8x4_sharp_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ - int FData[(3+Interp_Extend*2)*8]; /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters_8s[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_8s[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_8(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, src_pixels_per_line, 1, - 3+Interp_Extend*2, 8, HFilter); - - - /* then filter verticaly... */ - filter_block2d_second_pass_8(FData + 8*(Interp_Extend-1), dst_ptr, dst_pitch, 8, 8, 4, 8, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + // int FData[(7+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ + int FData[(3 + Interp_Extend * 2) * 8]; /* Temp data buffer used in filtering */ + + HFilter = vp8_sub_pel_filters_8s[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_8s[yoffset]; /* 6 tap */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_8(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, + 3 + Interp_Extend * 2, 8, HFilter); + + + /* then filter verticaly... */ + filter_block2d_second_pass_8(FData + 8 * (Interp_Extend - 1), dst_ptr, dst_pitch, 8, 8, 4, 8, VFilter); } void vp8_eighttap_predict16x16_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - // int FData[(15+Interp_Extend*2)*24]; /* Temp data buffer used in filtering */ - int FData[(15+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ - - - HFilter = vp8_sub_pel_filters_8[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_8[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_8(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, src_pixels_per_line, 1, - 15+Interp_Extend*2, 16, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass_8(FData + 16*(Interp_Extend-1), dst_ptr, dst_pitch, 16, 16, 16, 16, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + // int FData[(15+Interp_Extend*2)*24]; /* Temp data buffer used in filtering */ + int FData[(15 + Interp_Extend * 2) * 16]; /* Temp data buffer used in filtering */ + + + HFilter = vp8_sub_pel_filters_8[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_8[yoffset]; /* 6 tap */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_8(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, + 15 + Interp_Extend * 2, 16, HFilter); + + /* then filter verticaly... */ + filter_block2d_second_pass_8(FData + 16 * (Interp_Extend - 1), dst_ptr, dst_pitch, 16, 16, 16, 16, VFilter); } void vp8_eighttap_predict16x16_sharp_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - // int FData[(15+Interp_Extend*2)*24]; /* Temp data buffer used in filtering */ - int FData[(15+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ - - - HFilter = vp8_sub_pel_filters_8s[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_8s[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_8(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, src_pixels_per_line, 1, - 15+Interp_Extend*2, 16, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass_8(FData + 16*(Interp_Extend-1), dst_ptr, dst_pitch, 16, 16, 16, 16, VFilter); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + // int FData[(15+Interp_Extend*2)*24]; /* Temp data buffer used in filtering */ + int FData[(15 + Interp_Extend * 2) * 16]; /* Temp data buffer used in filtering */ + + + HFilter = vp8_sub_pel_filters_8s[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_8s[yoffset]; /* 6 tap */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_8(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, src_pixels_per_line, 1, + 15 + Interp_Extend * 2, 16, HFilter); + + /* then filter verticaly... */ + filter_block2d_second_pass_8(FData + 16 * (Interp_Extend - 1), dst_ptr, dst_pitch, 16, 16, 16, 16, VFilter); } void vp8_eighttap_predict_avg16x16_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - // int FData[(15+Interp_Extend*2)*24]; /* Temp data buffer used in filtering */ - int FData[(15+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters_8[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_8[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_8(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, - src_pixels_per_line, 1, 15+Interp_Extend*2, 16, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass_avg_8(FData + 16*(Interp_Extend-1), dst_ptr, dst_pitch, + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + // int FData[(15+Interp_Extend*2)*24]; /* Temp data buffer used in filtering */ + int FData[(15 + Interp_Extend * 2) * 16]; /* Temp data buffer used in filtering */ + + HFilter = vp8_sub_pel_filters_8[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_8[yoffset]; /* 6 tap */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_8(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, + src_pixels_per_line, 1, 15 + Interp_Extend * 2, 16, HFilter); + + /* then filter verticaly... */ + filter_block2d_second_pass_avg_8(FData + 16 * (Interp_Extend - 1), dst_ptr, dst_pitch, 16, 16, 16, 16, VFilter); } void vp8_eighttap_predict_avg16x16_sharp_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - // int FData[(15+Interp_Extend*2)*24]; /* Temp data buffer used in filtering */ - int FData[(15+Interp_Extend*2)*16]; /* Temp data buffer used in filtering */ - - HFilter = vp8_sub_pel_filters_8s[xoffset]; /* 6 tap */ - VFilter = vp8_sub_pel_filters_8s[yoffset]; /* 6 tap */ - - /* First filter 1-D horizontally... */ - filter_block2d_first_pass_8(src_ptr - ((Interp_Extend-1) * src_pixels_per_line), FData, - src_pixels_per_line, 1, 15+Interp_Extend*2, 16, HFilter); - - /* then filter verticaly... */ - filter_block2d_second_pass_avg_8(FData + 16*(Interp_Extend-1), dst_ptr, dst_pitch, + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + // int FData[(15+Interp_Extend*2)*24]; /* Temp data buffer used in filtering */ + int FData[(15 + Interp_Extend * 2) * 16]; /* Temp data buffer used in filtering */ + + HFilter = vp8_sub_pel_filters_8s[xoffset]; /* 6 tap */ + VFilter = vp8_sub_pel_filters_8s[yoffset]; /* 6 tap */ + + /* First filter 1-D horizontally... */ + filter_block2d_first_pass_8(src_ptr - ((Interp_Extend - 1) * src_pixels_per_line), FData, + src_pixels_per_line, 1, 15 + Interp_Extend * 2, 16, HFilter); + + /* then filter verticaly... */ + filter_block2d_second_pass_avg_8(FData + 16 * (Interp_Extend - 1), dst_ptr, dst_pitch, 16, 16, 16, 16, VFilter); } @@ -1252,31 +1205,28 @@ void vp8_eighttap_predict_avg16x16_sharp_c ****************************************************************************/ static void filter_block2d_bil_first_pass ( - unsigned char *src_ptr, - unsigned short *dst_ptr, - unsigned int src_stride, - unsigned int height, - unsigned int width, - const short *vp8_filter -) -{ - unsigned int i, j; - - for (i = 0; i < height; i++) - { - for (j = 0; j < width; j++) - { - /* Apply bilinear filter */ - dst_ptr[j] = (((int)src_ptr[0] * vp8_filter[0]) + - ((int)src_ptr[1] * vp8_filter[1]) + - (VP8_FILTER_WEIGHT / 2)) >> VP8_FILTER_SHIFT; - src_ptr++; - } - - /* Next row... */ - src_ptr += src_stride - width; - dst_ptr += width; + unsigned char *src_ptr, + unsigned short *dst_ptr, + unsigned int src_stride, + unsigned int height, + unsigned int width, + const short *vp8_filter +) { + unsigned int i, j; + + for (i = 0; i < height; i++) { + for (j = 0; j < width; j++) { + /* Apply bilinear filter */ + dst_ptr[j] = (((int)src_ptr[0] * vp8_filter[0]) + + ((int)src_ptr[1] * vp8_filter[1]) + + (VP8_FILTER_WEIGHT / 2)) >> VP8_FILTER_SHIFT; + src_ptr++; } + + /* Next row... */ + src_ptr += src_stride - width; + dst_ptr += width; + } } /**************************************************************************** @@ -1303,32 +1253,29 @@ static void filter_block2d_bil_first_pass ****************************************************************************/ static void filter_block2d_bil_second_pass ( - unsigned short *src_ptr, - unsigned char *dst_ptr, - int dst_pitch, - unsigned int height, - unsigned int width, - const short *vp8_filter -) -{ - unsigned int i, j; - int Temp; - - for (i = 0; i < height; i++) - { - for (j = 0; j < width; j++) - { - /* Apply filter */ - Temp = ((int)src_ptr[0] * vp8_filter[0]) + - ((int)src_ptr[width] * vp8_filter[1]) + - (VP8_FILTER_WEIGHT / 2); - dst_ptr[j] = (unsigned int)(Temp >> VP8_FILTER_SHIFT); - src_ptr++; - } - - /* Next row... */ - dst_ptr += dst_pitch; + unsigned short *src_ptr, + unsigned char *dst_ptr, + int dst_pitch, + unsigned int height, + unsigned int width, + const short *vp8_filter +) { + unsigned int i, j; + int Temp; + + for (i = 0; i < height; i++) { + for (j = 0; j < width; j++) { + /* Apply filter */ + Temp = ((int)src_ptr[0] * vp8_filter[0]) + + ((int)src_ptr[width] * vp8_filter[1]) + + (VP8_FILTER_WEIGHT / 2); + dst_ptr[j] = (unsigned int)(Temp >> VP8_FILTER_SHIFT); + src_ptr++; } + + /* Next row... */ + dst_ptr += dst_pitch; + } } /* @@ -1342,32 +1289,29 @@ static void filter_block2d_bil_second_pass */ static void filter_block2d_bil_second_pass_avg ( - unsigned short *src_ptr, - unsigned char *dst_ptr, - int dst_pitch, - unsigned int height, - unsigned int width, - const short *vp8_filter -) -{ - unsigned int i, j; - int Temp; - - for (i = 0; i < height; i++) - { - for (j = 0; j < width; j++) - { - /* Apply filter */ - Temp = ((int)src_ptr[0] * vp8_filter[0]) + - ((int)src_ptr[width] * vp8_filter[1]) + - (VP8_FILTER_WEIGHT / 2); - dst_ptr[j] = (unsigned int)(((Temp >> VP8_FILTER_SHIFT) + dst_ptr[j] + 1) >> 1); - src_ptr++; - } - - /* Next row... */ - dst_ptr += dst_pitch; + unsigned short *src_ptr, + unsigned char *dst_ptr, + int dst_pitch, + unsigned int height, + unsigned int width, + const short *vp8_filter +) { + unsigned int i, j; + int Temp; + + for (i = 0; i < height; i++) { + for (j = 0; j < width; j++) { + /* Apply filter */ + Temp = ((int)src_ptr[0] * vp8_filter[0]) + + ((int)src_ptr[width] * vp8_filter[1]) + + (VP8_FILTER_WEIGHT / 2); + dst_ptr[j] = (unsigned int)(((Temp >> VP8_FILTER_SHIFT) + dst_ptr[j] + 1) >> 1); + src_ptr++; } + + /* Next row... */ + dst_ptr += dst_pitch; + } } /**************************************************************************** @@ -1395,200 +1339,189 @@ static void filter_block2d_bil_second_pass_avg ****************************************************************************/ static void filter_block2d_bil ( - unsigned char *src_ptr, - unsigned char *dst_ptr, - unsigned int src_pitch, - unsigned int dst_pitch, - const short *HFilter, - const short *VFilter, - int Width, - int Height -) -{ - - unsigned short FData[17*16]; /* Temp data buffer used in filtering */ - - /* First filter 1-D horizontally... */ - filter_block2d_bil_first_pass(src_ptr, FData, src_pitch, Height + 1, Width, HFilter); - - /* then 1-D vertically... */ - filter_block2d_bil_second_pass(FData, dst_ptr, dst_pitch, Height, Width, VFilter); + unsigned char *src_ptr, + unsigned char *dst_ptr, + unsigned int src_pitch, + unsigned int dst_pitch, + const short *HFilter, + const short *VFilter, + int Width, + int Height +) { + + unsigned short FData[17 * 16]; /* Temp data buffer used in filtering */ + + /* First filter 1-D horizontally... */ + filter_block2d_bil_first_pass(src_ptr, FData, src_pitch, Height + 1, Width, HFilter); + + /* then 1-D vertically... */ + filter_block2d_bil_second_pass(FData, dst_ptr, dst_pitch, Height, Width, VFilter); } static void filter_block2d_bil_avg ( - unsigned char *src_ptr, - unsigned char *dst_ptr, - unsigned int src_pitch, - unsigned int dst_pitch, - const short *HFilter, - const short *VFilter, - int Width, - int Height -) -{ - unsigned short FData[17*16]; /* Temp data buffer used in filtering */ - - /* First filter 1-D horizontally... */ - filter_block2d_bil_first_pass(src_ptr, FData, src_pitch, Height + 1, Width, HFilter); - - /* then 1-D vertically... */ - filter_block2d_bil_second_pass_avg(FData, dst_ptr, dst_pitch, Height, Width, VFilter); + unsigned char *src_ptr, + unsigned char *dst_ptr, + unsigned int src_pitch, + unsigned int dst_pitch, + const short *HFilter, + const short *VFilter, + int Width, + int Height +) { + unsigned short FData[17 * 16]; /* Temp data buffer used in filtering */ + + /* First filter 1-D horizontally... */ + filter_block2d_bil_first_pass(src_ptr, FData, src_pitch, Height + 1, Width, HFilter); + + /* then 1-D vertically... */ + filter_block2d_bil_second_pass_avg(FData, dst_ptr, dst_pitch, Height, Width, VFilter); } void vp8_bilinear_predict4x4_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_bilinear_filters[xoffset]; + VFilter = vp8_bilinear_filters[yoffset]; #if 0 - { - int i; - unsigned char temp1[16]; - unsigned char temp2[16]; + { + int i; + unsigned char temp1[16]; + unsigned char temp2[16]; + + bilinear_predict4x4_mmx(src_ptr, src_pixels_per_line, xoffset, yoffset, temp1, 4); + filter_block2d_bil(src_ptr, temp2, src_pixels_per_line, 4, HFilter, VFilter, 4, 4); + for (i = 0; i < 16; i++) { + if (temp1[i] != temp2[i]) { bilinear_predict4x4_mmx(src_ptr, src_pixels_per_line, xoffset, yoffset, temp1, 4); filter_block2d_bil(src_ptr, temp2, src_pixels_per_line, 4, HFilter, VFilter, 4, 4); - - for (i = 0; i < 16; i++) - { - if (temp1[i] != temp2[i]) - { - bilinear_predict4x4_mmx(src_ptr, src_pixels_per_line, xoffset, yoffset, temp1, 4); - filter_block2d_bil(src_ptr, temp2, src_pixels_per_line, 4, HFilter, VFilter, 4, 4); - } - } + } } + } #endif - filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 4, 4); + filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 4, 4); } void vp8_bilinear_predict_avg4x4_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - filter_block2d_bil_avg(src_ptr, dst_ptr, src_pixels_per_line, - dst_pitch, HFilter, VFilter, 4, 4); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_bilinear_filters[xoffset]; + VFilter = vp8_bilinear_filters[yoffset]; + + filter_block2d_bil_avg(src_ptr, dst_ptr, src_pixels_per_line, + dst_pitch, HFilter, VFilter, 4, 4); } void vp8_bilinear_predict8x8_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 8); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_bilinear_filters[xoffset]; + VFilter = vp8_bilinear_filters[yoffset]; + + filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 8); } void vp8_bilinear_predict_avg8x8_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - filter_block2d_bil_avg(src_ptr, dst_ptr, src_pixels_per_line, - dst_pitch, HFilter, VFilter, 8, 8); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_bilinear_filters[xoffset]; + VFilter = vp8_bilinear_filters[yoffset]; + + filter_block2d_bil_avg(src_ptr, dst_ptr, src_pixels_per_line, + dst_pitch, HFilter, VFilter, 8, 8); } void vp8_bilinear_predict8x4_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 4); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_bilinear_filters[xoffset]; + VFilter = vp8_bilinear_filters[yoffset]; + + filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 8, 4); } void vp8_bilinear_predict16x16_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 16, 16); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_bilinear_filters[xoffset]; + VFilter = vp8_bilinear_filters[yoffset]; + + filter_block2d_bil(src_ptr, dst_ptr, src_pixels_per_line, dst_pitch, HFilter, VFilter, 16, 16); } void vp8_bilinear_predict_avg16x16_c ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - const short *HFilter; - const short *VFilter; - - HFilter = vp8_bilinear_filters[xoffset]; - VFilter = vp8_bilinear_filters[yoffset]; - - filter_block2d_bil_avg(src_ptr, dst_ptr, src_pixels_per_line, - dst_pitch, HFilter, VFilter, 16, 16); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + const short *HFilter; + const short *VFilter; + + HFilter = vp8_bilinear_filters[xoffset]; + VFilter = vp8_bilinear_filters[yoffset]; + + filter_block2d_bil_avg(src_ptr, dst_ptr, src_pixels_per_line, + dst_pitch, HFilter, VFilter, 16, 16); } diff --git a/vp8/common/filter.h b/vp8/common/filter.h index d1be97549..db97d1afc 100644 --- a/vp8/common/filter.h +++ b/vp8/common/filter.h @@ -29,4 +29,4 @@ extern const short vp8_sub_pel_filters_6[SUBPEL_SHIFTS][6]; extern const short vp8_sub_pel_filters_8[SUBPEL_SHIFTS][8]; extern const short vp8_sub_pel_filters_8s[SUBPEL_SHIFTS][8]; -#endif //FILTER_H +#endif // FILTER_H diff --git a/vp8/common/findnearmv.c b/vp8/common/findnearmv.c index ada9d3aca..8a67162bd 100644 --- a/vp8/common/findnearmv.c +++ b/vp8/common/findnearmv.c @@ -12,10 +12,10 @@ #include "findnearmv.h" const unsigned char vp8_mbsplit_offset[4][16] = { - { 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 2, 8, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} + { 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 2, 8, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} }; /* Predict motion vectors using those from already-decoded nearby blocks. @@ -24,162 +24,144 @@ const unsigned char vp8_mbsplit_offset[4][16] = { void vp8_find_near_mvs ( - MACROBLOCKD *xd, - const MODE_INFO *here, - const MODE_INFO *lf_here, - int_mv *nearest, - int_mv *nearby, - int_mv *best_mv, - int cnt[4], - int refframe, - int *ref_frame_sign_bias -) -{ - const MODE_INFO *above = here - xd->mode_info_stride; - const MODE_INFO *left = here - 1; - const MODE_INFO *aboveleft = above - 1; - const MODE_INFO *third = NULL; - int_mv near_mvs[4]; - int_mv *mv = near_mvs; - int *cntx = cnt; - enum {CNT_INTRA, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV}; - - /* Zero accumulators */ - mv[0].as_int = mv[1].as_int = mv[2].as_int = 0; - cnt[0] = cnt[1] = cnt[2] = cnt[3] = 0; - - /* Process above */ - if (above->mbmi.ref_frame != INTRA_FRAME) - { - if (above->mbmi.mv.as_int) - { - (++mv)->as_int = above->mbmi.mv.as_int; - mv_bias(ref_frame_sign_bias[above->mbmi.ref_frame], - refframe, mv, ref_frame_sign_bias); - ++cntx; - } - *cntx += 2; + MACROBLOCKD *xd, + const MODE_INFO *here, + const MODE_INFO *lf_here, + int_mv *nearest, + int_mv *nearby, + int_mv *best_mv, + int cnt[4], + int refframe, + int *ref_frame_sign_bias +) { + const MODE_INFO *above = here - xd->mode_info_stride; + const MODE_INFO *left = here - 1; + const MODE_INFO *aboveleft = above - 1; + const MODE_INFO *third = NULL; + int_mv near_mvs[4]; + int_mv *mv = near_mvs; + int *cntx = cnt; + enum {CNT_INTRA, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV}; + + /* Zero accumulators */ + mv[0].as_int = mv[1].as_int = mv[2].as_int = 0; + cnt[0] = cnt[1] = cnt[2] = cnt[3] = 0; + + /* Process above */ + if (above->mbmi.ref_frame != INTRA_FRAME) { + if (above->mbmi.mv.as_int) { + (++mv)->as_int = above->mbmi.mv.as_int; + mv_bias(ref_frame_sign_bias[above->mbmi.ref_frame], + refframe, mv, ref_frame_sign_bias); + ++cntx; } - - /* Process left */ - if (left->mbmi.ref_frame != INTRA_FRAME) - { - if (left->mbmi.mv.as_int) - { - int_mv this_mv; - this_mv.as_int = left->mbmi.mv.as_int; - mv_bias(ref_frame_sign_bias[left->mbmi.ref_frame], - refframe, &this_mv, ref_frame_sign_bias); - - if (this_mv.as_int != mv->as_int) - { - (++mv)->as_int = this_mv.as_int; - ++cntx; - } - *cntx += 2; - } - else - cnt[CNT_INTRA] += 2; - } - /* Process above left or the one from last frame */ - if ( aboveleft->mbmi.ref_frame != INTRA_FRAME|| - (lf_here->mbmi.ref_frame==LAST_FRAME && refframe == LAST_FRAME)) - { - if (aboveleft->mbmi.mv.as_int) - { - third = aboveleft; - } - else if(lf_here->mbmi.mv.as_int) - { - third = lf_here; - } - if(third) - { - int_mv this_mv; - this_mv.as_int = third->mbmi.mv.as_int; - mv_bias(ref_frame_sign_bias[third->mbmi.ref_frame], - refframe, &this_mv, ref_frame_sign_bias); - - if (this_mv.as_int != mv->as_int) - { - (++mv)->as_int = this_mv.as_int; - ++cntx; - } - *cntx += 1; - } - else - cnt[CNT_INTRA] += 1; + *cntx += 2; + } + + /* Process left */ + if (left->mbmi.ref_frame != INTRA_FRAME) { + if (left->mbmi.mv.as_int) { + int_mv this_mv; + this_mv.as_int = left->mbmi.mv.as_int; + mv_bias(ref_frame_sign_bias[left->mbmi.ref_frame], + refframe, &this_mv, ref_frame_sign_bias); + + if (this_mv.as_int != mv->as_int) { + (++mv)->as_int = this_mv.as_int; + ++cntx; + } + *cntx += 2; + } else + cnt[CNT_INTRA] += 2; + } + /* Process above left or the one from last frame */ + if (aboveleft->mbmi.ref_frame != INTRA_FRAME || + (lf_here->mbmi.ref_frame == LAST_FRAME && refframe == LAST_FRAME)) { + if (aboveleft->mbmi.mv.as_int) { + third = aboveleft; + } else if (lf_here->mbmi.mv.as_int) { + third = lf_here; } - - /* If we have three distinct MV's ... */ - if (cnt[CNT_SPLITMV]) - { - /* See if the third MV can be merged with NEAREST */ - if (mv->as_int == near_mvs[CNT_NEAREST].as_int) - cnt[CNT_NEAREST] += 1; - } - - cnt[CNT_SPLITMV] = ((above->mbmi.mode == SPLITMV) - + (left->mbmi.mode == SPLITMV)) * 2 - + ( - lf_here->mbmi.mode == SPLITMV || + if (third) { + int_mv this_mv; + this_mv.as_int = third->mbmi.mv.as_int; + mv_bias(ref_frame_sign_bias[third->mbmi.ref_frame], + refframe, &this_mv, ref_frame_sign_bias); + + if (this_mv.as_int != mv->as_int) { + (++mv)->as_int = this_mv.as_int; + ++cntx; + } + *cntx += 1; + } else + cnt[CNT_INTRA] += 1; + } + + /* If we have three distinct MV's ... */ + if (cnt[CNT_SPLITMV]) { + /* See if the third MV can be merged with NEAREST */ + if (mv->as_int == near_mvs[CNT_NEAREST].as_int) + cnt[CNT_NEAREST] += 1; + } + + cnt[CNT_SPLITMV] = ((above->mbmi.mode == SPLITMV) + + (left->mbmi.mode == SPLITMV)) * 2 + + ( + lf_here->mbmi.mode == SPLITMV || aboveleft->mbmi.mode == SPLITMV); - /* Swap near and nearest if necessary */ - if (cnt[CNT_NEAR] > cnt[CNT_NEAREST]) - { - int tmp; - tmp = cnt[CNT_NEAREST]; - cnt[CNT_NEAREST] = cnt[CNT_NEAR]; - cnt[CNT_NEAR] = tmp; - tmp = near_mvs[CNT_NEAREST].as_int; - near_mvs[CNT_NEAREST].as_int = near_mvs[CNT_NEAR].as_int; - near_mvs[CNT_NEAR].as_int = tmp; - } - - /* Use near_mvs[0] to store the "best" MV */ - if (cnt[CNT_NEAREST] >= cnt[CNT_INTRA]) - near_mvs[CNT_INTRA] = near_mvs[CNT_NEAREST]; - - /* Set up return values */ - best_mv->as_int = near_mvs[0].as_int; - nearest->as_int = near_mvs[CNT_NEAREST].as_int; - nearby->as_int = near_mvs[CNT_NEAR].as_int; - - /* Make sure that the 1/8th bits of the Mvs are zero if high_precision - * is not being used, by truncating the last bit towards 0 - */ + /* Swap near and nearest if necessary */ + if (cnt[CNT_NEAR] > cnt[CNT_NEAREST]) { + int tmp; + tmp = cnt[CNT_NEAREST]; + cnt[CNT_NEAREST] = cnt[CNT_NEAR]; + cnt[CNT_NEAR] = tmp; + tmp = near_mvs[CNT_NEAREST].as_int; + near_mvs[CNT_NEAREST].as_int = near_mvs[CNT_NEAR].as_int; + near_mvs[CNT_NEAR].as_int = tmp; + } + + /* Use near_mvs[0] to store the "best" MV */ + if (cnt[CNT_NEAREST] >= cnt[CNT_INTRA]) + near_mvs[CNT_INTRA] = near_mvs[CNT_NEAREST]; + + /* Set up return values */ + best_mv->as_int = near_mvs[0].as_int; + nearest->as_int = near_mvs[CNT_NEAREST].as_int; + nearby->as_int = near_mvs[CNT_NEAR].as_int; + + /* Make sure that the 1/8th bits of the Mvs are zero if high_precision + * is not being used, by truncating the last bit towards 0 + */ #if CONFIG_HIGH_PRECISION_MV - if (!xd->allow_high_precision_mv) - { - if (best_mv->as_mv.row & 1) - best_mv->as_mv.row += (best_mv->as_mv.row > 0 ? -1 : 1); - if (best_mv->as_mv.col & 1) - best_mv->as_mv.col += (best_mv->as_mv.col > 0 ? -1 : 1); - if (nearest->as_mv.row & 1) - nearest->as_mv.row += (nearest->as_mv.row > 0 ? -1 : 1); - if (nearest->as_mv.col & 1) - nearest->as_mv.col += (nearest->as_mv.col > 0 ? -1 : 1); - if (nearby->as_mv.row & 1) - nearby->as_mv.row += (nearby->as_mv.row > 0 ? -1 : 1); - if (nearby->as_mv.col & 1) - nearby->as_mv.col += (nearby->as_mv.col > 0 ? -1 : 1); - } + if (!xd->allow_high_precision_mv) { + if (best_mv->as_mv.row & 1) + best_mv->as_mv.row += (best_mv->as_mv.row > 0 ? -1 : 1); + if (best_mv->as_mv.col & 1) + best_mv->as_mv.col += (best_mv->as_mv.col > 0 ? -1 : 1); + if (nearest->as_mv.row & 1) + nearest->as_mv.row += (nearest->as_mv.row > 0 ? -1 : 1); + if (nearest->as_mv.col & 1) + nearest->as_mv.col += (nearest->as_mv.col > 0 ? -1 : 1); + if (nearby->as_mv.row & 1) + nearby->as_mv.row += (nearby->as_mv.row > 0 ? -1 : 1); + if (nearby->as_mv.col & 1) + nearby->as_mv.col += (nearby->as_mv.col > 0 ? -1 : 1); + } #endif - //TODO: move clamp outside findnearmv - vp8_clamp_mv2(nearest, xd); - vp8_clamp_mv2(nearby, xd); - vp8_clamp_mv2(best_mv, xd); + // TODO: move clamp outside findnearmv + vp8_clamp_mv2(nearest, xd); + vp8_clamp_mv2(nearby, xd); + vp8_clamp_mv2(best_mv, xd); } vp8_prob *vp8_mv_ref_probs(VP8_COMMON *pc, - vp8_prob p[VP8_MVREFS-1], const int near_mv_ref_ct[4] -) -{ - p[0] = pc->fc.vp8_mode_contexts [near_mv_ref_ct[0]] [0]; - p[1] = pc->fc.vp8_mode_contexts [near_mv_ref_ct[1]] [1]; - p[2] = pc->fc.vp8_mode_contexts [near_mv_ref_ct[2]] [2]; - p[3] = pc->fc.vp8_mode_contexts [near_mv_ref_ct[3]] [3]; - return p; + vp8_prob p[VP8_MVREFS - 1], const int near_mv_ref_ct[4] + ) { + p[0] = pc->fc.vp8_mode_contexts [near_mv_ref_ct[0]] [0]; + p[1] = pc->fc.vp8_mode_contexts [near_mv_ref_ct[1]] [1]; + p[2] = pc->fc.vp8_mode_contexts [near_mv_ref_ct[2]] [2]; + p[3] = pc->fc.vp8_mode_contexts [near_mv_ref_ct[3]] [3]; + return p; } diff --git a/vp8/common/findnearmv.h b/vp8/common/findnearmv.h index 849de2ea1..d4769e608 100644 --- a/vp8/common/findnearmv.h +++ b/vp8/common/findnearmv.h @@ -19,190 +19,171 @@ #include "onyxc_int.h" -static void mv_bias(int refmb_ref_frame_sign_bias, int refframe, int_mv *mvp, const int *ref_frame_sign_bias) -{ - MV xmv; - xmv = mvp->as_mv; - - if (refmb_ref_frame_sign_bias != ref_frame_sign_bias[refframe]) - { - xmv.row *= -1; - xmv.col *= -1; - } +static void mv_bias(int refmb_ref_frame_sign_bias, int refframe, int_mv *mvp, const int *ref_frame_sign_bias) { + MV xmv; + xmv = mvp->as_mv; + + if (refmb_ref_frame_sign_bias != ref_frame_sign_bias[refframe]) { + xmv.row *= -1; + xmv.col *= -1; + } - mvp->as_mv = xmv; + mvp->as_mv = xmv; } #define LEFT_TOP_MARGIN (16 << 3) #define RIGHT_BOTTOM_MARGIN (16 << 3) -static void vp8_clamp_mv2(int_mv *mv, const MACROBLOCKD *xd) -{ - if (mv->as_mv.col < (xd->mb_to_left_edge - LEFT_TOP_MARGIN)) - mv->as_mv.col = xd->mb_to_left_edge - LEFT_TOP_MARGIN; - else if (mv->as_mv.col > xd->mb_to_right_edge + RIGHT_BOTTOM_MARGIN) - mv->as_mv.col = xd->mb_to_right_edge + RIGHT_BOTTOM_MARGIN; - - if (mv->as_mv.row < (xd->mb_to_top_edge - LEFT_TOP_MARGIN)) - mv->as_mv.row = xd->mb_to_top_edge - LEFT_TOP_MARGIN; - else if (mv->as_mv.row > xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN) - mv->as_mv.row = xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN; +static void vp8_clamp_mv2(int_mv *mv, const MACROBLOCKD *xd) { + if (mv->as_mv.col < (xd->mb_to_left_edge - LEFT_TOP_MARGIN)) + mv->as_mv.col = xd->mb_to_left_edge - LEFT_TOP_MARGIN; + else if (mv->as_mv.col > xd->mb_to_right_edge + RIGHT_BOTTOM_MARGIN) + mv->as_mv.col = xd->mb_to_right_edge + RIGHT_BOTTOM_MARGIN; + + if (mv->as_mv.row < (xd->mb_to_top_edge - LEFT_TOP_MARGIN)) + mv->as_mv.row = xd->mb_to_top_edge - LEFT_TOP_MARGIN; + else if (mv->as_mv.row > xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN) + mv->as_mv.row = xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN; } static void vp8_clamp_mv(int_mv *mv, int mb_to_left_edge, int mb_to_right_edge, - int mb_to_top_edge, int mb_to_bottom_edge) -{ - mv->as_mv.col = (mv->as_mv.col < mb_to_left_edge) ? - mb_to_left_edge : mv->as_mv.col; - mv->as_mv.col = (mv->as_mv.col > mb_to_right_edge) ? - mb_to_right_edge : mv->as_mv.col; - mv->as_mv.row = (mv->as_mv.row < mb_to_top_edge) ? - mb_to_top_edge : mv->as_mv.row; - mv->as_mv.row = (mv->as_mv.row > mb_to_bottom_edge) ? - mb_to_bottom_edge : mv->as_mv.row; + int mb_to_top_edge, int mb_to_bottom_edge) { + mv->as_mv.col = (mv->as_mv.col < mb_to_left_edge) ? + mb_to_left_edge : mv->as_mv.col; + mv->as_mv.col = (mv->as_mv.col > mb_to_right_edge) ? + mb_to_right_edge : mv->as_mv.col; + mv->as_mv.row = (mv->as_mv.row < mb_to_top_edge) ? + mb_to_top_edge : mv->as_mv.row; + mv->as_mv.row = (mv->as_mv.row > mb_to_bottom_edge) ? + mb_to_bottom_edge : mv->as_mv.row; } static unsigned int vp8_check_mv_bounds(int_mv *mv, int mb_to_left_edge, - int mb_to_right_edge, int mb_to_top_edge, - int mb_to_bottom_edge) -{ - unsigned int need_to_clamp; - need_to_clamp = (mv->as_mv.col < mb_to_left_edge) ? 1 : 0; - need_to_clamp |= (mv->as_mv.col > mb_to_right_edge) ? 1 : 0; - need_to_clamp |= (mv->as_mv.row < mb_to_top_edge) ? 1 : 0; - need_to_clamp |= (mv->as_mv.row > mb_to_bottom_edge) ? 1 : 0; - return need_to_clamp; + int mb_to_right_edge, int mb_to_top_edge, + int mb_to_bottom_edge) { + unsigned int need_to_clamp; + need_to_clamp = (mv->as_mv.col < mb_to_left_edge) ? 1 : 0; + need_to_clamp |= (mv->as_mv.col > mb_to_right_edge) ? 1 : 0; + need_to_clamp |= (mv->as_mv.row < mb_to_top_edge) ? 1 : 0; + need_to_clamp |= (mv->as_mv.row > mb_to_bottom_edge) ? 1 : 0; + return need_to_clamp; } void vp8_find_near_mvs ( - MACROBLOCKD *xd, - const MODE_INFO *here, - const MODE_INFO *lfhere, - int_mv *nearest, int_mv *nearby, int_mv *best, - int near_mv_ref_cts[4], - int refframe, - int *ref_frame_sign_bias + MACROBLOCKD *xd, + const MODE_INFO *here, + const MODE_INFO *lfhere, + int_mv *nearest, int_mv *nearby, int_mv *best, + int near_mv_ref_cts[4], + int refframe, + int *ref_frame_sign_bias ); vp8_prob *vp8_mv_ref_probs(VP8_COMMON *pc, - vp8_prob p[VP8_MVREFS-1], const int near_mv_ref_ct[4] -); + vp8_prob p[VP8_MVREFS - 1], const int near_mv_ref_ct[4] + ); extern const unsigned char vp8_mbsplit_offset[4][16]; -static int left_block_mv(const MODE_INFO *cur_mb, int b) -{ - if (!(b & 3)) - { - /* On L edge, get from MB to left of us */ - --cur_mb; +static int left_block_mv(const MODE_INFO *cur_mb, int b) { + if (!(b & 3)) { + /* On L edge, get from MB to left of us */ + --cur_mb; - if(cur_mb->mbmi.mode != SPLITMV) - return cur_mb->mbmi.mv.as_int; - b += 4; - } + if (cur_mb->mbmi.mode != SPLITMV) + return cur_mb->mbmi.mv.as_int; + b += 4; + } - return (cur_mb->bmi + b - 1)->as_mv.first.as_int; + return (cur_mb->bmi + b - 1)->as_mv.first.as_int; } -static int left_block_second_mv(const MODE_INFO *cur_mb, int b) -{ - if (!(b & 3)) - { - /* On L edge, get from MB to left of us */ - --cur_mb; +static int left_block_second_mv(const MODE_INFO *cur_mb, int b) { + if (!(b & 3)) { + /* On L edge, get from MB to left of us */ + --cur_mb; - if(cur_mb->mbmi.mode != SPLITMV) - return cur_mb->mbmi.second_ref_frame ? cur_mb->mbmi.second_mv.as_int : cur_mb->mbmi.mv.as_int; - b += 4; - } + if (cur_mb->mbmi.mode != SPLITMV) + return cur_mb->mbmi.second_ref_frame ? cur_mb->mbmi.second_mv.as_int : cur_mb->mbmi.mv.as_int; + b += 4; + } - return cur_mb->mbmi.second_ref_frame ? (cur_mb->bmi + b - 1)->as_mv.second.as_int : (cur_mb->bmi + b - 1)->as_mv.first.as_int; + return cur_mb->mbmi.second_ref_frame ? (cur_mb->bmi + b - 1)->as_mv.second.as_int : (cur_mb->bmi + b - 1)->as_mv.first.as_int; } -static int above_block_mv(const MODE_INFO *cur_mb, int b, int mi_stride) -{ - if (!(b >> 2)) - { - /* On top edge, get from MB above us */ - cur_mb -= mi_stride; +static int above_block_mv(const MODE_INFO *cur_mb, int b, int mi_stride) { + if (!(b >> 2)) { + /* On top edge, get from MB above us */ + cur_mb -= mi_stride; - if(cur_mb->mbmi.mode != SPLITMV) - return cur_mb->mbmi.mv.as_int; - b += 16; - } + if (cur_mb->mbmi.mode != SPLITMV) + return cur_mb->mbmi.mv.as_int; + b += 16; + } - return (cur_mb->bmi + b - 4)->as_mv.first.as_int; + return (cur_mb->bmi + b - 4)->as_mv.first.as_int; } -static int above_block_second_mv(const MODE_INFO *cur_mb, int b, int mi_stride) -{ - if (!(b >> 2)) - { - /* On top edge, get from MB above us */ - cur_mb -= mi_stride; +static int above_block_second_mv(const MODE_INFO *cur_mb, int b, int mi_stride) { + if (!(b >> 2)) { + /* On top edge, get from MB above us */ + cur_mb -= mi_stride; - if(cur_mb->mbmi.mode != SPLITMV) - return cur_mb->mbmi.second_ref_frame ? cur_mb->mbmi.second_mv.as_int : cur_mb->mbmi.mv.as_int; - b += 16; - } + if (cur_mb->mbmi.mode != SPLITMV) + return cur_mb->mbmi.second_ref_frame ? cur_mb->mbmi.second_mv.as_int : cur_mb->mbmi.mv.as_int; + b += 16; + } - return cur_mb->mbmi.second_ref_frame ? (cur_mb->bmi + b - 4)->as_mv.second.as_int : (cur_mb->bmi + b - 4)->as_mv.first.as_int; + return cur_mb->mbmi.second_ref_frame ? (cur_mb->bmi + b - 4)->as_mv.second.as_int : (cur_mb->bmi + b - 4)->as_mv.first.as_int; } -static B_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b) -{ - if (!(b & 3)) - { - /* On L edge, get from MB to left of us */ - --cur_mb; - switch (cur_mb->mbmi.mode) - { - case DC_PRED: - return B_DC_PRED; - case V_PRED: - return B_VE_PRED; - case H_PRED: - return B_HE_PRED; - case TM_PRED: - return B_TM_PRED; - case I8X8_PRED: - case B_PRED: - return (cur_mb->bmi + b + 3)->as_mode.first; - default: - return B_DC_PRED; - } +static B_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b) { + if (!(b & 3)) { + /* On L edge, get from MB to left of us */ + --cur_mb; + switch (cur_mb->mbmi.mode) { + case DC_PRED: + return B_DC_PRED; + case V_PRED: + return B_VE_PRED; + case H_PRED: + return B_HE_PRED; + case TM_PRED: + return B_TM_PRED; + case I8X8_PRED: + case B_PRED: + return (cur_mb->bmi + b + 3)->as_mode.first; + default: + return B_DC_PRED; } - return (cur_mb->bmi + b - 1)->as_mode.first; + } + return (cur_mb->bmi + b - 1)->as_mode.first; } static B_PREDICTION_MODE above_block_mode(const MODE_INFO - *cur_mb, int b, int mi_stride) -{ - if (!(b >> 2)) - { - /* On top edge, get from MB above us */ - cur_mb -= mi_stride; - - switch (cur_mb->mbmi.mode) - { - case DC_PRED: - return B_DC_PRED; - case V_PRED: - return B_VE_PRED; - case H_PRED: - return B_HE_PRED; - case TM_PRED: - return B_TM_PRED; - case I8X8_PRED: - case B_PRED: - return (cur_mb->bmi + b + 12)->as_mode.first; - default: - return B_DC_PRED; - } + *cur_mb, int b, int mi_stride) { + if (!(b >> 2)) { + /* On top edge, get from MB above us */ + cur_mb -= mi_stride; + + switch (cur_mb->mbmi.mode) { + case DC_PRED: + return B_DC_PRED; + case V_PRED: + return B_VE_PRED; + case H_PRED: + return B_HE_PRED; + case TM_PRED: + return B_TM_PRED; + case I8X8_PRED: + case B_PRED: + return (cur_mb->bmi + b + 12)->as_mode.first; + default: + return B_DC_PRED; } + } - return (cur_mb->bmi + b - 4)->as_mode.first; + return (cur_mb->bmi + b - 4)->as_mode.first; } #endif diff --git a/vp8/common/g_common.h b/vp8/common/g_common.h index 5f523980b..0955aa619 100644 --- a/vp8/common/g_common.h +++ b/vp8/common/g_common.h @@ -13,9 +13,9 @@ extern void (*vp8_clear_system_state)(void); extern void (*vp8_plane_add_noise)(unsigned char *Start, unsigned int Width, unsigned int Height, int Pitch, int DPitch, int q); extern void (*de_interlace) ( - unsigned char *src_ptr, - unsigned char *dst_ptr, - int Width, - int Height, - int Stride + unsigned char *src_ptr, + unsigned char *dst_ptr, + int Width, + int Height, + int Stride ); diff --git a/vp8/common/generic/systemdependent.c b/vp8/common/generic/systemdependent.c index e6ae6b5ed..df162234c 100644 --- a/vp8/common/generic/systemdependent.c +++ b/vp8/common/generic/systemdependent.c @@ -20,123 +20,122 @@ extern void vp8_arch_x86_common_init(VP8_COMMON *ctx); extern void vp8_arch_arm_common_init(VP8_COMMON *ctx); -void vp8_machine_specific_config(VP8_COMMON *ctx) -{ +void vp8_machine_specific_config(VP8_COMMON *ctx) { #if CONFIG_RUNTIME_CPU_DETECT - VP8_COMMON_RTCD *rtcd = &ctx->rtcd; + VP8_COMMON_RTCD *rtcd = &ctx->rtcd; - rtcd->idct.idct1 = vp8_short_idct4x4llm_1_c; - rtcd->idct.idct16 = vp8_short_idct4x4llm_c; - rtcd->idct.idct1_scalar_add = vp8_dc_only_idct_add_c; - rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_c; - rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_c; - rtcd->idct.idct8 = vp8_short_idct8x8_c; - rtcd->idct.idct1_scalar_add_8x8 = vp8_dc_only_idct_add_8x8_c; - rtcd->idct.ihaar2 = vp8_short_ihaar2x2_c; - rtcd->recon.copy16x16 = vp8_copy_mem16x16_c; - rtcd->recon.copy8x8 = vp8_copy_mem8x8_c; - rtcd->recon.avg16x16 = vp8_avg_mem16x16_c; - rtcd->recon.avg8x8 = vp8_avg_mem8x8_c; - rtcd->recon.copy8x4 = vp8_copy_mem8x4_c; - rtcd->recon.recon = vp8_recon_b_c; - rtcd->recon.recon_uv = vp8_recon_uv_b_c; - rtcd->recon.recon2 = vp8_recon2b_c; - rtcd->recon.recon4 = vp8_recon4b_c; - rtcd->recon.recon_mb = vp8_recon_mb_c; - rtcd->recon.recon_mby = vp8_recon_mby_c; - rtcd->recon.build_intra_predictors_mby = - vp8_build_intra_predictors_mby; + rtcd->idct.idct1 = vp8_short_idct4x4llm_1_c; + rtcd->idct.idct16 = vp8_short_idct4x4llm_c; + rtcd->idct.idct1_scalar_add = vp8_dc_only_idct_add_c; + rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_c; + rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_c; + rtcd->idct.idct8 = vp8_short_idct8x8_c; + rtcd->idct.idct1_scalar_add_8x8 = vp8_dc_only_idct_add_8x8_c; + rtcd->idct.ihaar2 = vp8_short_ihaar2x2_c; + rtcd->recon.copy16x16 = vp8_copy_mem16x16_c; + rtcd->recon.copy8x8 = vp8_copy_mem8x8_c; + rtcd->recon.avg16x16 = vp8_avg_mem16x16_c; + rtcd->recon.avg8x8 = vp8_avg_mem8x8_c; + rtcd->recon.copy8x4 = vp8_copy_mem8x4_c; + rtcd->recon.recon = vp8_recon_b_c; + rtcd->recon.recon_uv = vp8_recon_uv_b_c; + rtcd->recon.recon2 = vp8_recon2b_c; + rtcd->recon.recon4 = vp8_recon4b_c; + rtcd->recon.recon_mb = vp8_recon_mb_c; + rtcd->recon.recon_mby = vp8_recon_mby_c; + rtcd->recon.build_intra_predictors_mby = + vp8_build_intra_predictors_mby; #if CONFIG_COMP_INTRA_PRED - rtcd->recon.build_comp_intra_predictors_mby = - vp8_build_comp_intra_predictors_mby; + rtcd->recon.build_comp_intra_predictors_mby = + vp8_build_comp_intra_predictors_mby; #endif - rtcd->recon.build_intra_predictors_mby_s = - vp8_build_intra_predictors_mby_s; - rtcd->recon.build_intra_predictors_mbuv = - vp8_build_intra_predictors_mbuv; - rtcd->recon.build_intra_predictors_mbuv_s = - vp8_build_intra_predictors_mbuv_s; + rtcd->recon.build_intra_predictors_mby_s = + vp8_build_intra_predictors_mby_s; + rtcd->recon.build_intra_predictors_mbuv = + vp8_build_intra_predictors_mbuv; + rtcd->recon.build_intra_predictors_mbuv_s = + vp8_build_intra_predictors_mbuv_s; #if CONFIG_COMP_INTRA_PRED - rtcd->recon.build_comp_intra_predictors_mbuv = - vp8_build_comp_intra_predictors_mbuv; + rtcd->recon.build_comp_intra_predictors_mbuv = + vp8_build_comp_intra_predictors_mbuv; #endif - rtcd->recon.intra4x4_predict = - vp8_intra4x4_predict; + rtcd->recon.intra4x4_predict = + vp8_intra4x4_predict; #if CONFIG_COMP_INTRA_PRED - rtcd->recon.comp_intra4x4_predict = - vp8_comp_intra4x4_predict; + rtcd->recon.comp_intra4x4_predict = + vp8_comp_intra4x4_predict; #endif - rtcd->recon.intra8x8_predict = - vp8_intra8x8_predict; + rtcd->recon.intra8x8_predict = + vp8_intra8x8_predict; #if CONFIG_COMP_INTRA_PRED - rtcd->recon.comp_intra8x8_predict = - vp8_comp_intra8x8_predict; + rtcd->recon.comp_intra8x8_predict = + vp8_comp_intra8x8_predict; #endif - rtcd->recon.intra_uv4x4_predict = - vp8_intra_uv4x4_predict; + rtcd->recon.intra_uv4x4_predict = + vp8_intra_uv4x4_predict; #if CONFIG_COMP_INTRA_PRED - rtcd->recon.comp_intra_uv4x4_predict = - vp8_comp_intra_uv4x4_predict; + rtcd->recon.comp_intra_uv4x4_predict = + vp8_comp_intra_uv4x4_predict; #endif #if CONFIG_ENHANCED_INTERP - rtcd->subpix.eighttap16x16 = vp8_eighttap_predict16x16_c; - rtcd->subpix.eighttap8x8 = vp8_eighttap_predict8x8_c; - rtcd->subpix.eighttap_avg16x16 = vp8_eighttap_predict_avg16x16_c; - rtcd->subpix.eighttap_avg8x8 = vp8_eighttap_predict_avg8x8_c; - rtcd->subpix.eighttap_avg4x4 = vp8_eighttap_predict_avg4x4_c; - rtcd->subpix.eighttap8x4 = vp8_eighttap_predict8x4_c; - rtcd->subpix.eighttap4x4 = vp8_eighttap_predict_c; - rtcd->subpix.eighttap16x16_sharp = vp8_eighttap_predict16x16_sharp_c; - rtcd->subpix.eighttap8x8_sharp = vp8_eighttap_predict8x8_sharp_c; - rtcd->subpix.eighttap_avg16x16_sharp = vp8_eighttap_predict_avg16x16_sharp_c; - rtcd->subpix.eighttap_avg8x8_sharp = vp8_eighttap_predict_avg8x8_sharp_c; - rtcd->subpix.eighttap_avg4x4_sharp = vp8_eighttap_predict_avg4x4_sharp_c; - rtcd->subpix.eighttap8x4_sharp = vp8_eighttap_predict8x4_sharp_c; - rtcd->subpix.eighttap4x4_sharp = vp8_eighttap_predict_sharp_c; + rtcd->subpix.eighttap16x16 = vp8_eighttap_predict16x16_c; + rtcd->subpix.eighttap8x8 = vp8_eighttap_predict8x8_c; + rtcd->subpix.eighttap_avg16x16 = vp8_eighttap_predict_avg16x16_c; + rtcd->subpix.eighttap_avg8x8 = vp8_eighttap_predict_avg8x8_c; + rtcd->subpix.eighttap_avg4x4 = vp8_eighttap_predict_avg4x4_c; + rtcd->subpix.eighttap8x4 = vp8_eighttap_predict8x4_c; + rtcd->subpix.eighttap4x4 = vp8_eighttap_predict_c; + rtcd->subpix.eighttap16x16_sharp = vp8_eighttap_predict16x16_sharp_c; + rtcd->subpix.eighttap8x8_sharp = vp8_eighttap_predict8x8_sharp_c; + rtcd->subpix.eighttap_avg16x16_sharp = vp8_eighttap_predict_avg16x16_sharp_c; + rtcd->subpix.eighttap_avg8x8_sharp = vp8_eighttap_predict_avg8x8_sharp_c; + rtcd->subpix.eighttap_avg4x4_sharp = vp8_eighttap_predict_avg4x4_sharp_c; + rtcd->subpix.eighttap8x4_sharp = vp8_eighttap_predict8x4_sharp_c; + rtcd->subpix.eighttap4x4_sharp = vp8_eighttap_predict_sharp_c; #endif - rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_c; - rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_c; - rtcd->subpix.sixtap_avg16x16 = vp8_sixtap_predict_avg16x16_c; - rtcd->subpix.sixtap_avg8x8 = vp8_sixtap_predict_avg8x8_c; - rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_c; - rtcd->subpix.sixtap4x4 = vp8_sixtap_predict_c; - rtcd->subpix.sixtap_avg4x4 = vp8_sixtap_predict_avg_c; - rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_c; - rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_c; - rtcd->subpix.bilinear_avg16x16 = vp8_bilinear_predict_avg16x16_c; - rtcd->subpix.bilinear_avg8x8 = vp8_bilinear_predict_avg8x8_c; - rtcd->subpix.bilinear8x4 = vp8_bilinear_predict8x4_c; - rtcd->subpix.bilinear4x4 = vp8_bilinear_predict4x4_c; - rtcd->subpix.bilinear_avg4x4 = vp8_bilinear_predict_avg4x4_c; + rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_c; + rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_c; + rtcd->subpix.sixtap_avg16x16 = vp8_sixtap_predict_avg16x16_c; + rtcd->subpix.sixtap_avg8x8 = vp8_sixtap_predict_avg8x8_c; + rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_c; + rtcd->subpix.sixtap4x4 = vp8_sixtap_predict_c; + rtcd->subpix.sixtap_avg4x4 = vp8_sixtap_predict_avg_c; + rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_c; + rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_c; + rtcd->subpix.bilinear_avg16x16 = vp8_bilinear_predict_avg16x16_c; + rtcd->subpix.bilinear_avg8x8 = vp8_bilinear_predict_avg8x8_c; + rtcd->subpix.bilinear8x4 = vp8_bilinear_predict8x4_c; + rtcd->subpix.bilinear4x4 = vp8_bilinear_predict4x4_c; + rtcd->subpix.bilinear_avg4x4 = vp8_bilinear_predict_avg4x4_c; - rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_c; - rtcd->loopfilter.normal_b_v = vp8_loop_filter_bv_c; - rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_c; - rtcd->loopfilter.normal_b_h = vp8_loop_filter_bh_c; - rtcd->loopfilter.simple_mb_v = vp8_loop_filter_simple_vertical_edge_c; - rtcd->loopfilter.simple_b_v = vp8_loop_filter_bvs_c; - rtcd->loopfilter.simple_mb_h = vp8_loop_filter_simple_horizontal_edge_c; - rtcd->loopfilter.simple_b_h = vp8_loop_filter_bhs_c; + rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_c; + rtcd->loopfilter.normal_b_v = vp8_loop_filter_bv_c; + rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_c; + rtcd->loopfilter.normal_b_h = vp8_loop_filter_bh_c; + rtcd->loopfilter.simple_mb_v = vp8_loop_filter_simple_vertical_edge_c; + rtcd->loopfilter.simple_b_v = vp8_loop_filter_bvs_c; + rtcd->loopfilter.simple_mb_h = vp8_loop_filter_simple_horizontal_edge_c; + rtcd->loopfilter.simple_b_h = vp8_loop_filter_bhs_c; #if CONFIG_POSTPROC || (CONFIG_VP8_ENCODER && CONFIG_INTERNAL_STATS) - rtcd->postproc.down = vp8_mbpost_proc_down_c; - rtcd->postproc.across = vp8_mbpost_proc_across_ip_c; - rtcd->postproc.downacross = vp8_post_proc_down_and_across_c; - rtcd->postproc.addnoise = vp8_plane_add_noise_c; - rtcd->postproc.blend_mb_inner = vp8_blend_mb_inner_c; - rtcd->postproc.blend_mb_outer = vp8_blend_mb_outer_c; - rtcd->postproc.blend_b = vp8_blend_b_c; + rtcd->postproc.down = vp8_mbpost_proc_down_c; + rtcd->postproc.across = vp8_mbpost_proc_across_ip_c; + rtcd->postproc.downacross = vp8_post_proc_down_and_across_c; + rtcd->postproc.addnoise = vp8_plane_add_noise_c; + rtcd->postproc.blend_mb_inner = vp8_blend_mb_inner_c; + rtcd->postproc.blend_mb_outer = vp8_blend_mb_outer_c; + rtcd->postproc.blend_b = vp8_blend_b_c; #endif #endif #if ARCH_X86 || ARCH_X86_64 - vp8_arch_x86_common_init(ctx); + vp8_arch_x86_common_init(ctx); #endif #if ARCH_ARM - vp8_arch_arm_common_init(ctx); + vp8_arch_arm_common_init(ctx); #endif } diff --git a/vp8/common/header.h b/vp8/common/header.h index 3e98eeb3c..6fe0ca4e0 100644 --- a/vp8/common/header.h +++ b/vp8/common/header.h @@ -13,22 +13,21 @@ #define __INC_HEADER_H /* 24 bits total */ -typedef struct -{ - unsigned int type: 1; - unsigned int version: 3; - unsigned int show_frame: 1; +typedef struct { + unsigned int type: 1; + unsigned int version: 3; + unsigned int show_frame: 1; - /* Allow 2^20 bytes = 8 megabits for first partition */ + /* Allow 2^20 bytes = 8 megabits for first partition */ - unsigned int first_partition_length_in_bytes: 19; + unsigned int first_partition_length_in_bytes: 19; #ifdef PACKET_TESTING - unsigned int frame_number; - unsigned int update_gold: 1; - unsigned int uses_gold: 1; - unsigned int update_last: 1; - unsigned int uses_last: 1; + unsigned int frame_number; + unsigned int update_gold: 1; + unsigned int uses_gold: 1; + unsigned int update_last: 1; + unsigned int uses_last: 1; #endif } VP8_HEADER; diff --git a/vp8/common/idct.h b/vp8/common/idct.h index bafa662e6..433f57745 100644 --- a/vp8/common/idct.h +++ b/vp8/common/idct.h @@ -13,15 +13,15 @@ #define __INC_IDCT_H #define prototype_second_order(sym) \ - void sym(short *input, short *output) + void sym(short *input, short *output) #define prototype_idct(sym) \ - void sym(short *input, short *output, int pitch) + void sym(short *input, short *output, int pitch) #define prototype_idct_scalar_add(sym) \ - void sym(short input, \ - unsigned char *pred, unsigned char *output, \ - int pitch, int stride) + void sym(short input, \ + unsigned char *pred, unsigned char *output, \ + int pitch, int stride) #if ARCH_X86 || ARCH_X86_64 #include "x86/idct_x86.h" @@ -101,20 +101,19 @@ typedef prototype_idct((*vp8_idct_fn_t)); typedef prototype_idct_scalar_add((*vp8_idct_scalar_add_fn_t)); typedef prototype_second_order((*vp8_second_order_fn_t)); -typedef struct -{ - vp8_idct_fn_t idct1; - vp8_idct_fn_t idct16; - vp8_idct_scalar_add_fn_t idct1_scalar_add; +typedef struct { + vp8_idct_fn_t idct1; + vp8_idct_fn_t idct16; + vp8_idct_scalar_add_fn_t idct1_scalar_add; - vp8_second_order_fn_t iwalsh1; - vp8_second_order_fn_t iwalsh16; + vp8_second_order_fn_t iwalsh1; + vp8_second_order_fn_t iwalsh16; - vp8_idct_fn_t idct8; - vp8_idct_fn_t idct8_1; - vp8_idct_scalar_add_fn_t idct1_scalar_add_8x8; - vp8_idct_fn_t ihaar2; - vp8_idct_fn_t ihaar2_1; + vp8_idct_fn_t idct8; + vp8_idct_fn_t idct8_1; + vp8_idct_scalar_add_fn_t idct1_scalar_add_8x8; + vp8_idct_fn_t ihaar2; + vp8_idct_fn_t ihaar2_1; } vp8_idct_rtcd_vtable_t; #if CONFIG_RUNTIME_CPU_DETECT diff --git a/vp8/common/idctllm.c b/vp8/common/idctllm.c index acb856d53..684868cb2 100644 --- a/vp8/common/idctllm.c +++ b/vp8/common/idctllm.c @@ -32,360 +32,330 @@ static const int cospi8sqrt2minus1 = 20091; static const int sinpi8sqrt2 = 35468; static const int rounding = 0; -void vp8_short_idct4x4llm_c(short *input, short *output, int pitch) -{ - int i; - int a1, b1, c1, d1; +void vp8_short_idct4x4llm_c(short *input, short *output, int pitch) { + int i; + int a1, b1, c1, d1; - short *ip = input; - short *op = output; - int temp1, temp2; - int shortpitch = pitch >> 1; + short *ip = input; + short *op = output; + int temp1, temp2; + int shortpitch = pitch >> 1; - for (i = 0; i < 4; i++) - { - a1 = ip[0] + ip[8]; - b1 = ip[0] - ip[8]; + for (i = 0; i < 4; i++) { + a1 = ip[0] + ip[8]; + b1 = ip[0] - ip[8]; - temp1 = (ip[4] * sinpi8sqrt2 + rounding) >> 16; - temp2 = ip[12] + ((ip[12] * cospi8sqrt2minus1 + rounding) >> 16); - c1 = temp1 - temp2; + temp1 = (ip[4] * sinpi8sqrt2 + rounding) >> 16; + temp2 = ip[12] + ((ip[12] * cospi8sqrt2minus1 + rounding) >> 16); + c1 = temp1 - temp2; - temp1 = ip[4] + ((ip[4] * cospi8sqrt2minus1 + rounding) >> 16); - temp2 = (ip[12] * sinpi8sqrt2 + rounding) >> 16; - d1 = temp1 + temp2; + temp1 = ip[4] + ((ip[4] * cospi8sqrt2minus1 + rounding) >> 16); + temp2 = (ip[12] * sinpi8sqrt2 + rounding) >> 16; + d1 = temp1 + temp2; - op[shortpitch*0] = a1 + d1; - op[shortpitch*3] = a1 - d1; + op[shortpitch * 0] = a1 + d1; + op[shortpitch * 3] = a1 - d1; - op[shortpitch*1] = b1 + c1; - op[shortpitch*2] = b1 - c1; + op[shortpitch * 1] = b1 + c1; + op[shortpitch * 2] = b1 - c1; - ip++; - op++; - } + ip++; + op++; + } - ip = output; - op = output; + ip = output; + op = output; - for (i = 0; i < 4; i++) - { - a1 = ip[0] + ip[2]; - b1 = ip[0] - ip[2]; + for (i = 0; i < 4; i++) { + a1 = ip[0] + ip[2]; + b1 = ip[0] - ip[2]; - temp1 = (ip[1] * sinpi8sqrt2 + rounding) >> 16; - temp2 = ip[3] + ((ip[3] * cospi8sqrt2minus1 + rounding) >> 16); - c1 = temp1 - temp2; + temp1 = (ip[1] * sinpi8sqrt2 + rounding) >> 16; + temp2 = ip[3] + ((ip[3] * cospi8sqrt2minus1 + rounding) >> 16); + c1 = temp1 - temp2; - temp1 = ip[1] + ((ip[1] * cospi8sqrt2minus1 + rounding) >> 16); - temp2 = (ip[3] * sinpi8sqrt2 + rounding) >> 16; - d1 = temp1 + temp2; + temp1 = ip[1] + ((ip[1] * cospi8sqrt2minus1 + rounding) >> 16); + temp2 = (ip[3] * sinpi8sqrt2 + rounding) >> 16; + d1 = temp1 + temp2; - op[0] = (a1 + d1 + 16) >> 5; - op[3] = (a1 - d1 + 16) >> 5; + op[0] = (a1 + d1 + 16) >> 5; + op[3] = (a1 - d1 + 16) >> 5; - op[1] = (b1 + c1 + 16) >> 5; - op[2] = (b1 - c1 + 16) >> 5; + op[1] = (b1 + c1 + 16) >> 5; + op[2] = (b1 - c1 + 16) >> 5; - ip += shortpitch; - op += shortpitch; - } + ip += shortpitch; + op += shortpitch; + } } -void vp8_short_idct4x4llm_1_c(short *input, short *output, int pitch) -{ - int i; - int a1; - short *op = output; - int shortpitch = pitch >> 1; - a1 = ((input[0] + 16) >> 5); - for (i = 0; i < 4; i++) - { - op[0] = a1; - op[1] = a1; - op[2] = a1; - op[3] = a1; - op += shortpitch; - } +void vp8_short_idct4x4llm_1_c(short *input, short *output, int pitch) { + int i; + int a1; + short *op = output; + int shortpitch = pitch >> 1; + a1 = ((input[0] + 16) >> 5); + for (i = 0; i < 4; i++) { + op[0] = a1; + op[1] = a1; + op[2] = a1; + op[3] = a1; + op += shortpitch; + } } -void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr, unsigned char *dst_ptr, int pitch, int stride) -{ - int a1 = ((input_dc + 16) >> 5); - int r, c; - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - int a = a1 + pred_ptr[c] ; +void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr, unsigned char *dst_ptr, int pitch, int stride) { + int a1 = ((input_dc + 16) >> 5); + int r, c; - if (a < 0) - a = 0; + for (r = 0; r < 4; r++) { + for (c = 0; c < 4; c++) { + int a = a1 + pred_ptr[c]; - if (a > 255) - a = 255; + if (a < 0) + a = 0; - dst_ptr[c] = (unsigned char) a ; - } + if (a > 255) + a = 255; - dst_ptr += stride; - pred_ptr += pitch; + dst_ptr[c] = (unsigned char) a; } -} + dst_ptr += stride; + pred_ptr += pitch; + } -void vp8_short_inv_walsh4x4_c(short *input, short *output) -{ - int i; - int a1, b1, c1, d1; - short *ip = input; - short *op = output; - - for (i = 0; i < 4; i++) - { - a1 = ((ip[0] + ip[3])); - b1 = ((ip[1] + ip[2])); - c1 = ((ip[1] - ip[2])); - d1 = ((ip[0] - ip[3])); - - op[0] = (a1 + b1 + 1)>>1; - op[1] = (c1 + d1)>>1; - op[2] = (a1 - b1)>>1; - op[3] = (d1 - c1)>>1; - - ip += 4; - op += 4; - } +} - ip = output; - op = output; - for (i = 0; i < 4; i++) - { - a1 = ip[0] + ip[12]; - b1 = ip[4] + ip[8]; - c1 = ip[4] - ip[8]; - d1 = ip[0] - ip[12]; - op[0] = (a1 + b1 + 1)>>1; - op[4] = (c1 + d1)>>1; - op[8] = (a1 - b1)>>1; - op[12]= (d1 - c1)>>1; - ip++; - op++; - } +void vp8_short_inv_walsh4x4_c(short *input, short *output) { + int i; + int a1, b1, c1, d1; + short *ip = input; + short *op = output; + + for (i = 0; i < 4; i++) { + a1 = ((ip[0] + ip[3])); + b1 = ((ip[1] + ip[2])); + c1 = ((ip[1] - ip[2])); + d1 = ((ip[0] - ip[3])); + + op[0] = (a1 + b1 + 1) >> 1; + op[1] = (c1 + d1) >> 1; + op[2] = (a1 - b1) >> 1; + op[3] = (d1 - c1) >> 1; + + ip += 4; + op += 4; + } + + ip = output; + op = output; + for (i = 0; i < 4; i++) { + a1 = ip[0] + ip[12]; + b1 = ip[4] + ip[8]; + c1 = ip[4] - ip[8]; + d1 = ip[0] - ip[12]; + op[0] = (a1 + b1 + 1) >> 1; + op[4] = (c1 + d1) >> 1; + op[8] = (a1 - b1) >> 1; + op[12] = (d1 - c1) >> 1; + ip++; + op++; + } } -void vp8_short_inv_walsh4x4_1_c(short *in, short *out) -{ - int i; - short tmp[4]; - short *ip = in; - short *op = tmp; - - op[0] =(ip[0]+ 1)>>1; - op[1] = op[2] = op[3] = (ip[0]>>1); - - ip = tmp; - op = out; - for(i = 0; i<4; i++) - { - op[0] =(ip[0]+ 1)>>1; - op[4] = op[8] = op[12] = (ip[0]>>1); - ip ++; - op ++; - } +void vp8_short_inv_walsh4x4_1_c(short *in, short *out) { + int i; + short tmp[4]; + short *ip = in; + short *op = tmp; + + op[0] = (ip[0] + 1) >> 1; + op[1] = op[2] = op[3] = (ip[0] >> 1); + + ip = tmp; + op = out; + for (i = 0; i < 4; i++) { + op[0] = (ip[0] + 1) >> 1; + op[4] = op[8] = op[12] = (ip[0] >> 1); + ip++; + op++; + } } #if CONFIG_LOSSLESS -void vp8_short_inv_walsh4x4_lossless_c(short *input, short *output) -{ - int i; - int a1, b1, c1, d1; - short *ip = input; - short *op = output; - - for (i = 0; i < 4; i++) - { - a1 = ((ip[0] + ip[3]))>>Y2_WHT_UPSCALE_FACTOR; - b1 = ((ip[1] + ip[2]))>>Y2_WHT_UPSCALE_FACTOR; - c1 = ((ip[1] - ip[2]))>>Y2_WHT_UPSCALE_FACTOR; - d1 = ((ip[0] - ip[3]))>>Y2_WHT_UPSCALE_FACTOR; - - op[0] = (a1 + b1 + 1)>>1; - op[1] = (c1 + d1)>>1; - op[2] = (a1 - b1)>>1; - op[3] = (d1 - c1)>>1; - - ip += 4; - op += 4; - } - - ip = output; - op = output; - for (i = 0; i < 4; i++) - { - a1 = ip[0] + ip[12]; - b1 = ip[4] + ip[8]; - c1 = ip[4] - ip[8]; - d1 = ip[0] - ip[12]; - - - op[0] = ((a1 + b1 + 1)>>1)<<Y2_WHT_UPSCALE_FACTOR; - op[4] = ((c1 + d1)>>1)<<Y2_WHT_UPSCALE_FACTOR; - op[8] = ((a1 - b1)>>1)<<Y2_WHT_UPSCALE_FACTOR; - op[12]= ((d1 - c1)>>1)<<Y2_WHT_UPSCALE_FACTOR; - - ip++; - op++; - } +void vp8_short_inv_walsh4x4_lossless_c(short *input, short *output) { + int i; + int a1, b1, c1, d1; + short *ip = input; + short *op = output; + + for (i = 0; i < 4; i++) { + a1 = ((ip[0] + ip[3])) >> Y2_WHT_UPSCALE_FACTOR; + b1 = ((ip[1] + ip[2])) >> Y2_WHT_UPSCALE_FACTOR; + c1 = ((ip[1] - ip[2])) >> Y2_WHT_UPSCALE_FACTOR; + d1 = ((ip[0] - ip[3])) >> Y2_WHT_UPSCALE_FACTOR; + + op[0] = (a1 + b1 + 1) >> 1; + op[1] = (c1 + d1) >> 1; + op[2] = (a1 - b1) >> 1; + op[3] = (d1 - c1) >> 1; + + ip += 4; + op += 4; + } + + ip = output; + op = output; + for (i = 0; i < 4; i++) { + a1 = ip[0] + ip[12]; + b1 = ip[4] + ip[8]; + c1 = ip[4] - ip[8]; + d1 = ip[0] - ip[12]; + + + op[0] = ((a1 + b1 + 1) >> 1) << Y2_WHT_UPSCALE_FACTOR; + op[4] = ((c1 + d1) >> 1) << Y2_WHT_UPSCALE_FACTOR; + op[8] = ((a1 - b1) >> 1) << Y2_WHT_UPSCALE_FACTOR; + op[12] = ((d1 - c1) >> 1) << Y2_WHT_UPSCALE_FACTOR; + + ip++; + op++; + } } -void vp8_short_inv_walsh4x4_1_lossless_c(short *in, short *out) -{ - int i; - short tmp[4]; - short *ip = in; - short *op = tmp; - - op[0] =((ip[0]>>Y2_WHT_UPSCALE_FACTOR)+ 1)>>1; - op[1] = op[2] = op[3] = ((ip[0]>>Y2_WHT_UPSCALE_FACTOR)>>1); - - ip = tmp; - op = out; - for(i = 0; i<4; i++) - { - op[0] =((ip[0]+ 1)>>1)<<Y2_WHT_UPSCALE_FACTOR; - op[4] = op[8] = op[12] = ((ip[0]>>1))<<Y2_WHT_UPSCALE_FACTOR; - ip ++; - op ++; - } +void vp8_short_inv_walsh4x4_1_lossless_c(short *in, short *out) { + int i; + short tmp[4]; + short *ip = in; + short *op = tmp; + + op[0] = ((ip[0] >> Y2_WHT_UPSCALE_FACTOR) + 1) >> 1; + op[1] = op[2] = op[3] = ((ip[0] >> Y2_WHT_UPSCALE_FACTOR) >> 1); + + ip = tmp; + op = out; + for (i = 0; i < 4; i++) { + op[0] = ((ip[0] + 1) >> 1) << Y2_WHT_UPSCALE_FACTOR; + op[4] = op[8] = op[12] = ((ip[0] >> 1)) << Y2_WHT_UPSCALE_FACTOR; + ip++; + op++; + } } -void vp8_short_inv_walsh4x4_x8_c(short *input, short *output, int pitch) -{ - int i; - int a1, b1, c1, d1; - short *ip = input; - short *op = output; - int shortpitch = pitch >> 1; - - for (i = 0; i < 4; i++) - { - a1 = ((ip[0] + ip[3]))>>WHT_UPSCALE_FACTOR; - b1 = ((ip[1] + ip[2]))>>WHT_UPSCALE_FACTOR; - c1 = ((ip[1] - ip[2]))>>WHT_UPSCALE_FACTOR; - d1 = ((ip[0] - ip[3]))>>WHT_UPSCALE_FACTOR; - - op[0] = (a1 + b1 + 1)>>1; - op[1] = (c1 + d1)>>1; - op[2] = (a1 - b1)>>1; - op[3] = (d1 - c1)>>1; - - ip += 4; - op += shortpitch; - } +void vp8_short_inv_walsh4x4_x8_c(short *input, short *output, int pitch) { + int i; + int a1, b1, c1, d1; + short *ip = input; + short *op = output; + int shortpitch = pitch >> 1; + + for (i = 0; i < 4; i++) { + a1 = ((ip[0] + ip[3])) >> WHT_UPSCALE_FACTOR; + b1 = ((ip[1] + ip[2])) >> WHT_UPSCALE_FACTOR; + c1 = ((ip[1] - ip[2])) >> WHT_UPSCALE_FACTOR; + d1 = ((ip[0] - ip[3])) >> WHT_UPSCALE_FACTOR; + + op[0] = (a1 + b1 + 1) >> 1; + op[1] = (c1 + d1) >> 1; + op[2] = (a1 - b1) >> 1; + op[3] = (d1 - c1) >> 1; + + ip += 4; + op += shortpitch; + } + + ip = output; + op = output; + for (i = 0; i < 4; i++) { + a1 = ip[shortpitch * 0] + ip[shortpitch * 3]; + b1 = ip[shortpitch * 1] + ip[shortpitch * 2]; + c1 = ip[shortpitch * 1] - ip[shortpitch * 2]; + d1 = ip[shortpitch * 0] - ip[shortpitch * 3]; + + + op[shortpitch * 0] = (a1 + b1 + 1) >> 1; + op[shortpitch * 1] = (c1 + d1) >> 1; + op[shortpitch * 2] = (a1 - b1) >> 1; + op[shortpitch * 3] = (d1 - c1) >> 1; + + ip++; + op++; + } +} - ip = output; - op = output; - for (i = 0; i < 4; i++) - { - a1 = ip[shortpitch*0] + ip[shortpitch*3]; - b1 = ip[shortpitch*1] + ip[shortpitch*2]; - c1 = ip[shortpitch*1] - ip[shortpitch*2]; - d1 = ip[shortpitch*0] - ip[shortpitch*3]; +void vp8_short_inv_walsh4x4_1_x8_c(short *in, short *out, int pitch) { + int i; + short tmp[4]; + short *ip = in; + short *op = tmp; + int shortpitch = pitch >> 1; + + op[0] = ((ip[0] >> WHT_UPSCALE_FACTOR) + 1) >> 1; + op[1] = op[2] = op[3] = ((ip[0] >> WHT_UPSCALE_FACTOR) >> 1); + + + ip = tmp; + op = out; + for (i = 0; i < 4; i++) { + op[shortpitch * 0] = (ip[0] + 1) >> 1; + op[shortpitch * 1] = op[shortpitch * 2] = op[shortpitch * 3] = ip[0] >> 1; + ip++; + op++; + } +} +void vp8_dc_only_inv_walsh_add_c(short input_dc, unsigned char *pred_ptr, unsigned char *dst_ptr, int pitch, int stride) { + int r, c; + short tmp[16]; + vp8_short_inv_walsh4x4_1_x8_c(&input_dc, tmp, 4 << 1); - op[shortpitch*0] = (a1 + b1 + 1)>>1; - op[shortpitch*1] = (c1 + d1)>>1; - op[shortpitch*2] = (a1 - b1)>>1; - op[shortpitch*3] = (d1 - c1)>>1; + for (r = 0; r < 4; r++) { + for (c = 0; c < 4; c++) { + int a = tmp[r * 4 + c] + pred_ptr[c]; + if (a < 0) + a = 0; - ip++; - op++; - } -} + if (a > 255) + a = 255; -void vp8_short_inv_walsh4x4_1_x8_c(short *in, short *out, int pitch) -{ - int i; - short tmp[4]; - short *ip = in; - short *op = tmp; - int shortpitch = pitch >> 1; - - op[0] =((ip[0]>>WHT_UPSCALE_FACTOR) + 1)>>1; - op[1] = op[2] = op[3] = ((ip[0]>>WHT_UPSCALE_FACTOR)>>1); - - - ip = tmp; - op = out; - for(i = 0; i<4; i++) - { - op[shortpitch*0] =(ip[0]+ 1)>>1; - op[shortpitch*1] = op[shortpitch*2] = op[shortpitch*3] = ip[0]>>1; - ip ++; - op ++; + dst_ptr[c] = (unsigned char) a; } -} -void vp8_dc_only_inv_walsh_add_c(short input_dc, unsigned char *pred_ptr, unsigned char *dst_ptr, int pitch, int stride) -{ - int r, c; - short tmp[16]; - vp8_short_inv_walsh4x4_1_x8_c( &input_dc, tmp, 4<<1); - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - int a = tmp[r*4 + c] + pred_ptr[c] ; - if (a < 0) - a = 0; - - if (a > 255) - a = 255; - - dst_ptr[c] = (unsigned char) a ; - } - - dst_ptr += stride; - pred_ptr += pitch; - } + dst_ptr += stride; + pred_ptr += pitch; + } } #endif void vp8_dc_only_idct_add_8x8_c(short input_dc, unsigned char *pred_ptr, unsigned char *dst_ptr, - int pitch, int stride) -{ - int a1 = ((input_dc + 16) >> 5); - int r, c, b; - unsigned char *orig_pred = pred_ptr; - unsigned char *orig_dst = dst_ptr; - for (b = 0; b < 4; b++) - { - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - int a = a1 + pred_ptr[c] ; - - if (a < 0) - a = 0; - - if (a > 255) - a = 255; - - dst_ptr[c] = (unsigned char) a ; - } - - dst_ptr += stride; - pred_ptr += pitch; - } - dst_ptr = orig_dst + (b+1)%2*4 + (b+1)/2*4*stride; - pred_ptr = orig_pred + (b+1)%2*4 + (b+1)/2*4*pitch; + int pitch, int stride) { + int a1 = ((input_dc + 16) >> 5); + int r, c, b; + unsigned char *orig_pred = pred_ptr; + unsigned char *orig_dst = dst_ptr; + for (b = 0; b < 4; b++) { + for (r = 0; r < 4; r++) { + for (c = 0; c < 4; c++) { + int a = a1 + pred_ptr[c]; + + if (a < 0) + a = 0; + + if (a > 255) + a = 255; + + dst_ptr[c] = (unsigned char) a; + } + + dst_ptr += stride; + pred_ptr += pitch; } + dst_ptr = orig_dst + (b + 1) % 2 * 4 + (b + 1) / 2 * 4 * stride; + pred_ptr = orig_pred + (b + 1) % 2 * 4 + (b + 1) / 2 * 4 * pitch; + } } #define W1 2841 /* 2048*sqrt(2)*cos(1*pi/16) */ @@ -402,55 +372,53 @@ void vp8_dc_only_idct_add_8x8_c(short input_dc, * * where: c[0] = 128 c[1..7] = 128*sqrt(2) */ -static void idctrow (int *blk) -{ - int x0, x1, x2, x3, x4, x5, x6, x7, x8; - /* shortcut */ - if (!((x1 = blk[4] << 11) | (x2 = blk[6]) | (x3 = blk[2]) | - (x4 = blk[1]) | (x5 = blk[7]) | (x6 = blk[5]) | (x7 = blk[3]))) - { - blk[0] = blk[1] = blk[2] = blk[3] = blk[4] - = blk[5] = blk[6] = blk[7] = blk[0] << 3; - return; - } - - x0 = (blk[0] << 11) + 128; /* for proper rounding in the fourth stage */ - /* first stage */ - x8 = W7 * (x4 + x5); - x4 = x8 + (W1 - W7) * x4; - x5 = x8 - (W1 + W7) * x5; - x8 = W3 * (x6 + x7); - x6 = x8 - (W3 - W5) * x6; - x7 = x8 - (W3 + W5) * x7; - - /* second stage */ - x8 = x0 + x1; - x0 -= x1; - x1 = W6 * (x3 + x2); - x2 = x1 - (W2 + W6) * x2; - x3 = x1 + (W2 - W6) * x3; - x1 = x4 + x6; - x4 -= x6; - x6 = x5 + x7; - x5 -= x7; - - /* third stage */ - x7 = x8 + x3; - x8 -= x3; - x3 = x0 + x2; - x0 -= x2; - x2 = (181 * (x4 + x5) + 128) >> 8; - x4 = (181 * (x4 - x5) + 128) >> 8; - - /* fourth stage */ - blk[0] = (x7 + x1) >> 8; - blk[1] = (x3 + x2) >> 8; - blk[2] = (x0 + x4) >> 8; - blk[3] = (x8 + x6) >> 8; - blk[4] = (x8 - x6) >> 8; - blk[5] = (x0 - x4) >> 8; - blk[6] = (x3 - x2) >> 8; - blk[7] = (x7 - x1) >> 8; +static void idctrow(int *blk) { + int x0, x1, x2, x3, x4, x5, x6, x7, x8; + /* shortcut */ + if (!((x1 = blk[4] << 11) | (x2 = blk[6]) | (x3 = blk[2]) | + (x4 = blk[1]) | (x5 = blk[7]) | (x6 = blk[5]) | (x7 = blk[3]))) { + blk[0] = blk[1] = blk[2] = blk[3] = blk[4] + = blk[5] = blk[6] = blk[7] = blk[0] << 3; + return; + } + + x0 = (blk[0] << 11) + 128; /* for proper rounding in the fourth stage */ + /* first stage */ + x8 = W7 * (x4 + x5); + x4 = x8 + (W1 - W7) * x4; + x5 = x8 - (W1 + W7) * x5; + x8 = W3 * (x6 + x7); + x6 = x8 - (W3 - W5) * x6; + x7 = x8 - (W3 + W5) * x7; + + /* second stage */ + x8 = x0 + x1; + x0 -= x1; + x1 = W6 * (x3 + x2); + x2 = x1 - (W2 + W6) * x2; + x3 = x1 + (W2 - W6) * x3; + x1 = x4 + x6; + x4 -= x6; + x6 = x5 + x7; + x5 -= x7; + + /* third stage */ + x7 = x8 + x3; + x8 -= x3; + x3 = x0 + x2; + x0 -= x2; + x2 = (181 * (x4 + x5) + 128) >> 8; + x4 = (181 * (x4 - x5) + 128) >> 8; + + /* fourth stage */ + blk[0] = (x7 + x1) >> 8; + blk[1] = (x3 + x2) >> 8; + blk[2] = (x0 + x4) >> 8; + blk[3] = (x8 + x6) >> 8; + blk[4] = (x8 - x6) >> 8; + blk[5] = (x0 - x4) >> 8; + blk[6] = (x3 - x2) >> 8; + blk[7] = (x7 - x1) >> 8; } /* column (vertical) IDCT @@ -459,105 +427,96 @@ static void idctrow (int *blk) * cos( -- * ( k + - ) * l ) l=0 8 2 * * where: c[0] = 1/1024 c[1..7] = (1/1024)*sqrt(2) */ -static void idctcol (int *blk) -{ - int x0, x1, x2, x3, x4, x5, x6, x7, x8; +static void idctcol(int *blk) { + int x0, x1, x2, x3, x4, x5, x6, x7, x8; - /* shortcut */ - if (!((x1 = (blk[8 * 4] << 8)) | (x2 = blk[8 * 6]) | (x3 = blk[8 * 2]) | + /* shortcut */ + if (!((x1 = (blk[8 * 4] << 8)) | (x2 = blk[8 * 6]) | (x3 = blk[8 * 2]) | (x4 = blk[8 * 1]) | (x5 = blk[8 * 7]) | (x6 = blk[8 * 5]) | - (x7 = blk[8 * 3]))) - { - blk[8 * 0] = blk[8 * 1] = blk[8 * 2] = blk[8 * 3] - = blk[8 * 4] = blk[8 * 5] = blk[8 * 6] - = blk[8 * 7] = ((blk[8 * 0] + 32) >>6); - return; - } - - x0 = (blk[8 * 0] << 8) + 16384; - - /* first stage */ - x8 = W7 * (x4 + x5) + 4; - x4 = (x8 + (W1 - W7) * x4) >> 3; - x5 = (x8 - (W1 + W7) * x5) >> 3; - x8 = W3 * (x6 + x7) + 4; - x6 = (x8 - (W3 - W5) * x6) >> 3; - x7 = (x8 - (W3 + W5) * x7) >> 3; - - /* second stage */ - x8 = x0 + x1; - x0 -= x1; - x1 = W6 * (x3 + x2) + 4; - x2 = (x1 - (W2 + W6) * x2) >> 3; - x3 = (x1 + (W2 - W6) * x3) >> 3; - x1 = x4 + x6; - x4 -= x6; - x6 = x5 + x7; - x5 -= x7; - - /* third stage */ - x7 = x8 + x3; - x8 -= x3; - x3 = x0 + x2; - x0 -= x2; - x2 = (181 * (x4 + x5) + 128) >> 8; - x4 = (181 * (x4 - x5) + 128) >> 8; - - /* fourth stage */ - blk[8 * 0] = (x7 + x1 ) >> 14; - blk[8 * 1] = (x3 + x2 ) >> 14; - blk[8 * 2] = (x0 + x4 ) >> 14; - blk[8 * 3] = (x8 + x6 ) >> 14; - blk[8 * 4] = (x8 - x6 ) >> 14; - blk[8 * 5] = (x0 - x4 ) >> 14; - blk[8 * 6] = (x3 - x2 ) >> 14; - blk[8 * 7] = (x7 - x1 ) >> 14; + (x7 = blk[8 * 3]))) { + blk[8 * 0] = blk[8 * 1] = blk[8 * 2] = blk[8 * 3] + = blk[8 * 4] = blk[8 * 5] = blk[8 * 6] + = blk[8 * 7] = ((blk[8 * 0] + 32) >> 6); + return; + } + + x0 = (blk[8 * 0] << 8) + 16384; + + /* first stage */ + x8 = W7 * (x4 + x5) + 4; + x4 = (x8 + (W1 - W7) * x4) >> 3; + x5 = (x8 - (W1 + W7) * x5) >> 3; + x8 = W3 * (x6 + x7) + 4; + x6 = (x8 - (W3 - W5) * x6) >> 3; + x7 = (x8 - (W3 + W5) * x7) >> 3; + + /* second stage */ + x8 = x0 + x1; + x0 -= x1; + x1 = W6 * (x3 + x2) + 4; + x2 = (x1 - (W2 + W6) * x2) >> 3; + x3 = (x1 + (W2 - W6) * x3) >> 3; + x1 = x4 + x6; + x4 -= x6; + x6 = x5 + x7; + x5 -= x7; + + /* third stage */ + x7 = x8 + x3; + x8 -= x3; + x3 = x0 + x2; + x0 -= x2; + x2 = (181 * (x4 + x5) + 128) >> 8; + x4 = (181 * (x4 - x5) + 128) >> 8; + + /* fourth stage */ + blk[8 * 0] = (x7 + x1) >> 14; + blk[8 * 1] = (x3 + x2) >> 14; + blk[8 * 2] = (x0 + x4) >> 14; + blk[8 * 3] = (x8 + x6) >> 14; + blk[8 * 4] = (x8 - x6) >> 14; + blk[8 * 5] = (x0 - x4) >> 14; + blk[8 * 6] = (x3 - x2) >> 14; + blk[8 * 7] = (x7 - x1) >> 14; } #define TX_DIM 8 -void vp8_short_idct8x8_c(short *coefs, short *block, int pitch) -{ - int X[TX_DIM*TX_DIM]; - int i,j; - int shortpitch = pitch >> 1; - - for (i = 0; i < TX_DIM; i++) - { - for (j = 0; j < TX_DIM; j++) - { - X[i * TX_DIM + j] = (int)(coefs[i * TX_DIM + j]+1 - + (coefs[i * TX_DIM + j]<0))>>2; - } +void vp8_short_idct8x8_c(short *coefs, short *block, int pitch) { + int X[TX_DIM * TX_DIM]; + int i, j; + int shortpitch = pitch >> 1; + + for (i = 0; i < TX_DIM; i++) { + for (j = 0; j < TX_DIM; j++) { + X[i * TX_DIM + j] = (int)(coefs[i * TX_DIM + j] + 1 + + (coefs[i * TX_DIM + j] < 0)) >> 2; } - for (i = 0; i < 8; i++) - idctrow (X + 8 * i); - - for (i = 0; i < 8; i++) - idctcol (X + i); - - for (i = 0; i < TX_DIM; i++) - { - for (j = 0; j < TX_DIM; j++) - { - block[i*shortpitch+j] = X[i * TX_DIM + j]>>1; - } + } + for (i = 0; i < 8; i++) + idctrow(X + 8 * i); + + for (i = 0; i < 8; i++) + idctcol(X + i); + + for (i = 0; i < TX_DIM; i++) { + for (j = 0; j < TX_DIM; j++) { + block[i * shortpitch + j] = X[i * TX_DIM + j] >> 1; } + } } -void vp8_short_ihaar2x2_c(short *input, short *output, int pitch) -{ - int i; - short *ip = input; //0,1, 4, 8 - short *op = output; - for (i = 0; i < 16; i++) - { - op[i] = 0; - } - - op[0] = (ip[0] + ip[1] + ip[4] + ip[8] + 1)>>1; - op[1] = (ip[0] - ip[1] + ip[4] - ip[8])>>1; - op[4] = (ip[0] + ip[1] - ip[4] - ip[8])>>1; - op[8] = (ip[0] - ip[1] - ip[4] + ip[8])>>1; +void vp8_short_ihaar2x2_c(short *input, short *output, int pitch) { + int i; + short *ip = input; // 0,1, 4, 8 + short *op = output; + for (i = 0; i < 16; i++) { + op[i] = 0; + } + + op[0] = (ip[0] + ip[1] + ip[4] + ip[8] + 1) >> 1; + op[1] = (ip[0] - ip[1] + ip[4] - ip[8]) >> 1; + op[4] = (ip[0] + ip[1] - ip[4] - ip[8]) >> 1; + op[8] = (ip[0] - ip[1] - ip[4] + ip[8]) >> 1; } diff --git a/vp8/common/implicit_segmentation.c b/vp8/common/implicit_segmentation.c index 68bb31cca..24d4ec8b9 100644 --- a/vp8/common/implicit_segmentation.c +++ b/vp8/common/implicit_segmentation.c @@ -20,16 +20,15 @@ // this linked list structure holds equivalences for connected // component labeling struct list_el { - int label; - int seg_value; - int count; - struct list_el * next; + int label; + int seg_value; + int count; + struct list_el *next; }; typedef struct list_el item; // connected colorsegments -typedef struct -{ +typedef struct { int min_x; int min_y; int max_x; @@ -42,8 +41,7 @@ typedef struct } segment_info; -typedef enum -{ +typedef enum { SEGMENT_MODE, SEGMENT_MV, SEGMENT_REFFRAME, @@ -54,8 +52,7 @@ typedef enum // this merges the two equivalence lists and // then makes sure that every label points to the same // equivalence list -void merge ( item *labels, int u, int v ) -{ +void merge(item *labels, int u, int v) { item *a = labels[u].next; item *b = labels[v].next; item c; @@ -63,21 +60,17 @@ void merge ( item *labels, int u, int v ) int count; // check if they are already merged - if(u==v || a==b) + if (u == v || a == b) return; count = a->count + b->count; // merge 2 sorted linked lists. - while ( a != NULL && b != NULL ) - { - if ( a->label < b->label) - { + while (a != NULL && b != NULL) { + if (a->label < b->label) { it->next = a; a = a->next; - } - else - { + } else { it->next = b; b = b->next; } @@ -85,7 +78,7 @@ void merge ( item *labels, int u, int v ) it = it->next; } - if ( a == NULL ) + if (a == NULL) it->next = b; else it->next = a; @@ -93,187 +86,169 @@ void merge ( item *labels, int u, int v ) it = c.next; // make sure every equivalence in the linked list points to this new ll - while( it != NULL) - { + while (it != NULL) { labels[it->label].next = c.next; - it=it->next; + it = it->next; } c.next->count = count; } -void segment_via_mode_info( VP8_COMMON *oci, int how) -{ - MODE_INFO *mi = oci->mi; - int i,j; - int mb_index = 0; - - int label=1; - int pitch = oci->mb_cols; - - // holds linked list equivalences - // the max should probably be allocated at a higher level in oci - item equivalences[MAX_REGIONS]; - int eq_ptr = 0; - item labels[MAX_REGIONS]; - segment_info segments[MAX_REGIONS]; - int label_count = 1; - int labeling[400*300]; - int *lp = labeling; - - label_count = 1; - memset(labels,0,sizeof(labels)); - memset(segments,0,sizeof(segments)); - - /* Go through each macroblock first pass labelling */ - for (i = 0; i < oci->mb_rows; i++,lp+=pitch) - { - for (j = 0; j < oci->mb_cols; j++) - { - // int above seg_value, left seg_value, this seg_value... - int a=-1,l=-1,n=-1; - - // above label, left label - int al=-1,ll=-1; - if(i) - { - al=lp[j-pitch]; - a = labels[al].next->seg_value; - } - if(j) - { - ll=lp[j-1]; - l = labels[ll].next->seg_value; - } - - // what setting are we going to do the implicit segmentation on - switch (how) - { - case SEGMENT_MODE: - n= mi[mb_index].mbmi.mode; - break; - case SEGMENT_MV: - n = mi[mb_index].mbmi.mv.as_int; - if(mi[mb_index].mbmi.ref_frame == INTRA_FRAME) - n=-9999999; - break; - case SEGMENT_REFFRAME: - n = mi[mb_index].mbmi.ref_frame; - break; - case SEGMENT_SKIPPED: - n = mi[mb_index].mbmi.mb_skip_coeff; - break; - } - - // above and left both have the same seg_value - if(n==a&&n==l) - { - // pick the lowest label - lp[j] = (al<ll?al:ll); - labels[lp[j]].next->count++; - - // merge the above and left equivalencies - merge( labels, al, ll ); - } - // this matches above seg_value - else if(n==a) - { - // give it the same label as above - lp[j]=al; - labels[al].next->count++; - } - // this matches left seg_value - else if(n==l) - { - // give it the same label as above - lp[j]=ll; - labels[ll].next->count++; - } - else - { - // new label doesn't match either - item *e = &labels[label]; - item *nl = &equivalences[eq_ptr++]; - lp[j]=label; - nl->label = label; - nl->next = 0; - nl->seg_value = n; - nl->count = 1; - e->next = nl; - label++; - } - mb_index++; +void segment_via_mode_info(VP8_COMMON *oci, int how) { + MODE_INFO *mi = oci->mi; + int i, j; + int mb_index = 0; + + int label = 1; + int pitch = oci->mb_cols; + + // holds linked list equivalences + // the max should probably be allocated at a higher level in oci + item equivalences[MAX_REGIONS]; + int eq_ptr = 0; + item labels[MAX_REGIONS]; + segment_info segments[MAX_REGIONS]; + int label_count = 1; + int labeling[400 * 300]; + int *lp = labeling; + + label_count = 1; + memset(labels, 0, sizeof(labels)); + memset(segments, 0, sizeof(segments)); + + /* Go through each macroblock first pass labelling */ + for (i = 0; i < oci->mb_rows; i++, lp += pitch) { + for (j = 0; j < oci->mb_cols; j++) { + // int above seg_value, left seg_value, this seg_value... + int a = -1, l = -1, n = -1; + + // above label, left label + int al = -1, ll = -1; + if (i) { + al = lp[j - pitch]; + a = labels[al].next->seg_value; + } + if (j) { + ll = lp[j - 1]; + l = labels[ll].next->seg_value; } - mb_index++; - } - lp = labeling; - - // give new labels to regions - for(i=1;i<label;i++) - if(labels[i].next->count >min_mbs_in_region && labels[labels[i].next->label].label == 0 ) - { - segment_info *cs= &segments[label_count]; - cs->label = label_count; - labels[labels[i].next->label].label = label_count++; - labels[labels[i].next->label].seg_value = labels[i].next->seg_value; - cs->seg_value = labels[labels[i].next->label].seg_value; - cs->min_x = oci->mb_cols; - cs->min_y = oci->mb_rows; - cs->max_x = 0; - cs->max_y = 0; - cs->sum_x = 0; - cs->sum_y = 0; - cs->pixels= 0; + // what setting are we going to do the implicit segmentation on + switch (how) { + case SEGMENT_MODE: + n = mi[mb_index].mbmi.mode; + break; + case SEGMENT_MV: + n = mi[mb_index].mbmi.mv.as_int; + if (mi[mb_index].mbmi.ref_frame == INTRA_FRAME) + n = -9999999; + break; + case SEGMENT_REFFRAME: + n = mi[mb_index].mbmi.ref_frame; + break; + case SEGMENT_SKIPPED: + n = mi[mb_index].mbmi.mb_skip_coeff; + break; } - lp = labeling; - // this is just to gather stats... - for(i=0;i<oci->mb_rows;i++,lp+=pitch) - { - for(j=0;j<oci->mb_cols;j++) - { - segment_info *cs; - int oldlab = labels[lp[j]].next->label; - int lab = labels[oldlab].label; - lp[j] = lab; - - cs= &segments[lab]; - - cs->min_x = (j<cs->min_x?j:cs->min_x); - cs->max_x = (j>cs->max_x?j:cs->max_x); - cs->min_y = (i<cs->min_y?i:cs->min_y); - cs->max_y = (i>cs->max_y?i:cs->max_y); - cs->sum_x += j; - cs->sum_y += i; - cs->pixels ++; - - lp[j] = lab; - mb_index++; + // above and left both have the same seg_value + if (n == a && n == l) { + // pick the lowest label + lp[j] = (al < ll ? al : ll); + labels[lp[j]].next->count++; + + // merge the above and left equivalencies + merge(labels, al, ll); + } + // this matches above seg_value + else if (n == a) { + // give it the same label as above + lp[j] = al; + labels[al].next->count++; + } + // this matches left seg_value + else if (n == l) { + // give it the same label as above + lp[j] = ll; + labels[ll].next->count++; + } else { + // new label doesn't match either + item *e = &labels[label]; + item *nl = &equivalences[eq_ptr++]; + lp[j] = label; + nl->label = label; + nl->next = 0; + nl->seg_value = n; + nl->count = 1; + e->next = nl; + label++; } mb_index++; } + mb_index++; + } + lp = labeling; + + // give new labels to regions + for (i = 1; i < label; i++) + if (labels[i].next->count > min_mbs_in_region && labels[labels[i].next->label].label == 0) { + segment_info *cs = &segments[label_count]; + cs->label = label_count; + labels[labels[i].next->label].label = label_count++; + labels[labels[i].next->label].seg_value = labels[i].next->seg_value; + cs->seg_value = labels[labels[i].next->label].seg_value; + cs->min_x = oci->mb_cols; + cs->min_y = oci->mb_rows; + cs->max_x = 0; + cs->max_y = 0; + cs->sum_x = 0; + cs->sum_y = 0; + cs->pixels = 0; - { - lp = labeling; - printf("labelling \n"); - mb_index = 0; - for(i=0;i<oci->mb_rows;i++,lp+=pitch) - { - for(j=0;j<oci->mb_cols;j++) - { - printf("%4d",lp[j]); - } - printf(" "); - for(j=0;j<oci->mb_cols;j++,mb_index++) - { - //printf("%3d",mi[mb_index].mbmi.mode ); - printf("%4d:%4d",mi[mb_index].mbmi.mv.as_mv.row,mi[mb_index].mbmi.mv.as_mv.col ); - } - printf("\n"); - ++mb_index; + } + lp = labeling; + + // this is just to gather stats... + for (i = 0; i < oci->mb_rows; i++, lp += pitch) { + for (j = 0; j < oci->mb_cols; j++) { + segment_info *cs; + int oldlab = labels[lp[j]].next->label; + int lab = labels[oldlab].label; + lp[j] = lab; + + cs = &segments[lab]; + + cs->min_x = (j < cs->min_x ? j : cs->min_x); + cs->max_x = (j > cs->max_x ? j : cs->max_x); + cs->min_y = (i < cs->min_y ? i : cs->min_y); + cs->max_y = (i > cs->max_y ? i : cs->max_y); + cs->sum_x += j; + cs->sum_y += i; + cs->pixels++; + + lp[j] = lab; + mb_index++; + } + mb_index++; + } + + { + lp = labeling; + printf("labelling \n"); + mb_index = 0; + for (i = 0; i < oci->mb_rows; i++, lp += pitch) { + for (j = 0; j < oci->mb_cols; j++) { + printf("%4d", lp[j]); + } + printf(" "); + for (j = 0; j < oci->mb_cols; j++, mb_index++) { + // printf("%3d",mi[mb_index].mbmi.mode ); + printf("%4d:%4d", mi[mb_index].mbmi.mv.as_mv.row, mi[mb_index].mbmi.mv.as_mv.col); } printf("\n"); + ++mb_index; } + printf("\n"); + } } diff --git a/vp8/common/invtrans.c b/vp8/common/invtrans.c index eed8363a3..aea453648 100644 --- a/vp8/common/invtrans.c +++ b/vp8/common/invtrans.c @@ -13,161 +13,138 @@ -static void recon_dcblock(MACROBLOCKD *x) -{ - BLOCKD *b = &x->block[24]; - int i; +static void recon_dcblock(MACROBLOCKD *x) { + BLOCKD *b = &x->block[24]; + int i; - for (i = 0; i < 16; i++) - { - x->block[i].dqcoeff[0] = b->diff[i]; - } + for (i = 0; i < 16; i++) { + x->block[i].dqcoeff[0] = b->diff[i]; + } } -static void recon_dcblock_8x8(MACROBLOCKD *x) -{ - BLOCKD *b = &x->block[24]; //for coeff 0, 2, 8, 10 - x->block[0].dqcoeff[0] = b->diff[0]; - x->block[4].dqcoeff[0] = b->diff[1]; - x->block[8].dqcoeff[0] = b->diff[4]; - x->block[12].dqcoeff[0] = b->diff[8]; +static void recon_dcblock_8x8(MACROBLOCKD *x) { + BLOCKD *b = &x->block[24]; // for coeff 0, 2, 8, 10 + x->block[0].dqcoeff[0] = b->diff[0]; + x->block[4].dqcoeff[0] = b->diff[1]; + x->block[8].dqcoeff[0] = b->diff[4]; + x->block[12].dqcoeff[0] = b->diff[8]; } -void vp8_inverse_transform_b(const vp8_idct_rtcd_vtable_t *rtcd, BLOCKD *b, int pitch) -{ - if (b->eob <= 1) - IDCT_INVOKE(rtcd, idct1)(b->dqcoeff, b->diff, pitch); - else - IDCT_INVOKE(rtcd, idct16)(b->dqcoeff, b->diff, pitch); +void vp8_inverse_transform_b(const vp8_idct_rtcd_vtable_t *rtcd, BLOCKD *b, int pitch) { + if (b->eob <= 1) + IDCT_INVOKE(rtcd, idct1)(b->dqcoeff, b->diff, pitch); + else + IDCT_INVOKE(rtcd, idct16)(b->dqcoeff, b->diff, pitch); } -void vp8_inverse_transform_mby(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x) -{ - int i; +void vp8_inverse_transform_mby(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x) { + int i; - /* do 2nd order transform on the dc block */ - IDCT_INVOKE(rtcd, iwalsh16)(x->block[24].dqcoeff, x->block[24].diff); + /* do 2nd order transform on the dc block */ + IDCT_INVOKE(rtcd, iwalsh16)(x->block[24].dqcoeff, x->block[24].diff); - recon_dcblock(x); + recon_dcblock(x); - for (i = 0; i < 16; i++) - { - vp8_inverse_transform_b(rtcd, &x->block[i], 32); - } + for (i = 0; i < 16; i++) { + vp8_inverse_transform_b(rtcd, &x->block[i], 32); + } } -void vp8_inverse_transform_mbuv(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x) -{ - int i; +void vp8_inverse_transform_mbuv(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x) { + int i; - for (i = 16; i < 24; i++) - { - vp8_inverse_transform_b(rtcd, &x->block[i], 16); - } + for (i = 16; i < 24; i++) { + vp8_inverse_transform_b(rtcd, &x->block[i], 16); + } } -void vp8_inverse_transform_mb(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x) -{ - int i; +void vp8_inverse_transform_mb(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x) { + int i; - if (x->mode_info_context->mbmi.mode != B_PRED && - x->mode_info_context->mbmi.mode != I8X8_PRED && - x->mode_info_context->mbmi.mode != SPLITMV) - { - /* do 2nd order transform on the dc block */ + if (x->mode_info_context->mbmi.mode != B_PRED && + x->mode_info_context->mbmi.mode != I8X8_PRED && + x->mode_info_context->mbmi.mode != SPLITMV) { + /* do 2nd order transform on the dc block */ - IDCT_INVOKE(rtcd, iwalsh16)(&x->block[24].dqcoeff[0], x->block[24].diff); - recon_dcblock(x); - } + IDCT_INVOKE(rtcd, iwalsh16)(&x->block[24].dqcoeff[0], x->block[24].diff); + recon_dcblock(x); + } - for (i = 0; i < 16; i++) - { - vp8_inverse_transform_b(rtcd, &x->block[i], 32); - } + for (i = 0; i < 16; i++) { + vp8_inverse_transform_b(rtcd, &x->block[i], 32); + } - for (i = 16; i < 24; i++) - { - vp8_inverse_transform_b(rtcd, &x->block[i], 16); - } + for (i = 16; i < 24; i++) { + vp8_inverse_transform_b(rtcd, &x->block[i], 16); + } } -void vp8_inverse_transform_b_8x8(const vp8_idct_rtcd_vtable_t *rtcd, short *input_dqcoeff, short *output_coeff, int pitch)//pay attention to use when 8x8 -{ - // int b,i; - //if (b->eob > 1) - IDCT_INVOKE(rtcd, idct8)(input_dqcoeff, output_coeff, pitch); - //else - //IDCT_INVOKE(rtcd, idct8_1)(b->dqcoeff, b->diff, pitch);//pitch +void vp8_inverse_transform_b_8x8(const vp8_idct_rtcd_vtable_t *rtcd, short *input_dqcoeff, short *output_coeff, int pitch) { // pay attention to use when 8x8 + // int b,i; + // if (b->eob > 1) + IDCT_INVOKE(rtcd, idct8)(input_dqcoeff, output_coeff, pitch); + // else + // IDCT_INVOKE(rtcd, idct8_1)(b->dqcoeff, b->diff, pitch);//pitch } -void vp8_inverse_transform_mby_8x8(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x) -{ - int i; +void vp8_inverse_transform_mby_8x8(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x) { + int i; - // do 2nd order transform on the dc block - IDCT_INVOKE(rtcd, ihaar2)(x->block[24].dqcoeff, x->block[24].diff, 8); - - recon_dcblock_8x8(x); //need to change for 8x8 - for (i = 0; i < 9; i += 8) - { - vp8_inverse_transform_b_8x8(rtcd, &x->block[i].dqcoeff[0], &x->block[i].diff[0], 32); - } - for (i = 2; i < 11; i += 8) - { - vp8_inverse_transform_b_8x8(rtcd, &x->block[i+2].dqcoeff[0], &x->block[i].diff[0], 32); - } + // do 2nd order transform on the dc block + IDCT_INVOKE(rtcd, ihaar2)(x->block[24].dqcoeff, x->block[24].diff, 8); + + recon_dcblock_8x8(x); // need to change for 8x8 + for (i = 0; i < 9; i += 8) { + vp8_inverse_transform_b_8x8(rtcd, &x->block[i].dqcoeff[0], &x->block[i].diff[0], 32); + } + for (i = 2; i < 11; i += 8) { + vp8_inverse_transform_b_8x8(rtcd, &x->block[i + 2].dqcoeff[0], &x->block[i].diff[0], 32); + } } -void vp8_inverse_transform_mbuv_8x8(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x) -{ - int i; +void vp8_inverse_transform_mbuv_8x8(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x) { + int i; - for (i = 16; i < 24; i += 4) - { - vp8_inverse_transform_b_8x8(rtcd, &x->block[i].dqcoeff[0], &x->block[i].diff[0], 16); - } + for (i = 16; i < 24; i += 4) { + vp8_inverse_transform_b_8x8(rtcd, &x->block[i].dqcoeff[0], &x->block[i].diff[0], 16); + } } -void vp8_inverse_transform_mb_8x8(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x) -{ - int i; +void vp8_inverse_transform_mb_8x8(const vp8_idct_rtcd_vtable_t *rtcd, MACROBLOCKD *x) { + int i; - if (x->mode_info_context->mbmi.mode != B_PRED && - x->mode_info_context->mbmi.mode != SPLITMV) - { - // do 2nd order transform on the dc block + if (x->mode_info_context->mbmi.mode != B_PRED && + x->mode_info_context->mbmi.mode != SPLITMV) { + // do 2nd order transform on the dc block - IDCT_INVOKE(rtcd, ihaar2)(&x->block[24].dqcoeff[0], x->block[24].diff, 8);//dqcoeff[0] - recon_dcblock_8x8(x); //need to change for 8x8 + IDCT_INVOKE(rtcd, ihaar2)(&x->block[24].dqcoeff[0], x->block[24].diff, 8);// dqcoeff[0] + recon_dcblock_8x8(x); // need to change for 8x8 - } + } - for (i = 0; i < 9; i += 8) - { - vp8_inverse_transform_b_8x8(rtcd, &x->block[i].dqcoeff[0], &x->block[i].diff[0], 32); - } - for (i = 2; i < 11; i += 8) - { - vp8_inverse_transform_b_8x8(rtcd, &x->block[i+2].dqcoeff[0], &x->block[i].diff[0], 32); - } + for (i = 0; i < 9; i += 8) { + vp8_inverse_transform_b_8x8(rtcd, &x->block[i].dqcoeff[0], &x->block[i].diff[0], 32); + } + for (i = 2; i < 11; i += 8) { + vp8_inverse_transform_b_8x8(rtcd, &x->block[i + 2].dqcoeff[0], &x->block[i].diff[0], 32); + } - for (i = 16; i < 24; i += 4) - { - vp8_inverse_transform_b_8x8(rtcd, &x->block[i].dqcoeff[0], &x->block[i].diff[0], 16); - } + for (i = 16; i < 24; i += 4) { + vp8_inverse_transform_b_8x8(rtcd, &x->block[i].dqcoeff[0], &x->block[i].diff[0], 16); + } } diff --git a/vp8/common/loopfilter.c b/vp8/common/loopfilter.c index 6f57d49b4..70565ee68 100644 --- a/vp8/common/loopfilter.c +++ b/vp8/common/loopfilter.c @@ -31,776 +31,709 @@ prototype_simple_loopfilter(vp8_loop_filter_simple_vertical_edge_c); /* Horizontal MB filtering */ void vp8_loop_filter_mbh_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, int y_stride, int uv_stride, - loop_filter_info *lfi) -{ - vp8_mbloop_filter_horizontal_edge_c(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); + loop_filter_info *lfi) { + vp8_mbloop_filter_horizontal_edge_c(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); - if (u_ptr) - vp8_mbloop_filter_horizontal_edge_c(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); + if (u_ptr) + vp8_mbloop_filter_horizontal_edge_c(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - if (v_ptr) - vp8_mbloop_filter_horizontal_edge_c(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); + if (v_ptr) + vp8_mbloop_filter_horizontal_edge_c(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); } /* Vertical MB Filtering */ void vp8_loop_filter_mbv_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, int y_stride, int uv_stride, - loop_filter_info *lfi) -{ - vp8_mbloop_filter_vertical_edge_c(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); + loop_filter_info *lfi) { + vp8_mbloop_filter_vertical_edge_c(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); - if (u_ptr) - vp8_mbloop_filter_vertical_edge_c(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); + if (u_ptr) + vp8_mbloop_filter_vertical_edge_c(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - if (v_ptr) - vp8_mbloop_filter_vertical_edge_c(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); + if (v_ptr) + vp8_mbloop_filter_vertical_edge_c(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); } /* Horizontal B Filtering */ void vp8_loop_filter_bh_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, int y_stride, int uv_stride, - loop_filter_info *lfi) -{ - vp8_loop_filter_horizontal_edge_c(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_horizontal_edge_c(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_horizontal_edge_c(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + loop_filter_info *lfi) { + vp8_loop_filter_horizontal_edge_c(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + vp8_loop_filter_horizontal_edge_c(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + vp8_loop_filter_horizontal_edge_c(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - if (u_ptr) - vp8_loop_filter_horizontal_edge_c(u_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); + if (u_ptr) + vp8_loop_filter_horizontal_edge_c(u_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); - if (v_ptr) - vp8_loop_filter_horizontal_edge_c(v_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); + if (v_ptr) + vp8_loop_filter_horizontal_edge_c(v_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); } void vp8_loop_filter_bh8x8_c(unsigned char *y_ptr, unsigned char *u_ptr, - unsigned char *v_ptr, int y_stride, int uv_stride, - loop_filter_info *lfi) -{ - vp8_mbloop_filter_horizontal_edge_c( - y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + unsigned char *v_ptr, int y_stride, int uv_stride, + loop_filter_info *lfi) { + vp8_mbloop_filter_horizontal_edge_c( + y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); } void vp8_loop_filter_bhs_c(unsigned char *y_ptr, int y_stride, - const unsigned char *blimit) -{ - vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 4 * y_stride, y_stride, blimit); - vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 8 * y_stride, y_stride, blimit); - vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 12 * y_stride, y_stride, blimit); + const unsigned char *blimit) { + vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 4 * y_stride, y_stride, blimit); + vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 8 * y_stride, y_stride, blimit); + vp8_loop_filter_simple_horizontal_edge_c(y_ptr + 12 * y_stride, y_stride, blimit); } /* Vertical B Filtering */ void vp8_loop_filter_bv_c(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, int y_stride, int uv_stride, - loop_filter_info *lfi) -{ - vp8_loop_filter_vertical_edge_c(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_vertical_edge_c(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_vertical_edge_c(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + loop_filter_info *lfi) { + vp8_loop_filter_vertical_edge_c(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + vp8_loop_filter_vertical_edge_c(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + vp8_loop_filter_vertical_edge_c(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - if (u_ptr) - vp8_loop_filter_vertical_edge_c(u_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); + if (u_ptr) + vp8_loop_filter_vertical_edge_c(u_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); - if (v_ptr) - vp8_loop_filter_vertical_edge_c(v_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); + if (v_ptr) + vp8_loop_filter_vertical_edge_c(v_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); } void vp8_loop_filter_bv8x8_c(unsigned char *y_ptr, unsigned char *u_ptr, - unsigned char *v_ptr, int y_stride, int uv_stride, - loop_filter_info *lfi) -{ - vp8_mbloop_filter_vertical_edge_c( - y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + unsigned char *v_ptr, int y_stride, int uv_stride, + loop_filter_info *lfi) { + vp8_mbloop_filter_vertical_edge_c( + y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); } void vp8_loop_filter_bvs_c(unsigned char *y_ptr, int y_stride, - const unsigned char *blimit) -{ - vp8_loop_filter_simple_vertical_edge_c(y_ptr + 4, y_stride, blimit); - vp8_loop_filter_simple_vertical_edge_c(y_ptr + 8, y_stride, blimit); - vp8_loop_filter_simple_vertical_edge_c(y_ptr + 12, y_stride, blimit); + const unsigned char *blimit) { + vp8_loop_filter_simple_vertical_edge_c(y_ptr + 4, y_stride, blimit); + vp8_loop_filter_simple_vertical_edge_c(y_ptr + 8, y_stride, blimit); + vp8_loop_filter_simple_vertical_edge_c(y_ptr + 12, y_stride, blimit); } -static void lf_init_lut(loop_filter_info_n *lfi) -{ - int filt_lvl; - - for (filt_lvl = 0; filt_lvl <= MAX_LOOP_FILTER; filt_lvl++) - { - if (filt_lvl >= 40) - { - lfi->hev_thr_lut[KEY_FRAME][filt_lvl] = 2; - lfi->hev_thr_lut[INTER_FRAME][filt_lvl] = 3; - } - else if (filt_lvl >= 20) - { - lfi->hev_thr_lut[KEY_FRAME][filt_lvl] = 1; - lfi->hev_thr_lut[INTER_FRAME][filt_lvl] = 2; - } - else if (filt_lvl >= 15) - { - lfi->hev_thr_lut[KEY_FRAME][filt_lvl] = 1; - lfi->hev_thr_lut[INTER_FRAME][filt_lvl] = 1; - } - else - { - lfi->hev_thr_lut[KEY_FRAME][filt_lvl] = 0; - lfi->hev_thr_lut[INTER_FRAME][filt_lvl] = 0; - } +static void lf_init_lut(loop_filter_info_n *lfi) { + int filt_lvl; + + for (filt_lvl = 0; filt_lvl <= MAX_LOOP_FILTER; filt_lvl++) { + if (filt_lvl >= 40) { + lfi->hev_thr_lut[KEY_FRAME][filt_lvl] = 2; + lfi->hev_thr_lut[INTER_FRAME][filt_lvl] = 3; + } else if (filt_lvl >= 20) { + lfi->hev_thr_lut[KEY_FRAME][filt_lvl] = 1; + lfi->hev_thr_lut[INTER_FRAME][filt_lvl] = 2; + } else if (filt_lvl >= 15) { + lfi->hev_thr_lut[KEY_FRAME][filt_lvl] = 1; + lfi->hev_thr_lut[INTER_FRAME][filt_lvl] = 1; + } else { + lfi->hev_thr_lut[KEY_FRAME][filt_lvl] = 0; + lfi->hev_thr_lut[INTER_FRAME][filt_lvl] = 0; } + } - lfi->mode_lf_lut[DC_PRED] = 1; + lfi->mode_lf_lut[DC_PRED] = 1; #if CONFIG_NEWINTRAMODES - lfi->mode_lf_lut[D45_PRED] = 1; - lfi->mode_lf_lut[D135_PRED] = 1; - lfi->mode_lf_lut[D117_PRED] = 1; - lfi->mode_lf_lut[D153_PRED] = 1; - lfi->mode_lf_lut[D27_PRED] = 1; - lfi->mode_lf_lut[D63_PRED] = 1; + lfi->mode_lf_lut[D45_PRED] = 1; + lfi->mode_lf_lut[D135_PRED] = 1; + lfi->mode_lf_lut[D117_PRED] = 1; + lfi->mode_lf_lut[D153_PRED] = 1; + lfi->mode_lf_lut[D27_PRED] = 1; + lfi->mode_lf_lut[D63_PRED] = 1; #endif - lfi->mode_lf_lut[V_PRED] = 1; - lfi->mode_lf_lut[H_PRED] = 1; - lfi->mode_lf_lut[TM_PRED] = 1; - lfi->mode_lf_lut[B_PRED] = 0; - lfi->mode_lf_lut[I8X8_PRED]=0; - lfi->mode_lf_lut[ZEROMV] = 1; - lfi->mode_lf_lut[NEARESTMV] = 2; - lfi->mode_lf_lut[NEARMV] = 2; - lfi->mode_lf_lut[NEWMV] = 2; - lfi->mode_lf_lut[SPLITMV] = 3; + lfi->mode_lf_lut[V_PRED] = 1; + lfi->mode_lf_lut[H_PRED] = 1; + lfi->mode_lf_lut[TM_PRED] = 1; + lfi->mode_lf_lut[B_PRED] = 0; + lfi->mode_lf_lut[I8X8_PRED] = 0; + lfi->mode_lf_lut[ZEROMV] = 1; + lfi->mode_lf_lut[NEARESTMV] = 2; + lfi->mode_lf_lut[NEARMV] = 2; + lfi->mode_lf_lut[NEWMV] = 2; + lfi->mode_lf_lut[SPLITMV] = 3; } void vp8_loop_filter_update_sharpness(loop_filter_info_n *lfi, - int sharpness_lvl) -{ - int i; - - /* For each possible value for the loop filter fill out limits */ - for (i = 0; i <= MAX_LOOP_FILTER; i++) - { - int filt_lvl = i; - int block_inside_limit = 0; - - /* Set loop filter paramaeters that control sharpness. */ - block_inside_limit = filt_lvl >> (sharpness_lvl > 0); - block_inside_limit = block_inside_limit >> (sharpness_lvl > 4); - - if (sharpness_lvl > 0) - { - if (block_inside_limit > (9 - sharpness_lvl)) - block_inside_limit = (9 - sharpness_lvl); - } + int sharpness_lvl) { + int i; + + /* For each possible value for the loop filter fill out limits */ + for (i = 0; i <= MAX_LOOP_FILTER; i++) { + int filt_lvl = i; + int block_inside_limit = 0; - if (block_inside_limit < 1) - block_inside_limit = 1; + /* Set loop filter paramaeters that control sharpness. */ + block_inside_limit = filt_lvl >> (sharpness_lvl > 0); + block_inside_limit = block_inside_limit >> (sharpness_lvl > 4); - vpx_memset(lfi->lim[i], block_inside_limit, SIMD_WIDTH); - vpx_memset(lfi->blim[i], (2 * filt_lvl + block_inside_limit), - SIMD_WIDTH); - vpx_memset(lfi->mblim[i], (2 * (filt_lvl + 2) + block_inside_limit), - SIMD_WIDTH); + if (sharpness_lvl > 0) { + if (block_inside_limit > (9 - sharpness_lvl)) + block_inside_limit = (9 - sharpness_lvl); } + + if (block_inside_limit < 1) + block_inside_limit = 1; + + vpx_memset(lfi->lim[i], block_inside_limit, SIMD_WIDTH); + vpx_memset(lfi->blim[i], (2 * filt_lvl + block_inside_limit), + SIMD_WIDTH); + vpx_memset(lfi->mblim[i], (2 * (filt_lvl + 2) + block_inside_limit), + SIMD_WIDTH); + } } -void vp8_loop_filter_init(VP8_COMMON *cm) -{ - loop_filter_info_n *lfi = &cm->lf_info; - int i; +void vp8_loop_filter_init(VP8_COMMON *cm) { + loop_filter_info_n *lfi = &cm->lf_info; + int i; - /* init limits for given sharpness*/ - vp8_loop_filter_update_sharpness(lfi, cm->sharpness_level); - cm->last_sharpness_level = cm->sharpness_level; + /* init limits for given sharpness*/ + vp8_loop_filter_update_sharpness(lfi, cm->sharpness_level); + cm->last_sharpness_level = cm->sharpness_level; - /* init LUT for lvl and hev thr picking */ - lf_init_lut(lfi); + /* init LUT for lvl and hev thr picking */ + lf_init_lut(lfi); - /* init hev threshold const vectors */ - for(i = 0; i < 4 ; i++) - { - vpx_memset(lfi->hev_thr[i], i, SIMD_WIDTH); - } + /* init hev threshold const vectors */ + for (i = 0; i < 4; i++) { + vpx_memset(lfi->hev_thr[i], i, SIMD_WIDTH); + } } void vp8_loop_filter_frame_init(VP8_COMMON *cm, MACROBLOCKD *xd, - int default_filt_lvl) -{ - int seg, /* segment number */ - ref, /* index in ref_lf_deltas */ - mode; /* index in mode_lf_deltas */ - - loop_filter_info_n *lfi = &cm->lf_info; - - /* update limits if sharpness has changed */ - if(cm->last_sharpness_level != cm->sharpness_level) - { - vp8_loop_filter_update_sharpness(lfi, cm->sharpness_level); - cm->last_sharpness_level = cm->sharpness_level; - } + int default_filt_lvl) { + int seg, /* segment number */ + ref, /* index in ref_lf_deltas */ + mode; /* index in mode_lf_deltas */ - for(seg = 0; seg < MAX_MB_SEGMENTS; seg++) - { - int lvl_seg = default_filt_lvl; - int lvl_ref, lvl_mode; - - - // Set the baseline filter values for each segment - if ( segfeature_active( xd, seg, SEG_LVL_ALT_LF ) ) - { - /* Abs value */ - if (xd->mb_segment_abs_delta == SEGMENT_ABSDATA) - { - lvl_seg = get_segdata( xd, seg, SEG_LVL_ALT_LF ); - } - else /* Delta Value */ - { - lvl_seg += get_segdata( xd, seg, SEG_LVL_ALT_LF );; - lvl_seg = (lvl_seg > 0) ? ((lvl_seg > 63) ? 63: lvl_seg) : 0; - } - } + loop_filter_info_n *lfi = &cm->lf_info; - if (!xd->mode_ref_lf_delta_enabled) - { - /* we could get rid of this if we assume that deltas are set to - * zero when not in use; encoder always uses deltas - */ - vpx_memset(lfi->lvl[seg][0], lvl_seg, 4 * 4 ); - continue; - } + /* update limits if sharpness has changed */ + if (cm->last_sharpness_level != cm->sharpness_level) { + vp8_loop_filter_update_sharpness(lfi, cm->sharpness_level); + cm->last_sharpness_level = cm->sharpness_level; + } + + for (seg = 0; seg < MAX_MB_SEGMENTS; seg++) { + int lvl_seg = default_filt_lvl; + int lvl_ref, lvl_mode; + + + // Set the baseline filter values for each segment + if (segfeature_active(xd, seg, SEG_LVL_ALT_LF)) { + /* Abs value */ + if (xd->mb_segment_abs_delta == SEGMENT_ABSDATA) { + lvl_seg = get_segdata(xd, seg, SEG_LVL_ALT_LF); + } else { /* Delta Value */ + lvl_seg += get_segdata(xd, seg, SEG_LVL_ALT_LF);; + lvl_seg = (lvl_seg > 0) ? ((lvl_seg > 63) ? 63 : lvl_seg) : 0; + } + } - lvl_ref = lvl_seg; + if (!xd->mode_ref_lf_delta_enabled) { + /* we could get rid of this if we assume that deltas are set to + * zero when not in use; encoder always uses deltas + */ + vpx_memset(lfi->lvl[seg][0], lvl_seg, 4 * 4); + continue; + } - /* INTRA_FRAME */ - ref = INTRA_FRAME; + lvl_ref = lvl_seg; - /* Apply delta for reference frame */ - lvl_ref += xd->ref_lf_deltas[ref]; + /* INTRA_FRAME */ + ref = INTRA_FRAME; - /* Apply delta for Intra modes */ - mode = 0; /* B_PRED */ - /* Only the split mode BPRED has a further special case */ - lvl_mode = lvl_ref + xd->mode_lf_deltas[mode]; - lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0; /* clamp */ + /* Apply delta for reference frame */ + lvl_ref += xd->ref_lf_deltas[ref]; - lfi->lvl[seg][ref][mode] = lvl_mode; + /* Apply delta for Intra modes */ + mode = 0; /* B_PRED */ + /* Only the split mode BPRED has a further special case */ + lvl_mode = lvl_ref + xd->mode_lf_deltas[mode]; + lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0; /* clamp */ - mode = 1; /* all the rest of Intra modes */ - lvl_mode = (lvl_ref > 0) ? (lvl_ref > 63 ? 63 : lvl_ref) : 0; /* clamp */ - lfi->lvl[seg][ref][mode] = lvl_mode; + lfi->lvl[seg][ref][mode] = lvl_mode; - /* LAST, GOLDEN, ALT */ - for(ref = 1; ref < MAX_REF_FRAMES; ref++) - { - int lvl_ref = lvl_seg; + mode = 1; /* all the rest of Intra modes */ + lvl_mode = (lvl_ref > 0) ? (lvl_ref > 63 ? 63 : lvl_ref) : 0; /* clamp */ + lfi->lvl[seg][ref][mode] = lvl_mode; - /* Apply delta for reference frame */ - lvl_ref += xd->ref_lf_deltas[ref]; + /* LAST, GOLDEN, ALT */ + for (ref = 1; ref < MAX_REF_FRAMES; ref++) { + int lvl_ref = lvl_seg; - /* Apply delta for Inter modes */ - for (mode = 1; mode < 4; mode++) - { - lvl_mode = lvl_ref + xd->mode_lf_deltas[mode]; - lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0; /* clamp */ + /* Apply delta for reference frame */ + lvl_ref += xd->ref_lf_deltas[ref]; - lfi->lvl[seg][ref][mode] = lvl_mode; - } - } + /* Apply delta for Inter modes */ + for (mode = 1; mode < 4; mode++) { + lvl_mode = lvl_ref + xd->mode_lf_deltas[mode]; + lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0; /* clamp */ + + lfi->lvl[seg][ref][mode] = lvl_mode; + } } + } } void vp8_loop_filter_frame ( - VP8_COMMON *cm, - MACROBLOCKD *xd -) -{ - YV12_BUFFER_CONFIG *post = cm->frame_to_show; - loop_filter_info_n *lfi_n = &cm->lf_info; - loop_filter_info lfi; - - FRAME_TYPE frame_type = cm->frame_type; - - int mb_row; - int mb_col; - - int filter_level; - - unsigned char *y_ptr, *u_ptr, *v_ptr; - - /* Point at base of Mb MODE_INFO list */ - const MODE_INFO *mode_info_context = cm->mi; - - /* Initialize the loop filter for this frame. */ - vp8_loop_filter_frame_init(cm, xd, cm->filter_level); - - /* Set up the buffer pointers */ - y_ptr = post->y_buffer; - u_ptr = post->u_buffer; - v_ptr = post->v_buffer; - - /* vp8_filter each macro block */ - for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) - { - for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) - { - int skip_lf = (mode_info_context->mbmi.mode != B_PRED && - mode_info_context->mbmi.mode != I8X8_PRED && - mode_info_context->mbmi.mode != SPLITMV && - mode_info_context->mbmi.mb_skip_coeff); - - const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode]; - const int seg = mode_info_context->mbmi.segment_id; - const int ref_frame = mode_info_context->mbmi.ref_frame; - int tx_type = mode_info_context->mbmi.txfm_size; - filter_level = lfi_n->lvl[seg][ref_frame][mode_index]; - - if (filter_level) - { - if (cm->filter_type == NORMAL_LOOPFILTER) - { - const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level]; - lfi.mblim = lfi_n->mblim[filter_level]; - lfi.blim = lfi_n->blim[filter_level]; - lfi.lim = lfi_n->lim[filter_level]; - lfi.hev_thr = lfi_n->hev_thr[hev_index]; - - if (mb_col > 0) - vp8_loop_filter_mbv_c - (y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi); - - if (!skip_lf) - { - if(tx_type == TX_8X8) - vp8_loop_filter_bv8x8_c - (y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi); - else - LF_INVOKE(&cm->rtcd.loopfilter, normal_b_v) - (y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi); - - } - - /* don't apply across umv border */ - if (mb_row > 0) - vp8_loop_filter_mbh_c - (y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi); - - if (!skip_lf) - { - if(tx_type == TX_8X8) - vp8_loop_filter_bh8x8_c - (y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi); - else - LF_INVOKE(&cm->rtcd.loopfilter, normal_b_h) - (y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi); - } - } - else - { - if (mb_col > 0) - LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_v) - (y_ptr, post->y_stride, lfi_n->mblim[filter_level]); - - if (!skip_lf) - LF_INVOKE(&cm->rtcd.loopfilter, simple_b_v) - (y_ptr, post->y_stride, lfi_n->blim[filter_level]); - - /* don't apply across umv border */ - if (mb_row > 0) - LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_h) - (y_ptr, post->y_stride, lfi_n->mblim[filter_level]); - - if (!skip_lf) - LF_INVOKE(&cm->rtcd.loopfilter, simple_b_h) - (y_ptr, post->y_stride, lfi_n->blim[filter_level]); - } - } - - y_ptr += 16; - u_ptr += 8; - v_ptr += 8; - - mode_info_context++; /* step to next MB */ + VP8_COMMON *cm, + MACROBLOCKD *xd +) { + YV12_BUFFER_CONFIG *post = cm->frame_to_show; + loop_filter_info_n *lfi_n = &cm->lf_info; + loop_filter_info lfi; + + FRAME_TYPE frame_type = cm->frame_type; + + int mb_row; + int mb_col; + + int filter_level; + + unsigned char *y_ptr, *u_ptr, *v_ptr; + + /* Point at base of Mb MODE_INFO list */ + const MODE_INFO *mode_info_context = cm->mi; + + /* Initialize the loop filter for this frame. */ + vp8_loop_filter_frame_init(cm, xd, cm->filter_level); + + /* Set up the buffer pointers */ + y_ptr = post->y_buffer; + u_ptr = post->u_buffer; + v_ptr = post->v_buffer; + + /* vp8_filter each macro block */ + for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) { + for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) { + int skip_lf = (mode_info_context->mbmi.mode != B_PRED && + mode_info_context->mbmi.mode != I8X8_PRED && + mode_info_context->mbmi.mode != SPLITMV && + mode_info_context->mbmi.mb_skip_coeff); + + const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode]; + const int seg = mode_info_context->mbmi.segment_id; + const int ref_frame = mode_info_context->mbmi.ref_frame; + int tx_type = mode_info_context->mbmi.txfm_size; + filter_level = lfi_n->lvl[seg][ref_frame][mode_index]; + + if (filter_level) { + if (cm->filter_type == NORMAL_LOOPFILTER) { + const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level]; + lfi.mblim = lfi_n->mblim[filter_level]; + lfi.blim = lfi_n->blim[filter_level]; + lfi.lim = lfi_n->lim[filter_level]; + lfi.hev_thr = lfi_n->hev_thr[hev_index]; + + if (mb_col > 0) + vp8_loop_filter_mbv_c + (y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi); + + if (!skip_lf) { + if (tx_type == TX_8X8) + vp8_loop_filter_bv8x8_c + (y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi); + else + LF_INVOKE(&cm->rtcd.loopfilter, normal_b_v) + (y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi); + + } + + /* don't apply across umv border */ + if (mb_row > 0) + vp8_loop_filter_mbh_c + (y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi); + + if (!skip_lf) { + if (tx_type == TX_8X8) + vp8_loop_filter_bh8x8_c + (y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi); + else + LF_INVOKE(&cm->rtcd.loopfilter, normal_b_h) + (y_ptr, u_ptr, v_ptr, post->y_stride, post->uv_stride, &lfi); + } + } else { + if (mb_col > 0) + LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_v) + (y_ptr, post->y_stride, lfi_n->mblim[filter_level]); + + if (!skip_lf) + LF_INVOKE(&cm->rtcd.loopfilter, simple_b_v) + (y_ptr, post->y_stride, lfi_n->blim[filter_level]); + + /* don't apply across umv border */ + if (mb_row > 0) + LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_h) + (y_ptr, post->y_stride, lfi_n->mblim[filter_level]); + + if (!skip_lf) + LF_INVOKE(&cm->rtcd.loopfilter, simple_b_h) + (y_ptr, post->y_stride, lfi_n->blim[filter_level]); } + } - y_ptr += post->y_stride * 16 - post->y_width; - u_ptr += post->uv_stride * 8 - post->uv_width; - v_ptr += post->uv_stride * 8 - post->uv_width; + y_ptr += 16; + u_ptr += 8; + v_ptr += 8; - mode_info_context++; /* Skip border mb */ + mode_info_context++; /* step to next MB */ } + + y_ptr += post->y_stride * 16 - post->y_width; + u_ptr += post->uv_stride * 8 - post->uv_width; + v_ptr += post->uv_stride * 8 - post->uv_width; + + mode_info_context++; /* Skip border mb */ + } } void vp8_loop_filter_frame_yonly ( - VP8_COMMON *cm, - MACROBLOCKD *xd, - int default_filt_lvl -) -{ - YV12_BUFFER_CONFIG *post = cm->frame_to_show; + VP8_COMMON *cm, + MACROBLOCKD *xd, + int default_filt_lvl +) { + YV12_BUFFER_CONFIG *post = cm->frame_to_show; - unsigned char *y_ptr; - int mb_row; - int mb_col; + unsigned char *y_ptr; + int mb_row; + int mb_col; - loop_filter_info_n *lfi_n = &cm->lf_info; - loop_filter_info lfi; + loop_filter_info_n *lfi_n = &cm->lf_info; + loop_filter_info lfi; - int filter_level; - FRAME_TYPE frame_type = cm->frame_type; + int filter_level; + FRAME_TYPE frame_type = cm->frame_type; - /* Point at base of Mb MODE_INFO list */ - const MODE_INFO *mode_info_context = cm->mi; + /* Point at base of Mb MODE_INFO list */ + const MODE_INFO *mode_info_context = cm->mi; #if 0 - if(default_filt_lvl == 0) /* no filter applied */ - return; + if (default_filt_lvl == 0) /* no filter applied */ + return; #endif - /* Initialize the loop filter for this frame. */ - vp8_loop_filter_frame_init( cm, xd, default_filt_lvl); - - /* Set up the buffer pointers */ - y_ptr = post->y_buffer; - - /* vp8_filter each macro block */ - for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) - { - for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) - { - int skip_lf = (mode_info_context->mbmi.mode != B_PRED && - mode_info_context->mbmi.mode != I8X8_PRED && - mode_info_context->mbmi.mode != SPLITMV && - mode_info_context->mbmi.mb_skip_coeff); - - const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode]; - const int seg = mode_info_context->mbmi.segment_id; - const int ref_frame = mode_info_context->mbmi.ref_frame; - int tx_type = mode_info_context->mbmi.txfm_size; - - filter_level = lfi_n->lvl[seg][ref_frame][mode_index]; - - if (filter_level) - { - if (cm->filter_type == NORMAL_LOOPFILTER) - { - const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level]; - lfi.mblim = lfi_n->mblim[filter_level]; - lfi.blim = lfi_n->blim[filter_level]; - lfi.lim = lfi_n->lim[filter_level]; - lfi.hev_thr = lfi_n->hev_thr[hev_index]; - - if (mb_col > 0) - vp8_loop_filter_mbv_c - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - - if (!skip_lf) - { - if(tx_type == TX_8X8) - vp8_loop_filter_bv8x8_c - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - else - LF_INVOKE(&cm->rtcd.loopfilter, normal_b_v) - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - } - - /* don't apply across umv border */ - if (mb_row > 0) - vp8_loop_filter_mbh_c - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - - if (!skip_lf) - { - if(tx_type == TX_8X8) - vp8_loop_filter_bh8x8_c - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - else - LF_INVOKE(&cm->rtcd.loopfilter, normal_b_h) - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - } - } - else - { - if (mb_col > 0) - LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_v) - (y_ptr, post->y_stride, lfi_n->mblim[filter_level]); - - if (!skip_lf) - LF_INVOKE(&cm->rtcd.loopfilter, simple_b_v) - (y_ptr, post->y_stride, lfi_n->blim[filter_level]); - - /* don't apply across umv border */ - if (mb_row > 0) - LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_h) - (y_ptr, post->y_stride, lfi_n->mblim[filter_level]); - - if (!skip_lf) - LF_INVOKE(&cm->rtcd.loopfilter, simple_b_h) - (y_ptr, post->y_stride, lfi_n->blim[filter_level]); - } - } - - y_ptr += 16; - mode_info_context ++; /* step to next MB */ - + /* Initialize the loop filter for this frame. */ + vp8_loop_filter_frame_init(cm, xd, default_filt_lvl); + + /* Set up the buffer pointers */ + y_ptr = post->y_buffer; + + /* vp8_filter each macro block */ + for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) { + for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) { + int skip_lf = (mode_info_context->mbmi.mode != B_PRED && + mode_info_context->mbmi.mode != I8X8_PRED && + mode_info_context->mbmi.mode != SPLITMV && + mode_info_context->mbmi.mb_skip_coeff); + + const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi.mode]; + const int seg = mode_info_context->mbmi.segment_id; + const int ref_frame = mode_info_context->mbmi.ref_frame; + int tx_type = mode_info_context->mbmi.txfm_size; + + filter_level = lfi_n->lvl[seg][ref_frame][mode_index]; + + if (filter_level) { + if (cm->filter_type == NORMAL_LOOPFILTER) { + const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level]; + lfi.mblim = lfi_n->mblim[filter_level]; + lfi.blim = lfi_n->blim[filter_level]; + lfi.lim = lfi_n->lim[filter_level]; + lfi.hev_thr = lfi_n->hev_thr[hev_index]; + + if (mb_col > 0) + vp8_loop_filter_mbv_c + (y_ptr, 0, 0, post->y_stride, 0, &lfi); + + if (!skip_lf) { + if (tx_type == TX_8X8) + vp8_loop_filter_bv8x8_c + (y_ptr, 0, 0, post->y_stride, 0, &lfi); + else + LF_INVOKE(&cm->rtcd.loopfilter, normal_b_v) + (y_ptr, 0, 0, post->y_stride, 0, &lfi); + } + + /* don't apply across umv border */ + if (mb_row > 0) + vp8_loop_filter_mbh_c + (y_ptr, 0, 0, post->y_stride, 0, &lfi); + + if (!skip_lf) { + if (tx_type == TX_8X8) + vp8_loop_filter_bh8x8_c + (y_ptr, 0, 0, post->y_stride, 0, &lfi); + else + LF_INVOKE(&cm->rtcd.loopfilter, normal_b_h) + (y_ptr, 0, 0, post->y_stride, 0, &lfi); + } + } else { + if (mb_col > 0) + LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_v) + (y_ptr, post->y_stride, lfi_n->mblim[filter_level]); + + if (!skip_lf) + LF_INVOKE(&cm->rtcd.loopfilter, simple_b_v) + (y_ptr, post->y_stride, lfi_n->blim[filter_level]); + + /* don't apply across umv border */ + if (mb_row > 0) + LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_h) + (y_ptr, post->y_stride, lfi_n->mblim[filter_level]); + + if (!skip_lf) + LF_INVOKE(&cm->rtcd.loopfilter, simple_b_h) + (y_ptr, post->y_stride, lfi_n->blim[filter_level]); } + } + + y_ptr += 16; + mode_info_context++; /* step to next MB */ - y_ptr += post->y_stride * 16 - post->y_width; - mode_info_context ++; /* Skip border mb */ } + y_ptr += post->y_stride * 16 - post->y_width; + mode_info_context++; /* Skip border mb */ + } + } #if CONFIG_FEATUREUPDATES // TODO: Multiple copies of loop filtering code should be pruned and // cut down. This just adds yet another so that I can do an if // on segment. void vp8_loop_filter_frame_segment(VP8_COMMON *cm, MACROBLOCKD *xd, - int default_filt_lvl, int segment) -{ - YV12_BUFFER_CONFIG *post = cm->frame_to_show; + int default_filt_lvl, int segment) { + YV12_BUFFER_CONFIG *post = cm->frame_to_show; - unsigned char *y_ptr; - int mb_row; - int mb_col; + unsigned char *y_ptr; + int mb_row; + int mb_col; - loop_filter_info_n *lfi_n = &cm->lf_info; - loop_filter_info lfi; + loop_filter_info_n *lfi_n = &cm->lf_info; + loop_filter_info lfi; - int filter_level; - FRAME_TYPE frame_type = cm->frame_type; + int filter_level; + FRAME_TYPE frame_type = cm->frame_type; - /* Point at base of Mb MODE_INFO list */ - const MODE_INFO *mode_info_context = cm->mi; + /* Point at base of Mb MODE_INFO list */ + const MODE_INFO *mode_info_context = cm->mi; #if 0 - if(default_filt_lvl == 0) /* no filter applied */ + if (default_filt_lvl == 0) /* no filter applied */ return; #endif - /* Initialize the loop filter for this frame. */ - vp8_loop_filter_frame_init(cm, xd, default_filt_lvl); - - /* Set up the buffer pointers */ - y_ptr = post->y_buffer; - - /* vp8_filter each macro block */ - for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) - { - for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) - { - int skip_lf = (mode_info_context->mbmi.mode != B_PRED - && mode_info_context->mbmi.mode != I8X8_PRED - && mode_info_context->mbmi.mode != SPLITMV - && mode_info_context->mbmi.mb_skip_coeff); - - const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi - .mode]; - const int seg = mode_info_context->mbmi.segment_id; - const int ref_frame = mode_info_context->mbmi.ref_frame; - - filter_level = lfi_n->lvl[seg][ref_frame][mode_index]; - - // check if this mb has filtering applied - // and then whether it is the right segment or - // if not whether the passed in segment is 0 and this - // segment has no alt lf - - // TODO: Make this work for when segment 0 has the alt lv enabled - if (filter_level - && (seg == segment - || (!segfeature_active(xd, seg, SEG_LVL_ALT_LF) - && segment == 0))) - { - if (cm->filter_type == NORMAL_LOOPFILTER) - { - const int hev_index = - lfi_n->hev_thr_lut[frame_type][filter_level]; - lfi.mblim = lfi_n->mblim[filter_level]; - lfi.blim = lfi_n->blim[filter_level]; - lfi.lim = lfi_n->lim[filter_level]; - lfi.hev_thr = lfi_n->hev_thr[hev_index]; - - if (mb_col > 0) - vp8_loop_filter_mbv_c(y_ptr, 0, 0, post->y_stride, 0, - &lfi); - - if (!skip_lf) - LF_INVOKE(&cm->rtcd.loopfilter, normal_b_v)( - y_ptr, 0, 0, post->y_stride, 0, &lfi); - - /* don't apply across umv border */ - if (mb_row > 0) - vp8_loop_filter_mbh_c(y_ptr, 0, 0, post->y_stride, 0, - &lfi); - - if (!skip_lf) - LF_INVOKE(&cm->rtcd.loopfilter, normal_b_h)( - y_ptr, 0, 0, post->y_stride, 0, &lfi); - } - else - { - if (mb_col > 0) - LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_v)( - y_ptr, post->y_stride, - lfi_n->mblim[filter_level]); - - if (!skip_lf) - LF_INVOKE(&cm->rtcd.loopfilter, simple_b_v)( - y_ptr, post->y_stride, - lfi_n->blim[filter_level]); - - /* don't apply across umv border */ - if (mb_row > 0) - LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_h)( - y_ptr, post->y_stride, - lfi_n->mblim[filter_level]); - - if (!skip_lf) - LF_INVOKE(&cm->rtcd.loopfilter, simple_b_h)( - y_ptr, post->y_stride, - lfi_n->blim[filter_level]); - } - } - - y_ptr += 16; - mode_info_context++; /* step to next MB */ - + /* Initialize the loop filter for this frame. */ + vp8_loop_filter_frame_init(cm, xd, default_filt_lvl); + + /* Set up the buffer pointers */ + y_ptr = post->y_buffer; + + /* vp8_filter each macro block */ + for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) { + for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) { + int skip_lf = (mode_info_context->mbmi.mode != B_PRED + && mode_info_context->mbmi.mode != I8X8_PRED + && mode_info_context->mbmi.mode != SPLITMV + && mode_info_context->mbmi.mb_skip_coeff); + + const int mode_index = lfi_n->mode_lf_lut[mode_info_context->mbmi + .mode]; + const int seg = mode_info_context->mbmi.segment_id; + const int ref_frame = mode_info_context->mbmi.ref_frame; + + filter_level = lfi_n->lvl[seg][ref_frame][mode_index]; + + // check if this mb has filtering applied + // and then whether it is the right segment or + // if not whether the passed in segment is 0 and this + // segment has no alt lf + + // TODO: Make this work for when segment 0 has the alt lv enabled + if (filter_level + && (seg == segment + || (!segfeature_active(xd, seg, SEG_LVL_ALT_LF) + && segment == 0))) { + if (cm->filter_type == NORMAL_LOOPFILTER) { + const int hev_index = + lfi_n->hev_thr_lut[frame_type][filter_level]; + lfi.mblim = lfi_n->mblim[filter_level]; + lfi.blim = lfi_n->blim[filter_level]; + lfi.lim = lfi_n->lim[filter_level]; + lfi.hev_thr = lfi_n->hev_thr[hev_index]; + + if (mb_col > 0) + vp8_loop_filter_mbv_c(y_ptr, 0, 0, post->y_stride, 0, + &lfi); + + if (!skip_lf) + LF_INVOKE(&cm->rtcd.loopfilter, normal_b_v)( + y_ptr, 0, 0, post->y_stride, 0, &lfi); + + /* don't apply across umv border */ + if (mb_row > 0) + vp8_loop_filter_mbh_c(y_ptr, 0, 0, post->y_stride, 0, + &lfi); + + if (!skip_lf) + LF_INVOKE(&cm->rtcd.loopfilter, normal_b_h)( + y_ptr, 0, 0, post->y_stride, 0, &lfi); + } else { + if (mb_col > 0) + LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_v)( + y_ptr, post->y_stride, + lfi_n->mblim[filter_level]); + + if (!skip_lf) + LF_INVOKE(&cm->rtcd.loopfilter, simple_b_v)( + y_ptr, post->y_stride, + lfi_n->blim[filter_level]); + + /* don't apply across umv border */ + if (mb_row > 0) + LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_h)( + y_ptr, post->y_stride, + lfi_n->mblim[filter_level]); + + if (!skip_lf) + LF_INVOKE(&cm->rtcd.loopfilter, simple_b_h)( + y_ptr, post->y_stride, + lfi_n->blim[filter_level]); } + } + + y_ptr += 16; + mode_info_context++; /* step to next MB */ - y_ptr += post->y_stride * 16 - post->y_width; - mode_info_context++; /* Skip border mb */ } + y_ptr += post->y_stride * 16 - post->y_width; + mode_info_context++; /* Skip border mb */ + } + } #endif void vp8_loop_filter_partial_frame ( - VP8_COMMON *cm, - MACROBLOCKD *xd, - int default_filt_lvl -) -{ - YV12_BUFFER_CONFIG *post = cm->frame_to_show; - - unsigned char *y_ptr; - int mb_row; - int mb_col; - int mb_cols = post->y_width >> 4; - - int linestocopy, i; - - loop_filter_info_n *lfi_n = &cm->lf_info; - loop_filter_info lfi; - - int filter_level; - int alt_flt_enabled = xd->segmentation_enabled; - FRAME_TYPE frame_type = cm->frame_type; - - const MODE_INFO *mode_info_context; - - int lvl_seg[MAX_MB_SEGMENTS]; - - mode_info_context = cm->mi + (post->y_height >> 5) * (mb_cols + 1); - - /* 3 is a magic number. 4 is probably magic too */ - linestocopy = (post->y_height >> (4 + 3)); - - if (linestocopy < 1) - linestocopy = 1; - - linestocopy <<= 4; - - /* Note the baseline filter values for each segment */ - /* See vp8_loop_filter_frame_init. Rather than call that for each change - * to default_filt_lvl, copy the relevant calculation here. - */ - if (alt_flt_enabled) - { - for (i = 0; i < MAX_MB_SEGMENTS; i++) - { /* Abs value */ - if (xd->mb_segment_abs_delta == SEGMENT_ABSDATA) - { - lvl_seg[i] = get_segdata( xd, i, SEG_LVL_ALT_LF ); - } - /* Delta Value */ - else - { - lvl_seg[i] = default_filt_lvl + - get_segdata( xd, i, SEG_LVL_ALT_LF ); - lvl_seg[i] = (lvl_seg[i] > 0) ? - ((lvl_seg[i] > 63) ? 63: lvl_seg[i]) : 0; - } - } + VP8_COMMON *cm, + MACROBLOCKD *xd, + int default_filt_lvl +) { + YV12_BUFFER_CONFIG *post = cm->frame_to_show; + + unsigned char *y_ptr; + int mb_row; + int mb_col; + int mb_cols = post->y_width >> 4; + + int linestocopy, i; + + loop_filter_info_n *lfi_n = &cm->lf_info; + loop_filter_info lfi; + + int filter_level; + int alt_flt_enabled = xd->segmentation_enabled; + FRAME_TYPE frame_type = cm->frame_type; + + const MODE_INFO *mode_info_context; + + int lvl_seg[MAX_MB_SEGMENTS]; + + mode_info_context = cm->mi + (post->y_height >> 5) * (mb_cols + 1); + + /* 3 is a magic number. 4 is probably magic too */ + linestocopy = (post->y_height >> (4 + 3)); + + if (linestocopy < 1) + linestocopy = 1; + + linestocopy <<= 4; + + /* Note the baseline filter values for each segment */ + /* See vp8_loop_filter_frame_init. Rather than call that for each change + * to default_filt_lvl, copy the relevant calculation here. + */ + if (alt_flt_enabled) { + for (i = 0; i < MAX_MB_SEGMENTS; i++) { + /* Abs value */ + if (xd->mb_segment_abs_delta == SEGMENT_ABSDATA) { + lvl_seg[i] = get_segdata(xd, i, SEG_LVL_ALT_LF); + } + /* Delta Value */ + else { + lvl_seg[i] = default_filt_lvl + + get_segdata(xd, i, SEG_LVL_ALT_LF); + lvl_seg[i] = (lvl_seg[i] > 0) ? + ((lvl_seg[i] > 63) ? 63 : lvl_seg[i]) : 0; + } } - - /* Set up the buffer pointers */ - y_ptr = post->y_buffer + (post->y_height >> 5) * 16 * post->y_stride; - - /* vp8_filter each macro block */ - for (mb_row = 0; mb_row<(linestocopy >> 4); mb_row++) - { - for (mb_col = 0; mb_col < mb_cols; mb_col++) - { - int skip_lf = (mode_info_context->mbmi.mode != B_PRED && - mode_info_context->mbmi.mode != I8X8_PRED && - mode_info_context->mbmi.mode != SPLITMV && - mode_info_context->mbmi.mb_skip_coeff); - - if (alt_flt_enabled) - filter_level = lvl_seg[mode_info_context->mbmi.segment_id]; - else - filter_level = default_filt_lvl; - - if (filter_level) - { - if (cm->filter_type == NORMAL_LOOPFILTER) - { - const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level]; - lfi.mblim = lfi_n->mblim[filter_level]; - lfi.blim = lfi_n->blim[filter_level]; - lfi.lim = lfi_n->lim[filter_level]; - lfi.hev_thr = lfi_n->hev_thr[hev_index]; - - if (mb_col > 0) - LF_INVOKE(&cm->rtcd.loopfilter, normal_mb_v) - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - - if (!skip_lf) - LF_INVOKE(&cm->rtcd.loopfilter, normal_b_v) - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - - LF_INVOKE(&cm->rtcd.loopfilter, normal_mb_h) - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - - if (!skip_lf) - LF_INVOKE(&cm->rtcd.loopfilter, normal_b_h) - (y_ptr, 0, 0, post->y_stride, 0, &lfi); - } - else - { - if (mb_col > 0) - LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_v) - (y_ptr, post->y_stride, lfi_n->mblim[filter_level]); - - if (!skip_lf) - LF_INVOKE(&cm->rtcd.loopfilter, simple_b_v) - (y_ptr, post->y_stride, lfi_n->blim[filter_level]); - - LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_h) - (y_ptr, post->y_stride, lfi_n->mblim[filter_level]); - - if (!skip_lf) - LF_INVOKE(&cm->rtcd.loopfilter, simple_b_h) - (y_ptr, post->y_stride, lfi_n->blim[filter_level]); - } - } - - y_ptr += 16; - mode_info_context += 1; /* step to next MB */ + } + + /* Set up the buffer pointers */ + y_ptr = post->y_buffer + (post->y_height >> 5) * 16 * post->y_stride; + + /* vp8_filter each macro block */ + for (mb_row = 0; mb_row < (linestocopy >> 4); mb_row++) { + for (mb_col = 0; mb_col < mb_cols; mb_col++) { + int skip_lf = (mode_info_context->mbmi.mode != B_PRED && + mode_info_context->mbmi.mode != I8X8_PRED && + mode_info_context->mbmi.mode != SPLITMV && + mode_info_context->mbmi.mb_skip_coeff); + + if (alt_flt_enabled) + filter_level = lvl_seg[mode_info_context->mbmi.segment_id]; + else + filter_level = default_filt_lvl; + + if (filter_level) { + if (cm->filter_type == NORMAL_LOOPFILTER) { + const int hev_index = lfi_n->hev_thr_lut[frame_type][filter_level]; + lfi.mblim = lfi_n->mblim[filter_level]; + lfi.blim = lfi_n->blim[filter_level]; + lfi.lim = lfi_n->lim[filter_level]; + lfi.hev_thr = lfi_n->hev_thr[hev_index]; + + if (mb_col > 0) + LF_INVOKE(&cm->rtcd.loopfilter, normal_mb_v) + (y_ptr, 0, 0, post->y_stride, 0, &lfi); + + if (!skip_lf) + LF_INVOKE(&cm->rtcd.loopfilter, normal_b_v) + (y_ptr, 0, 0, post->y_stride, 0, &lfi); + + LF_INVOKE(&cm->rtcd.loopfilter, normal_mb_h) + (y_ptr, 0, 0, post->y_stride, 0, &lfi); + + if (!skip_lf) + LF_INVOKE(&cm->rtcd.loopfilter, normal_b_h) + (y_ptr, 0, 0, post->y_stride, 0, &lfi); + } else { + if (mb_col > 0) + LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_v) + (y_ptr, post->y_stride, lfi_n->mblim[filter_level]); + + if (!skip_lf) + LF_INVOKE(&cm->rtcd.loopfilter, simple_b_v) + (y_ptr, post->y_stride, lfi_n->blim[filter_level]); + + LF_INVOKE(&cm->rtcd.loopfilter, simple_mb_h) + (y_ptr, post->y_stride, lfi_n->mblim[filter_level]); + + if (!skip_lf) + LF_INVOKE(&cm->rtcd.loopfilter, simple_b_h) + (y_ptr, post->y_stride, lfi_n->blim[filter_level]); } + } - y_ptr += post->y_stride * 16 - post->y_width; - mode_info_context += 1; /* Skip border mb */ + y_ptr += 16; + mode_info_context += 1; /* step to next MB */ } + + y_ptr += post->y_stride * 16 - post->y_width; + mode_info_context += 1; /* Skip border mb */ + } } diff --git a/vp8/common/loopfilter.h b/vp8/common/loopfilter.h index 0ae2b9a1b..b2ba95d5f 100644 --- a/vp8/common/loopfilter.h +++ b/vp8/common/loopfilter.h @@ -18,10 +18,9 @@ #define MAX_LOOP_FILTER 63 -typedef enum -{ - NORMAL_LOOPFILTER = 0, - SIMPLE_LOOPFILTER = 1 +typedef enum { + NORMAL_LOOPFILTER = 0, + SIMPLE_LOOPFILTER = 1 } LOOPFILTERTYPE; #if ARCH_ARM @@ -33,36 +32,34 @@ typedef enum /* Need to align this structure so when it is declared and * passed it can be loaded into vector registers. */ -typedef struct -{ - DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, mblim[MAX_LOOP_FILTER + 1][SIMD_WIDTH]); - DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, blim[MAX_LOOP_FILTER + 1][SIMD_WIDTH]); - DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, lim[MAX_LOOP_FILTER + 1][SIMD_WIDTH]); - DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, hev_thr[4][SIMD_WIDTH]); - unsigned char lvl[4][4][4]; - unsigned char hev_thr_lut[2][MAX_LOOP_FILTER + 1]; - unsigned char mode_lf_lut[MB_MODE_COUNT]; +typedef struct { + DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, mblim[MAX_LOOP_FILTER + 1][SIMD_WIDTH]); + DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, blim[MAX_LOOP_FILTER + 1][SIMD_WIDTH]); + DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, lim[MAX_LOOP_FILTER + 1][SIMD_WIDTH]); + DECLARE_ALIGNED(SIMD_WIDTH, unsigned char, hev_thr[4][SIMD_WIDTH]); + unsigned char lvl[4][4][4]; + unsigned char hev_thr_lut[2][MAX_LOOP_FILTER + 1]; + unsigned char mode_lf_lut[MB_MODE_COUNT]; } loop_filter_info_n; -typedef struct -{ - const unsigned char * mblim; - const unsigned char * blim; - const unsigned char * lim; - const unsigned char * hev_thr; +typedef struct { + const unsigned char *mblim; + const unsigned char *blim; + const unsigned char *lim; + const unsigned char *hev_thr; } loop_filter_info; #define prototype_loopfilter(sym) \ - void sym(unsigned char *src, int pitch, const unsigned char *blimit,\ - const unsigned char *limit, const unsigned char *thresh, int count) + void sym(unsigned char *src, int pitch, const unsigned char *blimit,\ + const unsigned char *limit, const unsigned char *thresh, int count) #define prototype_loopfilter_block(sym) \ - void sym(unsigned char *y, unsigned char *u, unsigned char *v, \ - int ystride, int uv_stride, loop_filter_info *lfi) + void sym(unsigned char *y, unsigned char *u, unsigned char *v, \ + int ystride, int uv_stride, loop_filter_info *lfi) #define prototype_simple_loopfilter(sym) \ - void sym(unsigned char *y, int ystride, const unsigned char *blimit) + void sym(unsigned char *y, int ystride, const unsigned char *blimit) #if ARCH_X86 || ARCH_X86_64 #include "x86/loopfilter_x86.h" @@ -115,16 +112,15 @@ extern prototype_simple_loopfilter(vp8_lf_simple_b_h); typedef prototype_loopfilter_block((*vp8_lf_block_fn_t)); typedef prototype_simple_loopfilter((*vp8_slf_block_fn_t)); -typedef struct -{ - vp8_lf_block_fn_t normal_mb_v; - vp8_lf_block_fn_t normal_b_v; - vp8_lf_block_fn_t normal_mb_h; - vp8_lf_block_fn_t normal_b_h; - vp8_slf_block_fn_t simple_mb_v; - vp8_slf_block_fn_t simple_b_v; - vp8_slf_block_fn_t simple_mb_h; - vp8_slf_block_fn_t simple_b_h; +typedef struct { + vp8_lf_block_fn_t normal_mb_v; + vp8_lf_block_fn_t normal_b_v; + vp8_lf_block_fn_t normal_mb_h; + vp8_lf_block_fn_t normal_b_h; + vp8_slf_block_fn_t simple_mb_v; + vp8_slf_block_fn_t simple_b_v; + vp8_slf_block_fn_t simple_mb_h; + vp8_slf_block_fn_t simple_b_h; } vp8_loopfilter_rtcd_vtable_t; #if CONFIG_RUNTIME_CPU_DETECT @@ -135,12 +131,12 @@ typedef struct typedef void loop_filter_uvfunction ( - unsigned char *u, /* source pointer */ - int p, /* pitch */ - const unsigned char *blimit, - const unsigned char *limit, - const unsigned char *thresh, - unsigned char *v + unsigned char *u, /* source pointer */ + int p, /* pitch */ + const unsigned char *blimit, + const unsigned char *limit, + const unsigned char *thresh, + unsigned char *v ); /* assorted loopfilter functions which get used elsewhere */ diff --git a/vp8/common/loopfilter_filters.c b/vp8/common/loopfilter_filters.c index dbfd3c96f..ef69ffecc 100644 --- a/vp8/common/loopfilter_filters.c +++ b/vp8/common/loopfilter_filters.c @@ -16,44 +16,186 @@ typedef unsigned char uc; -static __inline signed char vp8_signed_char_clamp(int t) -{ - t = (t < -128 ? -128 : t); - t = (t > 127 ? 127 : t); - return (signed char) t; +static __inline signed char vp8_signed_char_clamp(int t) { + t = (t < -128 ? -128 : t); + t = (t > 127 ? 127 : t); + return (signed char) t; } /* should we apply any filter at all ( 11111111 yes, 00000000 no) */ static __inline signed char vp8_filter_mask(uc limit, uc blimit, - uc p3, uc p2, uc p1, uc p0, - uc q0, uc q1, uc q2, uc q3) -{ - signed char mask = 0; - mask |= (abs(p3 - p2) > limit) * -1; - mask |= (abs(p2 - p1) > limit) * -1; - mask |= (abs(p1 - p0) > limit) * -1; - mask |= (abs(q1 - q0) > limit) * -1; - mask |= (abs(q2 - q1) > limit) * -1; - mask |= (abs(q3 - q2) > limit) * -1; - mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit) * -1; - mask = ~mask; - return mask; + uc p3, uc p2, uc p1, uc p0, + uc q0, uc q1, uc q2, uc q3) { + signed char mask = 0; + mask |= (abs(p3 - p2) > limit) * -1; + mask |= (abs(p2 - p1) > limit) * -1; + mask |= (abs(p1 - p0) > limit) * -1; + mask |= (abs(q1 - q0) > limit) * -1; + mask |= (abs(q2 - q1) > limit) * -1; + mask |= (abs(q3 - q2) > limit) * -1; + mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit) * -1; + mask = ~mask; + return mask; } /* is there high variance internal edge ( 11111111 yes, 00000000 no) */ -static __inline signed char vp8_hevmask(uc thresh, uc p1, uc p0, uc q0, uc q1) -{ - signed char hev = 0; - hev |= (abs(p1 - p0) > thresh) * -1; - hev |= (abs(q1 - q0) > thresh) * -1; - return hev; +static __inline signed char vp8_hevmask(uc thresh, uc p1, uc p0, uc q0, uc q1) { + signed char hev = 0; + hev |= (abs(p1 - p0) > thresh) * -1; + hev |= (abs(q1 - q0) > thresh) * -1; + return hev; } static __inline void vp8_filter(signed char mask, uc hev, uc *op1, - uc *op0, uc *oq0, uc *oq1) + uc *op0, uc *oq0, uc *oq1) { + signed char ps0, qs0; + signed char ps1, qs1; + signed char vp8_filter, Filter1, Filter2; + signed char u; + + ps1 = (signed char) * op1 ^ 0x80; + ps0 = (signed char) * op0 ^ 0x80; + qs0 = (signed char) * oq0 ^ 0x80; + qs1 = (signed char) * oq1 ^ 0x80; + + /* add outer taps if we have high edge variance */ + vp8_filter = vp8_signed_char_clamp(ps1 - qs1); + vp8_filter &= hev; + + /* inner taps */ + vp8_filter = vp8_signed_char_clamp(vp8_filter + 3 * (qs0 - ps0)); + vp8_filter &= mask; + + /* save bottom 3 bits so that we round one side +4 and the other +3 + * if it equals 4 we'll set to adjust by -1 to account for the fact + * we'd round 3 the other way + */ + Filter1 = vp8_signed_char_clamp(vp8_filter + 4); + Filter2 = vp8_signed_char_clamp(vp8_filter + 3); + Filter1 >>= 3; + Filter2 >>= 3; + u = vp8_signed_char_clamp(qs0 - Filter1); + *oq0 = u ^ 0x80; + u = vp8_signed_char_clamp(ps0 + Filter2); + *op0 = u ^ 0x80; + vp8_filter = Filter1; + + /* outer tap adjustments */ + vp8_filter += 1; + vp8_filter >>= 1; + vp8_filter &= ~hev; + + u = vp8_signed_char_clamp(qs1 - vp8_filter); + *oq1 = u ^ 0x80; + u = vp8_signed_char_clamp(ps1 + vp8_filter); + *op1 = u ^ 0x80; + +} +void vp8_loop_filter_horizontal_edge_c +( + unsigned char *s, + int p, /* pitch */ + const unsigned char *blimit, + const unsigned char *limit, + const unsigned char *thresh, + int count +) { + int hev = 0; /* high edge variance */ + signed char mask = 0; + int i = 0; + + /* loop filter designed to work using chars so that we can make maximum use + * of 8 bit simd instructions. + */ + do { + mask = vp8_filter_mask(limit[0], blimit[0], + s[-4 * p], s[-3 * p], s[-2 * p], s[-1 * p], + s[0 * p], s[1 * p], s[2 * p], s[3 * p]); + + hev = vp8_hevmask(thresh[0], s[-2 * p], s[-1 * p], s[0 * p], s[1 * p]); + + vp8_filter(mask, hev, s - 2 * p, s - 1 * p, s, s + 1 * p); + + ++s; + } while (++i < count * 8); +} + +void vp8_loop_filter_vertical_edge_c +( + unsigned char *s, + int p, + const unsigned char *blimit, + const unsigned char *limit, + const unsigned char *thresh, + int count +) { + int hev = 0; /* high edge variance */ + signed char mask = 0; + int i = 0; + + /* loop filter designed to work using chars so that we can make maximum use + * of 8 bit simd instructions. + */ + do { + mask = vp8_filter_mask(limit[0], blimit[0], + s[-4], s[-3], s[-2], s[-1], + s[0], s[1], s[2], s[3]); + + hev = vp8_hevmask(thresh[0], s[-2], s[-1], s[0], s[1]); + + vp8_filter(mask, hev, s - 2, s - 1, s, s + 1); + + s += p; + } while (++i < count * 8); +} +static __inline signed char vp8_flatmask(uc thresh, + uc p4, uc p3, uc p2, uc p1, uc p0, + uc q0, uc q1, uc q2, uc q3, uc q4) { + signed char flat = 0; + flat |= (abs(p1 - p0) > 1) * -1; + flat |= (abs(q1 - q0) > 1) * -1; + flat |= (abs(p0 - p2) > 1) * -1; + flat |= (abs(q0 - q2) > 1) * -1; + flat |= (abs(p3 - p0) > 1) * -1; + flat |= (abs(q3 - q0) > 1) * -1; + flat |= (abs(p4 - p0) > 1) * -1; + flat |= (abs(q4 - q0) > 1) * -1; + flat = ~flat; + return flat; +} + +static __inline void vp8_mbfilter(signed char mask, uc hev, uc flat, + uc *op4, uc *op3, uc *op2, uc *op1, uc *op0, + uc *oq0, uc *oq1, uc *oq2, uc *oq3, uc *oq4) { + /* use a 7 tap filter [1, 1, 1, 2, 1, 1, 1] for flat line */ + if (flat && mask) { + unsigned char p0, q0; + unsigned char p1, q1; + unsigned char p2, q2; + unsigned char p3, q3; + unsigned char p4, q4; + + p4 = *op4; + p3 = *op3; + p2 = *op2; + p1 = *op1; + p0 = *op0; + q0 = *oq0; + q1 = *oq1; + q2 = *oq2; + q3 = *oq3; + q4 = *oq4; + + *op2 = (p4 + p4 + p3 + p2 + p2 + p1 + p0 + q0 + 4) >> 3; + *op1 = (p4 + p3 + p2 + p1 + p1 + p0 + q0 + q1 + 4) >> 3; + *op0 = (p3 + p2 + p1 + p0 + p0 + q0 + q1 + q2 + 4) >> 3; + *oq0 = (p2 + p1 + p0 + q0 + q0 + q1 + q2 + q3 + 4) >> 3; + *oq1 = (p1 + p0 + q0 + q1 + q1 + q2 + q3 + q4 + 4) >> 3; + *oq2 = (p0 + q0 + q1 + q2 + q2 + q3 + q4 + q4 + 4) >> 3; + } else { signed char ps0, qs0; signed char ps1, qs1; signed char vp8_filter, Filter1, Filter2; @@ -72,10 +214,6 @@ static __inline void vp8_filter(signed char mask, uc hev, uc *op1, vp8_filter = vp8_signed_char_clamp(vp8_filter + 3 * (qs0 - ps0)); vp8_filter &= mask; - /* save bottom 3 bits so that we round one side +4 and the other +3 - * if it equals 4 we'll set to adjust by -1 to account for the fact - * we'd round 3 the other way - */ Filter1 = vp8_signed_char_clamp(vp8_filter + 4); Filter2 = vp8_signed_char_clamp(vp8_filter + 3); Filter1 >>= 3; @@ -95,315 +233,149 @@ static __inline void vp8_filter(signed char mask, uc hev, uc *op1, *oq1 = u ^ 0x80; u = vp8_signed_char_clamp(ps1 + vp8_filter); *op1 = u ^ 0x80; - -} -void vp8_loop_filter_horizontal_edge_c -( - unsigned char *s, - int p, /* pitch */ - const unsigned char *blimit, - const unsigned char *limit, - const unsigned char *thresh, - int count -) -{ - int hev = 0; /* high edge variance */ - signed char mask = 0; - int i = 0; - - /* loop filter designed to work using chars so that we can make maximum use - * of 8 bit simd instructions. - */ - do - { - mask = vp8_filter_mask(limit[0], blimit[0], - s[-4*p], s[-3*p], s[-2*p], s[-1*p], - s[0*p], s[1*p], s[2*p], s[3*p]); - - hev = vp8_hevmask(thresh[0], s[-2*p], s[-1*p], s[0*p], s[1*p]); - - vp8_filter(mask, hev, s - 2 * p, s - 1 * p, s, s + 1 * p); - - ++s; - } - while (++i < count * 8); -} - -void vp8_loop_filter_vertical_edge_c -( - unsigned char *s, - int p, - const unsigned char *blimit, - const unsigned char *limit, - const unsigned char *thresh, - int count -) -{ - int hev = 0; /* high edge variance */ - signed char mask = 0; - int i = 0; - - /* loop filter designed to work using chars so that we can make maximum use - * of 8 bit simd instructions. - */ - do - { - mask = vp8_filter_mask(limit[0], blimit[0], - s[-4], s[-3], s[-2], s[-1], - s[0], s[1], s[2], s[3]); - - hev = vp8_hevmask(thresh[0], s[-2], s[-1], s[0], s[1]); - - vp8_filter(mask, hev, s - 2, s - 1, s, s + 1); - - s += p; - } - while (++i < count * 8); -} -static __inline signed char vp8_flatmask(uc thresh, - uc p4, uc p3, uc p2, uc p1, uc p0, - uc q0, uc q1, uc q2, uc q3, uc q4) -{ - signed char flat = 0; - flat |= (abs(p1 - p0) > 1) * -1; - flat |= (abs(q1 - q0) > 1) * -1; - flat |= (abs(p0 - p2) > 1) * -1; - flat |= (abs(q0 - q2) > 1) * -1; - flat |= (abs(p3 - p0) > 1) * -1; - flat |= (abs(q3 - q0) > 1) * -1; - flat |= (abs(p4 - p0) > 1) * -1; - flat |= (abs(q4 - q0) > 1) * -1; - flat = ~flat; - return flat; -} - -static __inline void vp8_mbfilter(signed char mask, uc hev, uc flat, - uc *op4, uc *op3, uc *op2, uc *op1, uc *op0, - uc *oq0, uc *oq1, uc *oq2, uc *oq3, uc *oq4) -{ - /* use a 7 tap filter [1, 1, 1, 2, 1, 1, 1] for flat line */ - if(flat && mask) - { - unsigned char p0, q0; - unsigned char p1, q1; - unsigned char p2, q2; - unsigned char p3, q3; - unsigned char p4, q4; - - p4 = *op4; - p3 = *op3; - p2 = *op2; - p1 = *op1; - p0 = *op0; - q0 = *oq0; - q1 = *oq1; - q2 = *oq2; - q3 = *oq3; - q4 = *oq4; - - *op2 = ( p4 + p4 + p3 + p2 + p2 + p1 + p0 + q0 + 4)>>3; - *op1 = ( p4 + p3 + p2 + p1 + p1 + p0 + q0 + q1 + 4)>>3; - *op0 = ( p3 + p2 + p1 + p0 + p0 + q0 + q1 + q2 + 4)>>3; - *oq0 = ( p2 + p1 + p0 + q0 + q0 + q1 + q2 + q3 + 4)>>3; - *oq1 = ( p1 + p0 + q0 + q1 + q1 + q2 + q3 + q4 + 4)>>3; - *oq2 = ( p0 + q0 + q1 + q2 + q2 + q3 + q4 + q4 + 4)>>3; - } - else - { - signed char ps0, qs0; - signed char ps1, qs1; - signed char vp8_filter, Filter1, Filter2; - signed char u; - - ps1 = (signed char) * op1 ^ 0x80; - ps0 = (signed char) * op0 ^ 0x80; - qs0 = (signed char) * oq0 ^ 0x80; - qs1 = (signed char) * oq1 ^ 0x80; - - /* add outer taps if we have high edge variance */ - vp8_filter = vp8_signed_char_clamp(ps1 - qs1); - vp8_filter &= hev; - - /* inner taps */ - vp8_filter = vp8_signed_char_clamp(vp8_filter + 3 * (qs0 - ps0)); - vp8_filter &= mask; - - Filter1 = vp8_signed_char_clamp(vp8_filter + 4); - Filter2 = vp8_signed_char_clamp(vp8_filter + 3); - Filter1 >>= 3; - Filter2 >>= 3; - u = vp8_signed_char_clamp(qs0 - Filter1); - *oq0 = u ^ 0x80; - u = vp8_signed_char_clamp(ps0 + Filter2); - *op0 = u ^ 0x80; - vp8_filter = Filter1; - - /* outer tap adjustments */ - vp8_filter += 1; - vp8_filter >>= 1; - vp8_filter &= ~hev; - - u = vp8_signed_char_clamp(qs1 - vp8_filter); - *oq1 = u ^ 0x80; - u = vp8_signed_char_clamp(ps1 + vp8_filter); - *op1 = u ^ 0x80; - } + } } void vp8_mbloop_filter_horizontal_edge_c ( - unsigned char *s, - int p, - const unsigned char *blimit, - const unsigned char *limit, - const unsigned char *thresh, - int count -) -{ - signed char hev = 0; /* high edge variance */ - signed char mask = 0; - signed char flat = 0; - int i = 0; - - /* loop filter designed to work using chars so that we can make maximum use - * of 8 bit simd instructions. - */ - do - { - - mask = vp8_filter_mask(limit[0], blimit[0], - s[-4*p], s[-3*p], s[-2*p], s[-1*p], - s[ 0*p], s[ 1*p], s[ 2*p], s[ 3*p]); - - hev = vp8_hevmask(thresh[0], s[-2*p], s[-1*p], s[0*p], s[1*p]); - - flat = vp8_flatmask(thresh[0], - s[-5*p], s[-4*p], s[-3*p], s[-2*p], s[-1*p], - s[ 0*p], s[ 1*p], s[ 2*p], s[ 3*p], s[ 4*p]); - vp8_mbfilter(mask, hev, flat, - s - 5*p, s - 4*p, s- 3*p, s - 2*p, s - 1*p, - s, s + 1*p, s+ 2*p, s + 3*p, s + 4*p ); - - ++s; - } - while (++i < count * 8); + unsigned char *s, + int p, + const unsigned char *blimit, + const unsigned char *limit, + const unsigned char *thresh, + int count +) { + signed char hev = 0; /* high edge variance */ + signed char mask = 0; + signed char flat = 0; + int i = 0; + + /* loop filter designed to work using chars so that we can make maximum use + * of 8 bit simd instructions. + */ + do { + + mask = vp8_filter_mask(limit[0], blimit[0], + s[-4 * p], s[-3 * p], s[-2 * p], s[-1 * p], + s[ 0 * p], s[ 1 * p], s[ 2 * p], s[ 3 * p]); + + hev = vp8_hevmask(thresh[0], s[-2 * p], s[-1 * p], s[0 * p], s[1 * p]); + + flat = vp8_flatmask(thresh[0], + s[-5 * p], s[-4 * p], s[-3 * p], s[-2 * p], s[-1 * p], + s[ 0 * p], s[ 1 * p], s[ 2 * p], s[ 3 * p], s[ 4 * p]); + vp8_mbfilter(mask, hev, flat, + s - 5 * p, s - 4 * p, s - 3 * p, s - 2 * p, s - 1 * p, + s, s + 1 * p, s + 2 * p, s + 3 * p, s + 4 * p); + + ++s; + } while (++i < count * 8); } void vp8_mbloop_filter_vertical_edge_c ( - unsigned char *s, - int p, - const unsigned char *blimit, - const unsigned char *limit, - const unsigned char *thresh, - int count -) -{ - signed char hev = 0; /* high edge variance */ - signed char mask = 0; - signed char flat = 0; - int i = 0; - - do - { - - mask = vp8_filter_mask(limit[0], blimit[0], - s[-4], s[-3], s[-2], s[-1], - s[0], s[1], s[2], s[3]); - - hev = vp8_hevmask(thresh[0], s[-2], s[-1], s[0], s[1]); - flat = vp8_flatmask(thresh[0], - s[-5],s[-4],s[-3],s[-2],s[-1], - s[ 0],s[ 1],s[ 2],s[ 3],s[ 4]); - vp8_mbfilter(mask, hev, flat, - s - 5, s - 4, s - 3, s - 2, s - 1, - s, s + 1, s + 2, s + 3, s + 4); - s += p; - } - while (++i < count * 8); + unsigned char *s, + int p, + const unsigned char *blimit, + const unsigned char *limit, + const unsigned char *thresh, + int count +) { + signed char hev = 0; /* high edge variance */ + signed char mask = 0; + signed char flat = 0; + int i = 0; + + do { + + mask = vp8_filter_mask(limit[0], blimit[0], + s[-4], s[-3], s[-2], s[-1], + s[0], s[1], s[2], s[3]); + + hev = vp8_hevmask(thresh[0], s[-2], s[-1], s[0], s[1]); + flat = vp8_flatmask(thresh[0], + s[-5], s[-4], s[-3], s[-2], s[-1], + s[ 0], s[ 1], s[ 2], s[ 3], s[ 4]); + vp8_mbfilter(mask, hev, flat, + s - 5, s - 4, s - 3, s - 2, s - 1, + s, s + 1, s + 2, s + 3, s + 4); + s += p; + } while (++i < count * 8); } /* should we apply any filter at all ( 11111111 yes, 00000000 no) */ static __inline signed char vp8_simple_filter_mask(uc blimit, uc p1, uc p0, - uc q0, uc q1) -{ -/* Why does this cause problems for win32? - * error C2143: syntax error : missing ';' before 'type' - * (void) limit; - */ - signed char mask = (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 <= blimit) * -1; - return mask; + uc q0, uc q1) { + /* Why does this cause problems for win32? + * error C2143: syntax error : missing ';' before 'type' + * (void) limit; + */ + signed char mask = (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 <= blimit) * -1; + return mask; } static __inline void vp8_simple_filter(signed char mask, uc *op1, uc *op0, - uc *oq0, uc *oq1) -{ - signed char vp8_filter, Filter1, Filter2; - signed char p1 = (signed char) * op1 ^ 0x80; - signed char p0 = (signed char) * op0 ^ 0x80; - signed char q0 = (signed char) * oq0 ^ 0x80; - signed char q1 = (signed char) * oq1 ^ 0x80; - signed char u; - - vp8_filter = vp8_signed_char_clamp(p1 - q1); - vp8_filter = vp8_signed_char_clamp(vp8_filter + 3 * (q0 - p0)); - vp8_filter &= mask; - - /* save bottom 3 bits so that we round one side +4 and the other +3 */ - Filter1 = vp8_signed_char_clamp(vp8_filter + 4); - Filter1 >>= 3; - u = vp8_signed_char_clamp(q0 - Filter1); - *oq0 = u ^ 0x80; - - Filter2 = vp8_signed_char_clamp(vp8_filter + 3); - Filter2 >>= 3; - u = vp8_signed_char_clamp(p0 + Filter2); - *op0 = u ^ 0x80; + uc *oq0, uc *oq1) { + signed char vp8_filter, Filter1, Filter2; + signed char p1 = (signed char) * op1 ^ 0x80; + signed char p0 = (signed char) * op0 ^ 0x80; + signed char q0 = (signed char) * oq0 ^ 0x80; + signed char q1 = (signed char) * oq1 ^ 0x80; + signed char u; + + vp8_filter = vp8_signed_char_clamp(p1 - q1); + vp8_filter = vp8_signed_char_clamp(vp8_filter + 3 * (q0 - p0)); + vp8_filter &= mask; + + /* save bottom 3 bits so that we round one side +4 and the other +3 */ + Filter1 = vp8_signed_char_clamp(vp8_filter + 4); + Filter1 >>= 3; + u = vp8_signed_char_clamp(q0 - Filter1); + *oq0 = u ^ 0x80; + + Filter2 = vp8_signed_char_clamp(vp8_filter + 3); + Filter2 >>= 3; + u = vp8_signed_char_clamp(p0 + Filter2); + *op0 = u ^ 0x80; } void vp8_loop_filter_simple_horizontal_edge_c ( - unsigned char *s, - int p, - const unsigned char *blimit -) -{ - signed char mask = 0; - int i = 0; - - do - { - mask = vp8_simple_filter_mask(blimit[0], - s[-2*p], s[-1*p], - s[0*p], s[1*p]); - vp8_simple_filter(mask, - s - 2 * p, s - 1 * p, - s, s + 1 * p); - ++s; - } - while (++i < 16); + unsigned char *s, + int p, + const unsigned char *blimit +) { + signed char mask = 0; + int i = 0; + + do { + mask = vp8_simple_filter_mask(blimit[0], + s[-2 * p], s[-1 * p], + s[0 * p], s[1 * p]); + vp8_simple_filter(mask, + s - 2 * p, s - 1 * p, + s, s + 1 * p); + ++s; + } while (++i < 16); } void vp8_loop_filter_simple_vertical_edge_c ( - unsigned char *s, - int p, - const unsigned char *blimit -) -{ - signed char mask = 0; - int i = 0; - - do - { - mask = vp8_simple_filter_mask(blimit[0], s[-2], s[-1], s[0], s[1]); - vp8_simple_filter(mask, s - 2, s - 1, s, s + 1); - s += p; - } - while (++i < 16); + unsigned char *s, + int p, + const unsigned char *blimit +) { + signed char mask = 0; + int i = 0; + + do { + mask = vp8_simple_filter_mask(blimit[0], s[-2], s[-1], s[0], s[1]); + vp8_simple_filter(mask, s - 2, s - 1, s, s + 1); + s += p; + } while (++i < 16); } diff --git a/vp8/common/maskingmv.c b/vp8/common/maskingmv.c index d01a18fc8..72109378d 100644 --- a/vp8/common/maskingmv.c +++ b/vp8/common/maskingmv.c @@ -12,183 +12,176 @@ #include <stdlib.h> #include <string.h> extern unsigned int vp8_sad16x16_sse3( - unsigned char *src_ptr, - int src_stride, - unsigned char *ref_ptr, - int ref_stride, - int max_err); + unsigned char *src_ptr, + int src_stride, + unsigned char *ref_ptr, + int ref_stride, + int max_err); extern void vp8_sad16x16x3_sse3( - unsigned char *src_ptr, - int src_stride, - unsigned char *ref_ptr, - int ref_stride, - int *results); + unsigned char *src_ptr, + int src_stride, + unsigned char *ref_ptr, + int ref_stride, + int *results); extern int vp8_growmaskmb_sse3( - unsigned char *om, - unsigned char *nm); + unsigned char *om, + unsigned char *nm); extern void vp8_makemask_sse3( - unsigned char *y, - unsigned char *u, - unsigned char *v, - unsigned char *ym, - int yp, - int uvp, - int ys, - int us, - int vs, - int yt, - int ut, - int vt); + unsigned char *y, + unsigned char *u, + unsigned char *v, + unsigned char *ym, + int yp, + int uvp, + int ys, + int us, + int vs, + int yt, + int ut, + int vt); unsigned int vp8_sad16x16_unmasked_wmt( - unsigned char *src_ptr, - int src_stride, - unsigned char *ref_ptr, - int ref_stride, - unsigned char *mask); + unsigned char *src_ptr, + int src_stride, + unsigned char *ref_ptr, + int ref_stride, + unsigned char *mask); unsigned int vp8_sad16x16_masked_wmt( - unsigned char *src_ptr, - int src_stride, - unsigned char *ref_ptr, - int ref_stride, - unsigned char *mask); + unsigned char *src_ptr, + int src_stride, + unsigned char *ref_ptr, + int ref_stride, + unsigned char *mask); unsigned int vp8_masked_predictor_wmt( - unsigned char *masked, - unsigned char *unmasked, - int src_stride, - unsigned char *dst_ptr, - int dst_stride, - unsigned char *mask); + unsigned char *masked, + unsigned char *unmasked, + int src_stride, + unsigned char *dst_ptr, + int dst_stride, + unsigned char *mask); unsigned int vp8_masked_predictor_uv_wmt( - unsigned char *masked, - unsigned char *unmasked, - int src_stride, - unsigned char *dst_ptr, - int dst_stride, - unsigned char *mask); + unsigned char *masked, + unsigned char *unmasked, + int src_stride, + unsigned char *dst_ptr, + int dst_stride, + unsigned char *mask); unsigned int vp8_uv_from_y_mask( - unsigned char *ymask, - unsigned char *uvmask); -int yp=16; -unsigned char sxy[]= -{ -40,40,40,60,60,60,60,40,40,40,40,60,60,60,60,40,80,120,120,90,90,90,90,90,80,120,120,90,90,90,90,90, -40,40,40,60,60,60,60,40,40,40,40,60,60,60,60,40,80,120,120,90,90,90,90,90,80,120,120,90,90,90,90,90, -40,40,60,60,60,60,40,40,40,40,60,60,60,60,40,40,80,120,120,90,90,90,90,90,80,120,120,90,90,90,90,90, -40,40,60,60,60,60,40,40,40,40,60,60,60,60,40,40,80,120,120,90,90,90,90,90,80,120,120,90,90,90,90,90, -40,60,60,60,60,40,40,40,40,60,60,60,60,40,40,40,80,120,120,90,90,90,90,90,80,120,120,90,90,90,90,90, -60,60,60,60,40,40,40,40,60,60,60,60,40,40,40,40,80,120,120,90,90,90,90,90,80,120,120,90,90,90,90,90, -60,60,60,60,40,40,40,40,60,60,60,60,40,40,40,40,80,120,120,90,90,90,90,90,80,120,120,90,90,90,90,90, -60,60,60,60,40,40,40,40,60,60,60,60,40,40,40,40,80,120,120,90,90,90,90,90,80,120,120,90,90,90,90,90, -40,60,60,60,60,40,40,40,40,60,60,60,60,40,40,40,80,120,120,90,90,90,90,90,80,120,120,90,90,90,90,90, -40,60,60,60,60,40,40,40,40,60,60,60,60,40,40,40,80,120,120,90,90,90,90,90,80,120,120,90,90,90,90,90, -40,40,60,60,60,60,40,40,40,40,60,60,60,60,40,40,80,120,120,90,90,90,90,90,80,120,120,90,90,90,90,90, -40,40,60,60,60,60,40,40,40,40,60,60,60,60,40,40,80,120,120,90,90,90,90,90,80,120,120,90,90,90,90,90, -40,40,40,60,60,60,60,40,40,40,40,60,60,60,60,40,80,120,120,90,90,90,90,90,80,120,120,90,90,90,90,90, -40,40,40,60,60,60,60,40,40,40,40,60,60,60,60,40,80,120,120,90,90,90,90,90,80,120,120,90,90,90,90,90, -40,40,40,60,60,60,60,40,40,40,40,60,60,60,60,40,80,120,120,90,90,90,90,90,80,120,120,90,90,90,90,90, -40,40,40,60,60,60,60,40,40,40,40,60,60,60,60,40,80,120,120,90,90,90,90,90,80,120,120,90,90,90,90,90 + unsigned char *ymask, + unsigned char *uvmask); +int yp = 16; +unsigned char sxy[] = { + 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 80, 120, 120, 90, 90, 90, 90, 90, 80, 120, 120, 90, 90, 90, 90, 90, + 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 80, 120, 120, 90, 90, 90, 90, 90, 80, 120, 120, 90, 90, 90, 90, 90, + 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, 80, 120, 120, 90, 90, 90, 90, 90, 80, 120, 120, 90, 90, 90, 90, 90, + 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, 80, 120, 120, 90, 90, 90, 90, 90, 80, 120, 120, 90, 90, 90, 90, 90, + 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 80, 120, 120, 90, 90, 90, 90, 90, 80, 120, 120, 90, 90, 90, 90, 90, + 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 80, 120, 120, 90, 90, 90, 90, 90, 80, 120, 120, 90, 90, 90, 90, 90, + 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 80, 120, 120, 90, 90, 90, 90, 90, 80, 120, 120, 90, 90, 90, 90, 90, + 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 80, 120, 120, 90, 90, 90, 90, 90, 80, 120, 120, 90, 90, 90, 90, 90, + 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 80, 120, 120, 90, 90, 90, 90, 90, 80, 120, 120, 90, 90, 90, 90, 90, + 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 80, 120, 120, 90, 90, 90, 90, 90, 80, 120, 120, 90, 90, 90, 90, 90, + 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, 80, 120, 120, 90, 90, 90, 90, 90, 80, 120, 120, 90, 90, 90, 90, 90, + 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, 80, 120, 120, 90, 90, 90, 90, 90, 80, 120, 120, 90, 90, 90, 90, 90, + 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 80, 120, 120, 90, 90, 90, 90, 90, 80, 120, 120, 90, 90, 90, 90, 90, + 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 80, 120, 120, 90, 90, 90, 90, 90, 80, 120, 120, 90, 90, 90, 90, 90, + 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 80, 120, 120, 90, 90, 90, 90, 90, 80, 120, 120, 90, 90, 90, 90, 90, + 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 80, 120, 120, 90, 90, 90, 90, 90, 80, 120, 120, 90, 90, 90, 90, 90 }; -unsigned char sts[]= -{ -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, -2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, +unsigned char sts[] = { + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, }; -unsigned char str[]= -{ -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, -1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 +unsigned char str[] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; -unsigned char y[]= -{ -40,40,40,60,60,60,60,40,40,40,40,60,60,60,60,40, -40,40,40,60,60,60,60,40,40,40,40,60,60,60,60,40, -40,40,60,60,60,60,40,40,40,40,60,60,60,60,40,40, -40,40,60,60,60,60,40,40,40,40,60,60,60,60,40,40, -40,60,60,60,60,40,40,40,40,60,60,60,60,40,40,40, -60,60,60,60,40,40,40,40,60,60,60,60,40,40,40,40, -60,60,60,60,40,40,40,40,60,60,60,60,40,40,40,40, -60,60,60,60,40,40,40,40,60,60,60,60,40,40,40,40, -40,60,60,60,60,40,40,40,40,60,60,60,60,40,40,40, -40,60,60,60,60,40,40,40,40,60,60,60,60,40,40,40, -40,40,60,60,60,60,40,40,40,40,60,60,60,60,40,40, -40,40,60,60,60,60,40,40,40,40,60,60,60,60,40,40, -40,40,40,60,60,60,60,40,40,40,40,60,60,60,60,40, -40,40,40,60,60,60,60,40,40,40,40,60,60,60,60,40, -40,40,40,60,60,60,60,40,40,40,40,60,60,60,60,40, -40,40,40,60,60,60,60,40,40,40,40,60,60,60,60,40 +unsigned char y[] = { + 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, + 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, + 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, + 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, + 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, + 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, + 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, + 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, + 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, + 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, + 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, + 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, 40, + 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, + 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, + 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40, + 40, 40, 40, 60, 60, 60, 60, 40, 40, 40, 40, 60, 60, 60, 60, 40 }; -int uvp=8; -unsigned char u[]= -{ -90,80,70,70,90,90,90,17, -90,80,70,70,90,90,90,17, -84,70,70,90,90,90,17,17, -84,70,70,90,90,90,17,17, -80,70,70,90,90,90,17,17, -90,80,70,70,90,90,90,17, -90,80,70,70,90,90,90,17, -90,80,70,70,90,90,90,17 +int uvp = 8; +unsigned char u[] = { + 90, 80, 70, 70, 90, 90, 90, 17, + 90, 80, 70, 70, 90, 90, 90, 17, + 84, 70, 70, 90, 90, 90, 17, 17, + 84, 70, 70, 90, 90, 90, 17, 17, + 80, 70, 70, 90, 90, 90, 17, 17, + 90, 80, 70, 70, 90, 90, 90, 17, + 90, 80, 70, 70, 90, 90, 90, 17, + 90, 80, 70, 70, 90, 90, 90, 17 }; -unsigned char v[]= -{ -80,80,80,80,80,80,80,80, -80,80,80,80,80,80,80,80, -80,80,80,80,80,80,80,80, -80,80,80,80,80,80,80,80, -80,80,80,80,80,80,80,80, -80,80,80,80,80,80,80,80, -80,80,80,80,80,80,80,80, -80,80,80,80,80,80,80,80 +unsigned char v[] = { + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80 }; unsigned char ym[256]; unsigned char uvm[64]; -typedef struct -{ - unsigned char y; - unsigned char yt; - unsigned char u; - unsigned char ut; - unsigned char v; - unsigned char vt; - unsigned char use; +typedef struct { + unsigned char y; + unsigned char yt; + unsigned char u; + unsigned char ut; + unsigned char v; + unsigned char vt; + unsigned char use; } COLOR_SEG_ELEMENT; /* @@ -199,474 +192,430 @@ COLOR_SEG_ELEMENT segmentation[]= }; */ -COLOR_SEG_ELEMENT segmentation[]= -{ - { 79,44,92,44, 237,60, 1}, +COLOR_SEG_ELEMENT segmentation[] = { + { 79, 44, 92, 44, 237, 60, 1}, }; -unsigned char pixel_mask(unsigned char y,unsigned char u,unsigned char v, - COLOR_SEG_ELEMENT sgm[], - int c) -{ - COLOR_SEG_ELEMENT *s=sgm; - unsigned char m =0; - int i; - for(i=0;i<c;i++,s++) - m |= ( abs(y-s->y)< s->yt && - abs(u-s->u)< s->ut && - abs(v-s->v)< s->vt ? 255 : 0 ); - - return m; +unsigned char pixel_mask(unsigned char y, unsigned char u, unsigned char v, + COLOR_SEG_ELEMENT sgm[], + int c) { + COLOR_SEG_ELEMENT *s = sgm; + unsigned char m = 0; + int i; + for (i = 0; i < c; i++, s++) + m |= (abs(y - s->y) < s->yt && + abs(u - s->u) < s->ut && + abs(v - s->v) < s->vt ? 255 : 0); + + return m; } int neighbors[256][8]; -int makeneighbors(void) -{ - int i,j; - for(i=0;i<256;i++) - { - int r=(i>>4),c=(i&15); - int ni=0; - for(j=0;j<8;j++) - neighbors[i][j]=i; - for(j=0;j<256;j++) - { - int nr=(j>>4),nc=(j&15); - if(abs(nr-r)<2&&abs(nc-c)<2) - neighbors[i][ni++]=j; - } +int makeneighbors(void) { + int i, j; + for (i = 0; i < 256; i++) { + int r = (i >> 4), c = (i & 15); + int ni = 0; + for (j = 0; j < 8; j++) + neighbors[i][j] = i; + for (j = 0; j < 256; j++) { + int nr = (j >> 4), nc = (j & 15); + if (abs(nr - r) < 2 && abs(nc - c) < 2) + neighbors[i][ni++] = j; } - return 0; + } + return 0; } -void grow_ymask(unsigned char *ym) -{ - unsigned char nym[256]; - int i,j; - - for(i=0;i<256;i++) - { - nym[i]=ym[i]; - for(j=0;j<8;j++) - { - nym[i]|=ym[neighbors[i][j]]; - } +void grow_ymask(unsigned char *ym) { + unsigned char nym[256]; + int i, j; + + for (i = 0; i < 256; i++) { + nym[i] = ym[i]; + for (j = 0; j < 8; j++) { + nym[i] |= ym[neighbors[i][j]]; } - for(i=0;i<256;i++) - ym[i]=nym[i]; + } + for (i = 0; i < 256; i++) + ym[i] = nym[i]; } void make_mb_mask(unsigned char *y, unsigned char *u, unsigned char *v, unsigned char *ym, unsigned char *uvm, int yp, int uvp, COLOR_SEG_ELEMENT sgm[], - int count) -{ - int r,c; - unsigned char *oym = ym; - - memset(ym,20,256); - for(r=0;r<8;r++,uvm+=8,u+=uvp,v+=uvp,y+=(yp+yp),ym+=32) - for(c=0;c<8;c++) - { - int y1=y[c<<1]; - int u1=u[c]; - int v1=v[c]; - int m = pixel_mask(y1,u1,v1,sgm,count); - uvm[c] = m; - ym[c<<1] = uvm[c];// = pixel_mask(y[c<<1],u[c],v[c],sgm,count); - ym[(c<<1)+1] = pixel_mask(y[1+(c<<1)],u[c],v[c],sgm,count); - ym[(c<<1)+16] = pixel_mask(y[yp+(c<<1)],u[c],v[c],sgm,count); - ym[(c<<1)+17] = pixel_mask(y[1+yp+(c<<1)],u[c],v[c],sgm,count); - } - grow_ymask(oym); + int count) { + int r, c; + unsigned char *oym = ym; + + memset(ym, 20, 256); + for (r = 0; r < 8; r++, uvm += 8, u += uvp, v += uvp, y += (yp + yp), ym += 32) + for (c = 0; c < 8; c++) { + int y1 = y[c << 1]; + int u1 = u[c]; + int v1 = v[c]; + int m = pixel_mask(y1, u1, v1, sgm, count); + uvm[c] = m; + ym[c << 1] = uvm[c]; // = pixel_mask(y[c<<1],u[c],v[c],sgm,count); + ym[(c << 1) + 1] = pixel_mask(y[1 + (c << 1)], u[c], v[c], sgm, count); + ym[(c << 1) + 16] = pixel_mask(y[yp + (c << 1)], u[c], v[c], sgm, count); + ym[(c << 1) + 17] = pixel_mask(y[1 + yp + (c << 1)], u[c], v[c], sgm, count); + } + grow_ymask(oym); } int masked_sad(unsigned char *src, int p, unsigned char *dst, int dp, - unsigned char *ym ) -{ - int i,j; - unsigned sad = 0; - for(i=0;i<16;i++,src+=p,dst+=dp,ym+=16) - for(j=0;j<16;j++) - if(ym[j]) - sad+= abs(src[j]-dst[j]); - - return sad; + unsigned char *ym) { + int i, j; + unsigned sad = 0; + for (i = 0; i < 16; i++, src += p, dst += dp, ym += 16) + for (j = 0; j < 16; j++) + if (ym[j]) + sad += abs(src[j] - dst[j]); + + return sad; } -int compare_masks(unsigned char *sym, unsigned char *ym) -{ - int i,j; - unsigned sad = 0; - for(i=0;i<16;i++,sym += 16,ym+=16) - for(j=0;j<16;j++) - sad+= (sym[j]!=ym[j]?1:0); +int compare_masks(unsigned char *sym, unsigned char *ym) { + int i, j; + unsigned sad = 0; + for (i = 0; i < 16; i++, sym += 16, ym += 16) + for (j = 0; j < 16; j++) + sad += (sym[j] != ym[j] ? 1 : 0); - return sad; + return sad; } int unmasked_sad(unsigned char *src, int p, unsigned char *dst, int dp, - unsigned char *ym) -{ - int i,j; - unsigned sad = 0; - for(i=0;i<16;i++,src+=p,dst+=dp,ym+=16) - for(j=0;j<16;j++) - if(!ym[j]) - sad+= abs(src[j]-dst[j]); - - return sad; + unsigned char *ym) { + int i, j; + unsigned sad = 0; + for (i = 0; i < 16; i++, src += p, dst += dp, ym += 16) + for (j = 0; j < 16; j++) + if (!ym[j]) + sad += abs(src[j] - dst[j]); + + return sad; } -int masked_motion_search( unsigned char *y, unsigned char *u, unsigned char *v, - int yp, int uvp, - unsigned char *dy, unsigned char *du, unsigned char *dv, - int dyp, int duvp, - COLOR_SEG_ELEMENT sgm[], - int count, - int *mi, - int *mj, - int *ui, - int *uj, - int *wm) -{ - int i,j; - - unsigned char ym[256]; - unsigned char uvm[64]; - unsigned char dym[256]; - unsigned char duvm[64]; - unsigned int e = 0 ; - int beste=256; - int bmi=-32,bmj=-32; - int bui=-32,buj=-32; - int beste1=256; - int bmi1=-32,bmj1=-32; - int bui1=-32,buj1=-32; - int obeste; - - // first try finding best mask and then unmasked - beste = 0xffffffff; - - // find best unmasked mv - for(i=-32;i<32;i++) - { - unsigned char *dyz = i*dyp + dy; - unsigned char *duz = i/2*duvp + du; - unsigned char *dvz = i/2*duvp + dv; - for(j=-32;j<32;j++) - { - // 0,0 masked destination - make_mb_mask(dyz+j,duz+j/2, dvz+j/2, dym, duvm, dyp, duvp,sgm,count); - - e = unmasked_sad(y, yp, dyz+j, dyp, dym ); - - if(e<beste) - { - bui=i; - buj=j; - beste=e; - } - } +int masked_motion_search(unsigned char *y, unsigned char *u, unsigned char *v, + int yp, int uvp, + unsigned char *dy, unsigned char *du, unsigned char *dv, + int dyp, int duvp, + COLOR_SEG_ELEMENT sgm[], + int count, + int *mi, + int *mj, + int *ui, + int *uj, + int *wm) { + int i, j; + + unsigned char ym[256]; + unsigned char uvm[64]; + unsigned char dym[256]; + unsigned char duvm[64]; + unsigned int e = 0; + int beste = 256; + int bmi = -32, bmj = -32; + int bui = -32, buj = -32; + int beste1 = 256; + int bmi1 = -32, bmj1 = -32; + int bui1 = -32, buj1 = -32; + int obeste; + + // first try finding best mask and then unmasked + beste = 0xffffffff; + + // find best unmasked mv + for (i = -32; i < 32; i++) { + unsigned char *dyz = i * dyp + dy; + unsigned char *duz = i / 2 * duvp + du; + unsigned char *dvz = i / 2 * duvp + dv; + for (j = -32; j < 32; j++) { + // 0,0 masked destination + make_mb_mask(dyz + j, duz + j / 2, dvz + j / 2, dym, duvm, dyp, duvp, sgm, count); + + e = unmasked_sad(y, yp, dyz + j, dyp, dym); + + if (e < beste) { + bui = i; + buj = j; + beste = e; + } } - //bui=0;buj=0; - // best mv masked destination - make_mb_mask(dy+bui*dyp+buj,du+bui/2*duvp+buj/2, dv+bui/2*duvp+buj/2, - dym, duvm, dyp, duvp,sgm,count); - - obeste = beste; - beste = 0xffffffff; - - // find best masked - for(i=-32;i<32;i++) - { - unsigned char *dyz = i*dyp + dy; - for(j=-32;j<32;j++) - { - e = masked_sad(y, yp, dyz+j, dyp, dym ); - - if(e<beste) - { - bmi=i; - bmj=j; - beste=e; - } - } + } + // bui=0;buj=0; + // best mv masked destination + make_mb_mask(dy + bui * dyp + buj, du + bui / 2 * duvp + buj / 2, dv + bui / 2 * duvp + buj / 2, + dym, duvm, dyp, duvp, sgm, count); + + obeste = beste; + beste = 0xffffffff; + + // find best masked + for (i = -32; i < 32; i++) { + unsigned char *dyz = i * dyp + dy; + for (j = -32; j < 32; j++) { + e = masked_sad(y, yp, dyz + j, dyp, dym); + + if (e < beste) { + bmi = i; + bmj = j; + beste = e; + } } - beste1=beste+obeste; - bmi1=bmi;bmj1=bmj; - bui1=bui;buj1=buj; - - beste = 0xffffffff; - // source mask - make_mb_mask(y,u, v, ym, uvm, yp, uvp,sgm,count); - - // find best mask - for(i=-32;i<32;i++) - { - unsigned char *dyz = i*dyp + dy; - unsigned char *duz = i/2*duvp + du; - unsigned char *dvz = i/2*duvp + dv; - for(j=-32;j<32;j++) - { - // 0,0 masked destination - make_mb_mask(dyz+j,duz+j/2, dvz+j/2, dym, duvm, dyp, duvp,sgm,count); - - e = compare_masks(ym, dym); - - if(e<beste) - { - bmi=i; - bmj=j; - beste=e; - } - } + } + beste1 = beste + obeste; + bmi1 = bmi; + bmj1 = bmj; + bui1 = bui; + buj1 = buj; + + beste = 0xffffffff; + // source mask + make_mb_mask(y, u, v, ym, uvm, yp, uvp, sgm, count); + + // find best mask + for (i = -32; i < 32; i++) { + unsigned char *dyz = i * dyp + dy; + unsigned char *duz = i / 2 * duvp + du; + unsigned char *dvz = i / 2 * duvp + dv; + for (j = -32; j < 32; j++) { + // 0,0 masked destination + make_mb_mask(dyz + j, duz + j / 2, dvz + j / 2, dym, duvm, dyp, duvp, sgm, count); + + e = compare_masks(ym, dym); + + if (e < beste) { + bmi = i; + bmj = j; + beste = e; + } } + } - // best mv masked destination - make_mb_mask(dy+bmi*dyp+bmj,du+bmi/2*duvp+bmj/2, dv+bmi/2*duvp+bmj/2, - dym, duvm, dyp, duvp,sgm,count); + // best mv masked destination + make_mb_mask(dy + bmi * dyp + bmj, du + bmi / 2 * duvp + bmj / 2, dv + bmi / 2 * duvp + bmj / 2, + dym, duvm, dyp, duvp, sgm, count); - obeste = masked_sad(y, yp, dy+bmi*dyp+bmj, dyp, dym ); + obeste = masked_sad(y, yp, dy + bmi * dyp + bmj, dyp, dym); - beste = 0xffffffff; + beste = 0xffffffff; - // find best unmasked mv - for(i=-32;i<32;i++) - { - unsigned char *dyz = i*dyp + dy; - for(j=-32;j<32;j++) - { - e = unmasked_sad(y, yp, dyz+j, dyp, dym ); + // find best unmasked mv + for (i = -32; i < 32; i++) { + unsigned char *dyz = i * dyp + dy; + for (j = -32; j < 32; j++) { + e = unmasked_sad(y, yp, dyz + j, dyp, dym); - if(e<beste) - { - bui=i; - buj=j; - beste=e; - } - } + if (e < beste) { + bui = i; + buj = j; + beste = e; + } } - beste += obeste; - - - if(beste<beste1) - { - *mi = bmi; - *mj = bmj; - *ui = bui; - *uj = buj; - *wm = 1; - } - else - { - *mi = bmi1; - *mj = bmj1; - *ui = bui1; - *uj = buj1; - *wm = 0; - - } - return 0; + } + beste += obeste; + + + if (beste < beste1) { + *mi = bmi; + *mj = bmj; + *ui = bui; + *uj = buj; + *wm = 1; + } else { + *mi = bmi1; + *mj = bmj1; + *ui = bui1; + *uj = buj1; + *wm = 0; + + } + return 0; } int predict(unsigned char *src, int p, unsigned char *dst, int dp, - unsigned char *ym, unsigned char *prd ) -{ - int i,j; - for(i=0;i<16;i++,src+=p,dst+=dp,ym+=16, prd+=16) - for(j=0;j<16;j++) - prd[j]=(ym[j] ? src[j]:dst[j]); - return 0; + unsigned char *ym, unsigned char *prd) { + int i, j; + for (i = 0; i < 16; i++, src += p, dst += dp, ym += 16, prd += 16) + for (j = 0; j < 16; j++) + prd[j] = (ym[j] ? src[j] : dst[j]); + return 0; } -int fast_masked_motion_search( unsigned char *y, unsigned char *u, unsigned char *v, - int yp, int uvp, - unsigned char *dy, unsigned char *du, unsigned char *dv, - int dyp, int duvp, - COLOR_SEG_ELEMENT sgm[], - int count, - int *mi, - int *mj, - int *ui, - int *uj, - int *wm) -{ - int i,j; - - unsigned char ym[256]; - unsigned char ym2[256]; - unsigned char uvm[64]; - unsigned char dym2[256]; - unsigned char dym[256]; - unsigned char duvm[64]; - unsigned int e = 0 ; - int beste=256; - int bmi=-32,bmj=-32; - int bui=-32,buj=-32; - int beste1=256; - int bmi1=-32,bmj1=-32; - int bui1=-32,buj1=-32; - int obeste; - - // first try finding best mask and then unmasked - beste = 0xffffffff; +int fast_masked_motion_search(unsigned char *y, unsigned char *u, unsigned char *v, + int yp, int uvp, + unsigned char *dy, unsigned char *du, unsigned char *dv, + int dyp, int duvp, + COLOR_SEG_ELEMENT sgm[], + int count, + int *mi, + int *mj, + int *ui, + int *uj, + int *wm) { + int i, j; + + unsigned char ym[256]; + unsigned char ym2[256]; + unsigned char uvm[64]; + unsigned char dym2[256]; + unsigned char dym[256]; + unsigned char duvm[64]; + unsigned int e = 0; + int beste = 256; + int bmi = -32, bmj = -32; + int bui = -32, buj = -32; + int beste1 = 256; + int bmi1 = -32, bmj1 = -32; + int bui1 = -32, buj1 = -32; + int obeste; + + // first try finding best mask and then unmasked + beste = 0xffffffff; #if 0 - for(i=0;i<16;i++) - { - unsigned char *dy = i*yp + y; - for(j=0;j<16;j++) - printf("%2x",dy[j]); - printf("\n"); - } + for (i = 0; i < 16; i++) { + unsigned char *dy = i * yp + y; + for (j = 0; j < 16; j++) + printf("%2x", dy[j]); printf("\n"); + } + printf("\n"); - for(i=-32;i<48;i++) - { - unsigned char *dyz = i*dyp + dy; - for(j=-32;j<48;j++) - printf("%2x",dyz[j]); - printf("\n"); - } + for (i = -32; i < 48; i++) { + unsigned char *dyz = i * dyp + dy; + for (j = -32; j < 48; j++) + printf("%2x", dyz[j]); + printf("\n"); + } #endif - // find best unmasked mv - for(i=-32;i<32;i++) - { - unsigned char *dyz = i*dyp + dy; - unsigned char *duz = i/2*duvp + du; - unsigned char *dvz = i/2*duvp + dv; - for(j=-32;j<32;j++) - { - // 0,0 masked destination - vp8_makemask_sse3(dyz+j,duz+j/2, dvz+j/2, dym, dyp, duvp, - sgm[0].y,sgm[0].u,sgm[0].v, - sgm[0].yt,sgm[0].ut,sgm[0].vt); - - vp8_growmaskmb_sse3(dym,dym2); - - e = vp8_sad16x16_unmasked_wmt(y, yp, dyz+j, dyp, dym2 ); - - if(e<beste) - { - bui=i; - buj=j; - beste=e; - } - } + // find best unmasked mv + for (i = -32; i < 32; i++) { + unsigned char *dyz = i * dyp + dy; + unsigned char *duz = i / 2 * duvp + du; + unsigned char *dvz = i / 2 * duvp + dv; + for (j = -32; j < 32; j++) { + // 0,0 masked destination + vp8_makemask_sse3(dyz + j, duz + j / 2, dvz + j / 2, dym, dyp, duvp, + sgm[0].y, sgm[0].u, sgm[0].v, + sgm[0].yt, sgm[0].ut, sgm[0].vt); + + vp8_growmaskmb_sse3(dym, dym2); + + e = vp8_sad16x16_unmasked_wmt(y, yp, dyz + j, dyp, dym2); + + if (e < beste) { + bui = i; + buj = j; + beste = e; + } } - //bui=0;buj=0; - // best mv masked destination - - vp8_makemask_sse3(dy+bui*dyp+buj,du+bui/2*duvp+buj/2, dv+bui/2*duvp+buj/2, - dym, dyp, duvp, - sgm[0].y,sgm[0].u,sgm[0].v, - sgm[0].yt,sgm[0].ut,sgm[0].vt); - - vp8_growmaskmb_sse3(dym,dym2); - - obeste = beste; - beste = 0xffffffff; - - // find best masked - for(i=-32;i<32;i++) - { - unsigned char *dyz = i*dyp + dy; - for(j=-32;j<32;j++) - { - e = vp8_sad16x16_masked_wmt(y, yp, dyz+j, dyp, dym2 ); - if(e<beste) - { - bmi=i; - bmj=j; - beste=e; - } - } + } + // bui=0;buj=0; + // best mv masked destination + + vp8_makemask_sse3(dy + bui * dyp + buj, du + bui / 2 * duvp + buj / 2, dv + bui / 2 * duvp + buj / 2, + dym, dyp, duvp, + sgm[0].y, sgm[0].u, sgm[0].v, + sgm[0].yt, sgm[0].ut, sgm[0].vt); + + vp8_growmaskmb_sse3(dym, dym2); + + obeste = beste; + beste = 0xffffffff; + + // find best masked + for (i = -32; i < 32; i++) { + unsigned char *dyz = i * dyp + dy; + for (j = -32; j < 32; j++) { + e = vp8_sad16x16_masked_wmt(y, yp, dyz + j, dyp, dym2); + if (e < beste) { + bmi = i; + bmj = j; + beste = e; + } } - beste1=beste+obeste; - bmi1=bmi;bmj1=bmj; - bui1=bui;buj1=buj; - - // source mask - vp8_makemask_sse3(y,u, v, - ym, yp, uvp, - sgm[0].y,sgm[0].u,sgm[0].v, - sgm[0].yt,sgm[0].ut,sgm[0].vt); - - vp8_growmaskmb_sse3(ym,ym2); - - // find best mask - for(i=-32;i<32;i++) - { - unsigned char *dyz = i*dyp + dy; - unsigned char *duz = i/2*duvp + du; - unsigned char *dvz = i/2*duvp + dv; - for(j=-32;j<32;j++) - { - // 0,0 masked destination - vp8_makemask_sse3(dyz+j,duz+j/2, dvz+j/2, dym, dyp, duvp, - sgm[0].y,sgm[0].u,sgm[0].v, - sgm[0].yt,sgm[0].ut,sgm[0].vt); - - vp8_growmaskmb_sse3(dym,dym2); - - e = compare_masks(ym2, dym2); - - if(e<beste) - { - bmi=i; - bmj=j; - beste=e; - } - } + } + beste1 = beste + obeste; + bmi1 = bmi; + bmj1 = bmj; + bui1 = bui; + buj1 = buj; + + // source mask + vp8_makemask_sse3(y, u, v, + ym, yp, uvp, + sgm[0].y, sgm[0].u, sgm[0].v, + sgm[0].yt, sgm[0].ut, sgm[0].vt); + + vp8_growmaskmb_sse3(ym, ym2); + + // find best mask + for (i = -32; i < 32; i++) { + unsigned char *dyz = i * dyp + dy; + unsigned char *duz = i / 2 * duvp + du; + unsigned char *dvz = i / 2 * duvp + dv; + for (j = -32; j < 32; j++) { + // 0,0 masked destination + vp8_makemask_sse3(dyz + j, duz + j / 2, dvz + j / 2, dym, dyp, duvp, + sgm[0].y, sgm[0].u, sgm[0].v, + sgm[0].yt, sgm[0].ut, sgm[0].vt); + + vp8_growmaskmb_sse3(dym, dym2); + + e = compare_masks(ym2, dym2); + + if (e < beste) { + bmi = i; + bmj = j; + beste = e; + } } + } - vp8_makemask_sse3(dy+bmi*dyp+bmj,du+bmi/2*duvp+bmj/2, dv+bmi/2*duvp+bmj/2, - dym, dyp, duvp, - sgm[0].y,sgm[0].u,sgm[0].v, - sgm[0].yt,sgm[0].ut,sgm[0].vt); + vp8_makemask_sse3(dy + bmi * dyp + bmj, du + bmi / 2 * duvp + bmj / 2, dv + bmi / 2 * duvp + bmj / 2, + dym, dyp, duvp, + sgm[0].y, sgm[0].u, sgm[0].v, + sgm[0].yt, sgm[0].ut, sgm[0].vt); - vp8_growmaskmb_sse3(dym,dym2); + vp8_growmaskmb_sse3(dym, dym2); - obeste = vp8_sad16x16_masked_wmt(y, yp, dy+bmi*dyp+bmj, dyp, dym2 ); + obeste = vp8_sad16x16_masked_wmt(y, yp, dy + bmi * dyp + bmj, dyp, dym2); - beste = 0xffffffff; + beste = 0xffffffff; - // find best unmasked mv - for(i=-32;i<32;i++) - { - unsigned char *dyz = i*dyp + dy; - for(j=-32;j<32;j++) - { - e = vp8_sad16x16_unmasked_wmt(y, yp, dyz+j, dyp, dym2 ); - - if(e<beste) - { - bui=i; - buj=j; - beste=e; - } - } - } - beste += obeste; - - if(beste<beste1) - { - *mi = bmi; - *mj = bmj; - *ui = bui; - *uj = buj; - *wm = 1; - } - else - { - *mi = bmi1; - *mj = bmj1; - *ui = bui1; - *uj = buj1; - *wm = 0; - beste=beste1; + // find best unmasked mv + for (i = -32; i < 32; i++) { + unsigned char *dyz = i * dyp + dy; + for (j = -32; j < 32; j++) { + e = vp8_sad16x16_unmasked_wmt(y, yp, dyz + j, dyp, dym2); + if (e < beste) { + bui = i; + buj = j; + beste = e; + } } - return beste; + } + beste += obeste; + + if (beste < beste1) { + *mi = bmi; + *mj = bmj; + *ui = bui; + *uj = buj; + *wm = 1; + } else { + *mi = bmi1; + *mj = bmj1; + *ui = bui1; + *uj = buj1; + *wm = 0; + beste = beste1; + + } + return beste; } int predict_all(unsigned char *ym, unsigned char *um, unsigned char *vm, @@ -679,177 +628,179 @@ int predict_all(unsigned char *ym, unsigned char *um, unsigned char *vm, int mj, int ui, int uj, - int wm) -{ - int i,j; - unsigned char dym[256]; - unsigned char dym2[256]; - unsigned char duvm[64]; - unsigned char *yu=ym,*uu=um, *vu=vm; - - unsigned char *dym3=dym2; - - ym+=mi*ymp+mj; - um+=mi/2*uvmp+mj/2; - vm+=mi/2*uvmp+mj/2; - - yu+=ui*ymp+uj; - uu+=ui/2*uvmp+uj/2; - vu+=ui/2*uvmp+uj/2; - - // best mv masked destination - if(wm) - vp8_makemask_sse3(ym,um, vm, dym, ymp, uvmp, - sgm[0].y,sgm[0].u,sgm[0].v, - sgm[0].yt,sgm[0].ut,sgm[0].vt); - else - vp8_makemask_sse3(yu,uu, vu, dym, ymp, uvmp, - sgm[0].y,sgm[0].u,sgm[0].v, - sgm[0].yt,sgm[0].ut,sgm[0].vt); - - vp8_growmaskmb_sse3(dym,dym2); - vp8_masked_predictor_wmt(ym,yu,ymp,yp,ypp,dym3); - vp8_uv_from_y_mask(dym3,duvm); - vp8_masked_predictor_uv_wmt(um,uu,uvmp,up,uvpp,duvm); - vp8_masked_predictor_uv_wmt(vm,vu,uvmp,vp,uvpp,duvm); - - return 0; + int wm) { + int i, j; + unsigned char dym[256]; + unsigned char dym2[256]; + unsigned char duvm[64]; + unsigned char *yu = ym, *uu = um, *vu = vm; + + unsigned char *dym3 = dym2; + + ym += mi * ymp + mj; + um += mi / 2 * uvmp + mj / 2; + vm += mi / 2 * uvmp + mj / 2; + + yu += ui * ymp + uj; + uu += ui / 2 * uvmp + uj / 2; + vu += ui / 2 * uvmp + uj / 2; + + // best mv masked destination + if (wm) + vp8_makemask_sse3(ym, um, vm, dym, ymp, uvmp, + sgm[0].y, sgm[0].u, sgm[0].v, + sgm[0].yt, sgm[0].ut, sgm[0].vt); + else + vp8_makemask_sse3(yu, uu, vu, dym, ymp, uvmp, + sgm[0].y, sgm[0].u, sgm[0].v, + sgm[0].yt, sgm[0].ut, sgm[0].vt); + + vp8_growmaskmb_sse3(dym, dym2); + vp8_masked_predictor_wmt(ym, yu, ymp, yp, ypp, dym3); + vp8_uv_from_y_mask(dym3, duvm); + vp8_masked_predictor_uv_wmt(um, uu, uvmp, up, uvpp, duvm); + vp8_masked_predictor_uv_wmt(vm, vu, uvmp, vp, uvpp, duvm); + + return 0; } -unsigned char f0p[1280*720*3/2]; -unsigned char f1p[1280*720*3/2]; -unsigned char prd[1280*720*3/2]; -unsigned char msk[1280*720*3/2]; +unsigned char f0p[1280 * 720 * 3 / 2]; +unsigned char f1p[1280 * 720 * 3 / 2]; +unsigned char prd[1280 * 720 * 3 / 2]; +unsigned char msk[1280 * 720 * 3 / 2]; int mainz(int argc, char *argv[]) { - FILE *f=fopen(argv[1],"rb"); - FILE *g=fopen(argv[2],"wb"); - int w=atoi(argv[3]),h=atoi(argv[4]); - int y_stride=w,uv_stride=w/2; - int r,c; - unsigned char *f0=f0p,*f1=f1p,*t; - unsigned char ym[256],uvm[64]; - unsigned char ym2[256],uvm2[64]; - unsigned char ym3[256],uvm3[64]; - int a,b; - - COLOR_SEG_ELEMENT last={ 20,20,20,20, 230,20, 1},best; + FILE *f = fopen(argv[1], "rb"); + FILE *g = fopen(argv[2], "wb"); + int w = atoi(argv[3]), h = atoi(argv[4]); + int y_stride = w, uv_stride = w / 2; + int r, c; + unsigned char *f0 = f0p, *f1 = f1p, *t; + unsigned char ym[256], uvm[64]; + unsigned char ym2[256], uvm2[64]; + unsigned char ym3[256], uvm3[64]; + int a, b; + + COLOR_SEG_ELEMENT last = { 20, 20, 20, 20, 230, 20, 1}, best; #if 0 - makeneighbors(); - COLOR_SEG_ELEMENT segmentation[]= - { - { 60,4,80,17,80,10, 1}, - { 40,4,15,10,80,10, 1}, - }; - make_mb_mask(y, u, v,ym2,uvm2,16,8,segmentation,1); + makeneighbors(); + COLOR_SEG_ELEMENT segmentation[] = { + { 60, 4, 80, 17, 80, 10, 1}, + { 40, 4, 15, 10, 80, 10, 1}, + }; + make_mb_mask(y, u, v, ym2, uvm2, 16, 8, segmentation, 1); - vp8_makemask_sse3(y,u,v,ym, (int) 16,(int) 8, - (int) segmentation[0].y,(int) segmentation[0].u,(int) segmentation[0].v, - segmentation[0].yt,segmentation[0].ut,segmentation[0].vt); + vp8_makemask_sse3(y, u, v, ym, (int) 16, (int) 8, + (int) segmentation[0].y, (int) segmentation[0].u, (int) segmentation[0].v, + segmentation[0].yt, segmentation[0].ut, segmentation[0].vt); - vp8_growmaskmb_sse3(ym,ym3); + vp8_growmaskmb_sse3(ym, ym3); - a = vp8_sad16x16_masked_wmt(str,16,sts,16,ym3); - b = vp8_sad16x16_unmasked_wmt(str,16,sts,16,ym3); + a = vp8_sad16x16_masked_wmt(str, 16, sts, 16, ym3); + b = vp8_sad16x16_unmasked_wmt(str, 16, sts, 16, ym3); - vp8_masked_predictor_wmt(str,sts,16,ym,16,ym3); + vp8_masked_predictor_wmt(str, sts, 16, ym, 16, ym3); - vp8_uv_from_y_mask(ym3,uvm3); + vp8_uv_from_y_mask(ym3, uvm3); - return 4; + return 4; #endif - makeneighbors(); - - - memset(prd,128,w*h*3/2); - - fread(f0,w*h*3/2,1,f); - - while(!feof(f)) - { - unsigned char *ys=f1,*yd=f0,*yp=prd; - unsigned char *us=f1+w*h,*ud=f0+w*h,*up=prd+w*h; - unsigned char *vs=f1+w*h*5/4,*vd=f0+w*h*5/4,*vp=prd+w*h*5/4; - fread(f1,w*h*3/2,1,f); - - ys+=32*y_stride;yd+=32*y_stride;yp+=32*y_stride; - us+=16*uv_stride;ud+=16*uv_stride;up+=16*uv_stride; - vs+=16*uv_stride;vd+=16*uv_stride;vp+=16*uv_stride; - for(r=32;r<h-32;r+=16, - ys+=16*w,yd+=16*w,yp+=16*w, - us+=8*uv_stride,ud+=8*uv_stride,up+=8*uv_stride, - vs+=8*uv_stride,vd+=8*uv_stride,vp+=8*uv_stride) - { - for(c=32;c<w-32;c+=16) - { - int mi,mj,ui,uj,wm; - int bmi,bmj,bui,buj,bwm; - unsigned char ym[256]; - - if(vp8_sad16x16_sse3( ys+c,y_stride, yd+c,y_stride,0xffff) == 0) - bmi=bmj=bui=buj=bwm=0; - else - { - COLOR_SEG_ELEMENT cs[5]; - int j; - unsigned int beste=0xfffffff; - unsigned int bestj=0; - - // try color from last mb segmentation - cs[0] = last; - - // try color segs from 4 pixels in mb recon as segmentation - cs[1].y = yd[c + y_stride + 1];cs[1].u = ud[c/2 + uv_stride]; - cs[1].v = vd[c/2 + uv_stride]; - cs[1].yt = cs[1].ut = cs[1].vt = 20; - cs[2].y = yd[c + w + 14]; - cs[2].u = ud[c/2 + uv_stride+7]; - cs[2].v = vd[c/2 + uv_stride+7]; - cs[2].yt = cs[2].ut = cs[2].vt = 20; - cs[3].y = yd[c + w*14 + 1]; - cs[3].u = ud[c/2 + uv_stride*7]; - cs[3].v = vd[c/2 + uv_stride*7]; - cs[3].yt = cs[3].ut = cs[3].vt = 20; - cs[4].y = yd[c + w*14 + 14]; - cs[4].u = ud[c/2 + uv_stride*7+7]; - cs[4].v = vd[c/2 + uv_stride*7+7]; - cs[4].yt = cs[4].ut = cs[4].vt = 20; - - for(j=0;j<5;j++) - { - int e; - - e = fast_masked_motion_search( - ys+c, us+c/2, vs+c/2, y_stride, uv_stride, - yd+c, ud+c/2, vd+c/2, y_stride, uv_stride, - &cs[j], 1, &mi,&mj,&ui,&uj,&wm); - - if(e<beste) - { - bmi=mi;bmj=mj;bui=ui;buj=uj,bwm=wm; - bestj=j; - beste=e; - } - } - best = cs[bestj]; - //best = segmentation[0]; - last = best; - } - predict_all(yd+c, ud+c/2, vd+c/2, w, uv_stride, - yp+c, up+c/2, vp+c/2, w, uv_stride, - &best, 1, bmi,bmj,bui,buj,bwm); - + makeneighbors(); + + + memset(prd, 128, w * h * 3 / 2); + + fread(f0, w * h * 3 / 2, 1, f); + + while (!feof(f)) { + unsigned char *ys = f1, *yd = f0, *yp = prd; + unsigned char *us = f1 + w * h, *ud = f0 + w * h, *up = prd + w * h; + unsigned char *vs = f1 + w * h * 5 / 4, *vd = f0 + w * h * 5 / 4, *vp = prd + w * h * 5 / 4; + fread(f1, w * h * 3 / 2, 1, f); + + ys += 32 * y_stride; + yd += 32 * y_stride; + yp += 32 * y_stride; + us += 16 * uv_stride; + ud += 16 * uv_stride; + up += 16 * uv_stride; + vs += 16 * uv_stride; + vd += 16 * uv_stride; + vp += 16 * uv_stride; + for (r = 32; r < h - 32; r += 16, + ys += 16 * w, yd += 16 * w, yp += 16 * w, + us += 8 * uv_stride, ud += 8 * uv_stride, up += 8 * uv_stride, + vs += 8 * uv_stride, vd += 8 * uv_stride, vp += 8 * uv_stride) { + for (c = 32; c < w - 32; c += 16) { + int mi, mj, ui, uj, wm; + int bmi, bmj, bui, buj, bwm; + unsigned char ym[256]; + + if (vp8_sad16x16_sse3(ys + c, y_stride, yd + c, y_stride, 0xffff) == 0) + bmi = bmj = bui = buj = bwm = 0; + else { + COLOR_SEG_ELEMENT cs[5]; + int j; + unsigned int beste = 0xfffffff; + unsigned int bestj = 0; + + // try color from last mb segmentation + cs[0] = last; + + // try color segs from 4 pixels in mb recon as segmentation + cs[1].y = yd[c + y_stride + 1]; + cs[1].u = ud[c / 2 + uv_stride]; + cs[1].v = vd[c / 2 + uv_stride]; + cs[1].yt = cs[1].ut = cs[1].vt = 20; + cs[2].y = yd[c + w + 14]; + cs[2].u = ud[c / 2 + uv_stride + 7]; + cs[2].v = vd[c / 2 + uv_stride + 7]; + cs[2].yt = cs[2].ut = cs[2].vt = 20; + cs[3].y = yd[c + w * 14 + 1]; + cs[3].u = ud[c / 2 + uv_stride * 7]; + cs[3].v = vd[c / 2 + uv_stride * 7]; + cs[3].yt = cs[3].ut = cs[3].vt = 20; + cs[4].y = yd[c + w * 14 + 14]; + cs[4].u = ud[c / 2 + uv_stride * 7 + 7]; + cs[4].v = vd[c / 2 + uv_stride * 7 + 7]; + cs[4].yt = cs[4].ut = cs[4].vt = 20; + + for (j = 0; j < 5; j++) { + int e; + + e = fast_masked_motion_search( + ys + c, us + c / 2, vs + c / 2, y_stride, uv_stride, + yd + c, ud + c / 2, vd + c / 2, y_stride, uv_stride, + &cs[j], 1, &mi, &mj, &ui, &uj, &wm); + + if (e < beste) { + bmi = mi; + bmj = mj; + bui = ui; + buj = uj, bwm = wm; + bestj = j; + beste = e; } + } + best = cs[bestj]; + // best = segmentation[0]; + last = best; } - fwrite(prd,w*h*3/2,1,g); - t=f0; - f0=f1; - f1=t; + predict_all(yd + c, ud + c / 2, vd + c / 2, w, uv_stride, + yp + c, up + c / 2, vp + c / 2, w, uv_stride, + &best, 1, bmi, bmj, bui, buj, bwm); + } } - fclose(f); - fclose(g); - return; + fwrite(prd, w * h * 3 / 2, 1, g); + t = f0; + f0 = f1; + f1 = t; + + } + fclose(f); + fclose(g); + return; } diff --git a/vp8/common/mbpitch.c b/vp8/common/mbpitch.c index b23cbbe2c..1a8431742 100644 --- a/vp8/common/mbpitch.c +++ b/vp8/common/mbpitch.c @@ -11,127 +11,107 @@ #include "blockd.h" -typedef enum -{ - PRED = 0, - DEST = 1 +typedef enum { + PRED = 0, + DEST = 1 } BLOCKSET; static void setup_block ( - BLOCKD *b, - int mv_stride, - unsigned char **base, - unsigned char **base2, - int Stride, - int offset, - BLOCKSET bs -) -{ - - if (bs == DEST) - { - b->dst_stride = Stride; - b->dst = offset; - b->base_dst = base; - } - else - { - b->pre_stride = Stride; - b->pre = offset; - b->base_pre = base; - b->base_second_pre = base2; - } + BLOCKD *b, + int mv_stride, + unsigned char **base, + unsigned char **base2, + int Stride, + int offset, + BLOCKSET bs +) { + + if (bs == DEST) { + b->dst_stride = Stride; + b->dst = offset; + b->base_dst = base; + } else { + b->pre_stride = Stride; + b->pre = offset; + b->base_pre = base; + b->base_second_pre = base2; + } } -static void setup_macroblock(MACROBLOCKD *x, BLOCKSET bs) -{ - int block; +static void setup_macroblock(MACROBLOCKD *x, BLOCKSET bs) { + int block; - unsigned char **y, **u, **v; - unsigned char **y2, **u2, **v2; + unsigned char **y, **u, **v; + unsigned char **y2, **u2, **v2; - if (bs == DEST) - { - y = &x->dst.y_buffer; - u = &x->dst.u_buffer; - v = &x->dst.v_buffer; - } - else - { - y = &x->pre.y_buffer; - u = &x->pre.u_buffer; - v = &x->pre.v_buffer; - - y2 = &x->second_pre.y_buffer; - u2 = &x->second_pre.u_buffer; - v2 = &x->second_pre.v_buffer; - } + if (bs == DEST) { + y = &x->dst.y_buffer; + u = &x->dst.u_buffer; + v = &x->dst.v_buffer; + } else { + y = &x->pre.y_buffer; + u = &x->pre.u_buffer; + v = &x->pre.v_buffer; - for (block = 0; block < 16; block++) /* y blocks */ - { - setup_block(&x->block[block], x->dst.y_stride, y, y2, x->dst.y_stride, - (block >> 2) * 4 * x->dst.y_stride + (block & 3) * 4, bs); - } + y2 = &x->second_pre.y_buffer; + u2 = &x->second_pre.u_buffer; + v2 = &x->second_pre.v_buffer; + } - for (block = 16; block < 20; block++) /* U and V blocks */ - { - setup_block(&x->block[block], x->dst.uv_stride, u, u2, x->dst.uv_stride, - ((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4, bs); + for (block = 0; block < 16; block++) { /* y blocks */ + setup_block(&x->block[block], x->dst.y_stride, y, y2, x->dst.y_stride, + (block >> 2) * 4 * x->dst.y_stride + (block & 3) * 4, bs); + } - setup_block(&x->block[block+4], x->dst.uv_stride, v, v2, x->dst.uv_stride, - ((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4, bs); - } + for (block = 16; block < 20; block++) { /* U and V blocks */ + setup_block(&x->block[block], x->dst.uv_stride, u, u2, x->dst.uv_stride, + ((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4, bs); + + setup_block(&x->block[block + 4], x->dst.uv_stride, v, v2, x->dst.uv_stride, + ((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4, bs); + } } -void vp8_setup_block_dptrs(MACROBLOCKD *x) -{ - int r, c; - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - x->block[r*4+c].diff = &x->diff[r * 4 * 16 + c * 4]; - x->block[r*4+c].predictor = x->predictor + r * 4 * 16 + c * 4; - } +void vp8_setup_block_dptrs(MACROBLOCKD *x) { + int r, c; + + for (r = 0; r < 4; r++) { + for (c = 0; c < 4; c++) { + x->block[r * 4 + c].diff = &x->diff[r * 4 * 16 + c * 4]; + x->block[r * 4 + c].predictor = x->predictor + r * 4 * 16 + c * 4; } + } - for (r = 0; r < 2; r++) - { - for (c = 0; c < 2; c++) - { - x->block[16+r*2+c].diff = &x->diff[256 + r * 4 * 8 + c * 4]; - x->block[16+r*2+c].predictor = x->predictor + 256 + r * 4 * 8 + c * 4; + for (r = 0; r < 2; r++) { + for (c = 0; c < 2; c++) { + x->block[16 + r * 2 + c].diff = &x->diff[256 + r * 4 * 8 + c * 4]; + x->block[16 + r * 2 + c].predictor = x->predictor + 256 + r * 4 * 8 + c * 4; - } } + } - for (r = 0; r < 2; r++) - { - for (c = 0; c < 2; c++) - { - x->block[20+r*2+c].diff = &x->diff[320+ r * 4 * 8 + c * 4]; - x->block[20+r*2+c].predictor = x->predictor + 320 + r * 4 * 8 + c * 4; + for (r = 0; r < 2; r++) { + for (c = 0; c < 2; c++) { + x->block[20 + r * 2 + c].diff = &x->diff[320 + r * 4 * 8 + c * 4]; + x->block[20 + r * 2 + c].predictor = x->predictor + 320 + r * 4 * 8 + c * 4; - } } + } - x->block[24].diff = &x->diff[384]; + x->block[24].diff = &x->diff[384]; - for (r = 0; r < 25; r++) - { - x->block[r].qcoeff = x->qcoeff + r * 16; - x->block[r].dqcoeff = x->dqcoeff + r * 16; - } + for (r = 0; r < 25; r++) { + x->block[r].qcoeff = x->qcoeff + r * 16; + x->block[r].dqcoeff = x->dqcoeff + r * 16; + } } -void vp8_build_block_doffsets(MACROBLOCKD *x) -{ +void vp8_build_block_doffsets(MACROBLOCKD *x) { - /* handle the destination pitch features */ - setup_macroblock(x, DEST); - setup_macroblock(x, PRED); + /* handle the destination pitch features */ + setup_macroblock(x, DEST); + setup_macroblock(x, PRED); } diff --git a/vp8/common/modecont.c b/vp8/common/modecont.c index d80e16ee5..5995f5732 100644 --- a/vp8/common/modecont.c +++ b/vp8/common/modecont.c @@ -10,33 +10,55 @@ #include "entropy.h" -const int default_vp8_mode_contexts[6][4] = -{ - { /* 0 */ - 7, 1, 1, 183}, - { /* 1 */ - 14, 18, 14, 147}, - {/* 2 */ - 135, 64, 57, 68}, - { /* 3 */ - 60, 56, 128, 65}, - {/* 4 */ - 159, 134, 128, 34}, - { /* 5 */ - 234, 188, 128, 28}, +const int default_vp8_mode_contexts[6][4] = { + { + /* 0 */ + 7, 1, 1, 183 + }, + { + /* 1 */ + 14, 18, 14, 147 + }, + { + /* 2 */ + 135, 64, 57, 68 + }, + { + /* 3 */ + 60, 56, 128, 65 + }, + { + /* 4 */ + 159, 134, 128, 34 + }, + { + /* 5 */ + 234, 188, 128, 28 + }, }; -const int default_vp8_mode_contexts_a[6][4] = -{ - { /* 0 */ - 4, 1, 1, 143}, - { /* 1 */ - 7, 9, 7, 107}, - {/* 2 */ - 95, 34, 57, 68}, - { /* 3 */ - 95, 56, 128, 65}, - {/* 4 */ - 159, 67, 128, 34}, - { /* 5 */ - 234, 94, 128, 28}, +const int default_vp8_mode_contexts_a[6][4] = { + { + /* 0 */ + 4, 1, 1, 143 + }, + { + /* 1 */ + 7, 9, 7, 107 + }, + { + /* 2 */ + 95, 34, 57, 68 + }, + { + /* 3 */ + 95, 56, 128, 65 + }, + { + /* 4 */ + 159, 67, 128, 34 + }, + { + /* 5 */ + 234, 94, 128, 28 + }, }; diff --git a/vp8/common/modecontext.c b/vp8/common/modecontext.c index a31a561c8..47b4596ed 100644 --- a/vp8/common/modecontext.c +++ b/vp8/common/modecontext.c @@ -11,136 +11,135 @@ #include "entropymode.h" -const unsigned int vp8_kf_default_bmode_counts [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES] = -{ - { - /*Above Mode : 0*/ - { 43438, 2195, 470, 316, 615, 171, 217, 412, 124, 160, }, /* left_mode 0 */ - { 5722, 2751, 296, 291, 81, 68, 80, 101, 100, 170, }, /* left_mode 1 */ - { 1629, 201, 307, 25, 47, 16, 34, 72, 19, 28, }, /* left_mode 2 */ - { 332, 266, 36, 500, 20, 65, 23, 14, 154, 106, }, /* left_mode 3 */ - { 450, 97, 10, 24, 117, 10, 2, 12, 8, 71, }, /* left_mode 4 */ - { 384, 49, 29, 44, 12, 162, 51, 5, 87, 42, }, /* left_mode 5 */ - { 495, 53, 157, 27, 14, 57, 180, 17, 17, 34, }, /* left_mode 6 */ - { 695, 64, 62, 9, 27, 5, 3, 147, 10, 26, }, /* left_mode 7 */ - { 230, 54, 20, 124, 16, 125, 29, 12, 283, 37, }, /* left_mode 8 */ - { 260, 87, 21, 120, 32, 16, 33, 16, 33, 203, }, /* left_mode 9 */ - }, - { - /*Above Mode : 1*/ - { 3934, 2573, 355, 137, 128, 87, 133, 117, 37, 27, }, /* left_mode 0 */ - { 1036, 1929, 278, 135, 27, 37, 48, 55, 41, 91, }, /* left_mode 1 */ - { 223, 256, 253, 15, 13, 9, 28, 64, 3, 3, }, /* left_mode 2 */ - { 120, 129, 17, 316, 15, 11, 9, 4, 53, 74, }, /* left_mode 3 */ - { 129, 58, 6, 11, 38, 2, 0, 5, 2, 67, }, /* left_mode 4 */ - { 53, 22, 11, 16, 8, 26, 14, 3, 19, 12, }, /* left_mode 5 */ - { 59, 26, 61, 11, 4, 9, 35, 13, 8, 8, }, /* left_mode 6 */ - { 101, 52, 40, 8, 5, 2, 8, 59, 2, 20, }, /* left_mode 7 */ - { 48, 34, 10, 52, 8, 15, 6, 6, 63, 20, }, /* left_mode 8 */ - { 96, 48, 22, 63, 11, 14, 5, 8, 9, 96, }, /* left_mode 9 */ - }, - { - /*Above Mode : 2*/ - { 709, 461, 506, 36, 27, 33, 151, 98, 24, 6, }, /* left_mode 0 */ - { 201, 375, 442, 27, 13, 8, 46, 58, 6, 19, }, /* left_mode 1 */ - { 122, 140, 417, 4, 13, 3, 33, 59, 4, 2, }, /* left_mode 2 */ - { 36, 17, 22, 16, 6, 8, 12, 17, 9, 21, }, /* left_mode 3 */ - { 51, 15, 7, 1, 14, 0, 4, 5, 3, 22, }, /* left_mode 4 */ - { 18, 11, 30, 9, 7, 20, 11, 5, 2, 6, }, /* left_mode 5 */ - { 38, 21, 103, 9, 4, 12, 79, 13, 2, 5, }, /* left_mode 6 */ - { 64, 17, 66, 2, 12, 4, 2, 65, 4, 5, }, /* left_mode 7 */ - { 14, 7, 7, 16, 3, 11, 4, 13, 15, 16, }, /* left_mode 8 */ - { 36, 8, 32, 9, 9, 4, 14, 7, 6, 24, }, /* left_mode 9 */ - }, - { - /*Above Mode : 3*/ - { 1340, 173, 36, 119, 30, 10, 13, 10, 20, 26, }, /* left_mode 0 */ - { 156, 293, 26, 108, 5, 16, 2, 4, 23, 30, }, /* left_mode 1 */ - { 60, 34, 13, 7, 3, 3, 0, 8, 4, 5, }, /* left_mode 2 */ - { 72, 64, 1, 235, 3, 9, 2, 7, 28, 38, }, /* left_mode 3 */ - { 29, 14, 1, 3, 5, 0, 2, 2, 5, 13, }, /* left_mode 4 */ - { 22, 7, 4, 11, 2, 5, 1, 2, 6, 4, }, /* left_mode 5 */ - { 18, 14, 5, 6, 4, 3, 14, 0, 9, 2, }, /* left_mode 6 */ - { 41, 10, 7, 1, 2, 0, 0, 10, 2, 1, }, /* left_mode 7 */ - { 23, 19, 2, 33, 1, 5, 2, 0, 51, 8, }, /* left_mode 8 */ - { 33, 26, 7, 53, 3, 9, 3, 3, 9, 19, }, /* left_mode 9 */ - }, - { - /*Above Mode : 4*/ - { 410, 165, 43, 31, 66, 15, 30, 54, 8, 17, }, /* left_mode 0 */ - { 115, 64, 27, 18, 30, 7, 11, 15, 4, 19, }, /* left_mode 1 */ - { 31, 23, 25, 1, 7, 2, 2, 10, 0, 5, }, /* left_mode 2 */ - { 17, 4, 1, 6, 8, 2, 7, 5, 5, 21, }, /* left_mode 3 */ - { 120, 12, 1, 2, 83, 3, 0, 4, 1, 40, }, /* left_mode 4 */ - { 4, 3, 1, 2, 1, 2, 5, 0, 3, 6, }, /* left_mode 5 */ - { 10, 2, 13, 6, 6, 6, 8, 2, 4, 5, }, /* left_mode 6 */ - { 58, 10, 5, 1, 28, 1, 1, 33, 1, 9, }, /* left_mode 7 */ - { 8, 2, 1, 4, 2, 5, 1, 1, 2, 10, }, /* left_mode 8 */ - { 76, 7, 5, 7, 18, 2, 2, 0, 5, 45, }, /* left_mode 9 */ - }, - { - /*Above Mode : 5*/ - { 444, 46, 47, 20, 14, 110, 60, 14, 60, 7, }, /* left_mode 0 */ - { 59, 57, 25, 18, 3, 17, 21, 6, 14, 6, }, /* left_mode 1 */ - { 24, 17, 20, 6, 4, 13, 7, 2, 3, 2, }, /* left_mode 2 */ - { 13, 11, 5, 14, 4, 9, 2, 4, 15, 7, }, /* left_mode 3 */ - { 8, 5, 2, 1, 4, 0, 1, 1, 2, 12, }, /* left_mode 4 */ - { 19, 5, 5, 7, 4, 40, 6, 3, 10, 4, }, /* left_mode 5 */ - { 16, 5, 9, 1, 1, 16, 26, 2, 10, 4, }, /* left_mode 6 */ - { 11, 4, 8, 1, 1, 4, 4, 5, 4, 1, }, /* left_mode 7 */ - { 15, 1, 3, 7, 3, 21, 7, 1, 34, 5, }, /* left_mode 8 */ - { 18, 5, 1, 3, 4, 3, 7, 1, 2, 9, }, /* left_mode 9 */ - }, - { - /*Above Mode : 6*/ - { 476, 149, 94, 13, 14, 77, 291, 27, 23, 3, }, /* left_mode 0 */ - { 79, 83, 42, 14, 2, 12, 63, 2, 4, 14, }, /* left_mode 1 */ - { 43, 36, 55, 1, 3, 8, 42, 11, 5, 1, }, /* left_mode 2 */ - { 9, 9, 6, 16, 1, 5, 6, 3, 11, 10, }, /* left_mode 3 */ - { 10, 3, 1, 3, 10, 1, 0, 1, 1, 4, }, /* left_mode 4 */ - { 14, 6, 15, 5, 1, 20, 25, 2, 5, 0, }, /* left_mode 5 */ - { 28, 7, 51, 1, 0, 8, 127, 6, 2, 5, }, /* left_mode 6 */ - { 13, 3, 3, 2, 3, 1, 2, 8, 1, 2, }, /* left_mode 7 */ - { 10, 3, 3, 3, 3, 8, 2, 2, 9, 3, }, /* left_mode 8 */ - { 13, 7, 11, 4, 0, 4, 6, 2, 5, 8, }, /* left_mode 9 */ - }, - { - /*Above Mode : 7*/ - { 376, 135, 119, 6, 32, 8, 31, 224, 9, 3, }, /* left_mode 0 */ - { 93, 60, 54, 6, 13, 7, 8, 92, 2, 12, }, /* left_mode 1 */ - { 74, 36, 84, 0, 3, 2, 9, 67, 2, 1, }, /* left_mode 2 */ - { 19, 4, 4, 8, 8, 2, 4, 7, 6, 16, }, /* left_mode 3 */ - { 51, 7, 4, 1, 77, 3, 0, 14, 1, 15, }, /* left_mode 4 */ - { 7, 7, 5, 7, 4, 7, 4, 5, 0, 3, }, /* left_mode 5 */ - { 18, 2, 19, 2, 2, 4, 12, 11, 1, 2, }, /* left_mode 6 */ - { 129, 6, 27, 1, 21, 3, 0, 189, 0, 6, }, /* left_mode 7 */ - { 9, 1, 2, 8, 3, 7, 0, 5, 3, 3, }, /* left_mode 8 */ - { 20, 4, 5, 10, 4, 2, 7, 17, 3, 16, }, /* left_mode 9 */ - }, - { - /*Above Mode : 8*/ - { 617, 68, 34, 79, 11, 27, 25, 14, 75, 13, }, /* left_mode 0 */ - { 51, 82, 21, 26, 6, 12, 13, 1, 26, 16, }, /* left_mode 1 */ - { 29, 9, 12, 11, 3, 7, 1, 10, 2, 2, }, /* left_mode 2 */ - { 17, 19, 11, 74, 4, 3, 2, 0, 58, 13, }, /* left_mode 3 */ - { 10, 1, 1, 3, 4, 1, 0, 2, 1, 8, }, /* left_mode 4 */ - { 14, 4, 5, 5, 1, 13, 2, 0, 27, 8, }, /* left_mode 5 */ - { 10, 3, 5, 4, 1, 7, 6, 4, 5, 1, }, /* left_mode 6 */ - { 10, 2, 6, 2, 1, 1, 1, 4, 2, 1, }, /* left_mode 7 */ - { 14, 8, 5, 23, 2, 12, 6, 2, 117, 5, }, /* left_mode 8 */ - { 9, 6, 2, 19, 1, 6, 3, 2, 9, 9, }, /* left_mode 9 */ - }, - { - /*Above Mode : 9*/ - { 680, 73, 22, 38, 42, 5, 11, 9, 6, 28, }, /* left_mode 0 */ - { 113, 112, 21, 22, 10, 2, 8, 4, 6, 42, }, /* left_mode 1 */ - { 44, 20, 24, 6, 5, 4, 3, 3, 1, 2, }, /* left_mode 2 */ - { 40, 23, 7, 71, 5, 2, 4, 1, 7, 22, }, /* left_mode 3 */ - { 85, 9, 4, 4, 17, 2, 0, 3, 2, 23, }, /* left_mode 4 */ - { 13, 4, 2, 6, 1, 7, 0, 1, 7, 6, }, /* left_mode 5 */ - { 26, 6, 8, 3, 2, 3, 8, 1, 5, 4, }, /* left_mode 6 */ - { 54, 8, 9, 6, 7, 0, 1, 11, 1, 3, }, /* left_mode 7 */ - { 9, 10, 4, 13, 2, 5, 4, 2, 14, 8, }, /* left_mode 8 */ - { 92, 9, 5, 19, 15, 3, 3, 1, 6, 58, }, /* left_mode 9 */ - }, +const unsigned int vp8_kf_default_bmode_counts [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES] = { + { + /*Above Mode : 0*/ + { 43438, 2195, 470, 316, 615, 171, 217, 412, 124, 160, }, /* left_mode 0 */ + { 5722, 2751, 296, 291, 81, 68, 80, 101, 100, 170, }, /* left_mode 1 */ + { 1629, 201, 307, 25, 47, 16, 34, 72, 19, 28, }, /* left_mode 2 */ + { 332, 266, 36, 500, 20, 65, 23, 14, 154, 106, }, /* left_mode 3 */ + { 450, 97, 10, 24, 117, 10, 2, 12, 8, 71, }, /* left_mode 4 */ + { 384, 49, 29, 44, 12, 162, 51, 5, 87, 42, }, /* left_mode 5 */ + { 495, 53, 157, 27, 14, 57, 180, 17, 17, 34, }, /* left_mode 6 */ + { 695, 64, 62, 9, 27, 5, 3, 147, 10, 26, }, /* left_mode 7 */ + { 230, 54, 20, 124, 16, 125, 29, 12, 283, 37, }, /* left_mode 8 */ + { 260, 87, 21, 120, 32, 16, 33, 16, 33, 203, }, /* left_mode 9 */ + }, + { + /*Above Mode : 1*/ + { 3934, 2573, 355, 137, 128, 87, 133, 117, 37, 27, }, /* left_mode 0 */ + { 1036, 1929, 278, 135, 27, 37, 48, 55, 41, 91, }, /* left_mode 1 */ + { 223, 256, 253, 15, 13, 9, 28, 64, 3, 3, }, /* left_mode 2 */ + { 120, 129, 17, 316, 15, 11, 9, 4, 53, 74, }, /* left_mode 3 */ + { 129, 58, 6, 11, 38, 2, 0, 5, 2, 67, }, /* left_mode 4 */ + { 53, 22, 11, 16, 8, 26, 14, 3, 19, 12, }, /* left_mode 5 */ + { 59, 26, 61, 11, 4, 9, 35, 13, 8, 8, }, /* left_mode 6 */ + { 101, 52, 40, 8, 5, 2, 8, 59, 2, 20, }, /* left_mode 7 */ + { 48, 34, 10, 52, 8, 15, 6, 6, 63, 20, }, /* left_mode 8 */ + { 96, 48, 22, 63, 11, 14, 5, 8, 9, 96, }, /* left_mode 9 */ + }, + { + /*Above Mode : 2*/ + { 709, 461, 506, 36, 27, 33, 151, 98, 24, 6, }, /* left_mode 0 */ + { 201, 375, 442, 27, 13, 8, 46, 58, 6, 19, }, /* left_mode 1 */ + { 122, 140, 417, 4, 13, 3, 33, 59, 4, 2, }, /* left_mode 2 */ + { 36, 17, 22, 16, 6, 8, 12, 17, 9, 21, }, /* left_mode 3 */ + { 51, 15, 7, 1, 14, 0, 4, 5, 3, 22, }, /* left_mode 4 */ + { 18, 11, 30, 9, 7, 20, 11, 5, 2, 6, }, /* left_mode 5 */ + { 38, 21, 103, 9, 4, 12, 79, 13, 2, 5, }, /* left_mode 6 */ + { 64, 17, 66, 2, 12, 4, 2, 65, 4, 5, }, /* left_mode 7 */ + { 14, 7, 7, 16, 3, 11, 4, 13, 15, 16, }, /* left_mode 8 */ + { 36, 8, 32, 9, 9, 4, 14, 7, 6, 24, }, /* left_mode 9 */ + }, + { + /*Above Mode : 3*/ + { 1340, 173, 36, 119, 30, 10, 13, 10, 20, 26, }, /* left_mode 0 */ + { 156, 293, 26, 108, 5, 16, 2, 4, 23, 30, }, /* left_mode 1 */ + { 60, 34, 13, 7, 3, 3, 0, 8, 4, 5, }, /* left_mode 2 */ + { 72, 64, 1, 235, 3, 9, 2, 7, 28, 38, }, /* left_mode 3 */ + { 29, 14, 1, 3, 5, 0, 2, 2, 5, 13, }, /* left_mode 4 */ + { 22, 7, 4, 11, 2, 5, 1, 2, 6, 4, }, /* left_mode 5 */ + { 18, 14, 5, 6, 4, 3, 14, 0, 9, 2, }, /* left_mode 6 */ + { 41, 10, 7, 1, 2, 0, 0, 10, 2, 1, }, /* left_mode 7 */ + { 23, 19, 2, 33, 1, 5, 2, 0, 51, 8, }, /* left_mode 8 */ + { 33, 26, 7, 53, 3, 9, 3, 3, 9, 19, }, /* left_mode 9 */ + }, + { + /*Above Mode : 4*/ + { 410, 165, 43, 31, 66, 15, 30, 54, 8, 17, }, /* left_mode 0 */ + { 115, 64, 27, 18, 30, 7, 11, 15, 4, 19, }, /* left_mode 1 */ + { 31, 23, 25, 1, 7, 2, 2, 10, 0, 5, }, /* left_mode 2 */ + { 17, 4, 1, 6, 8, 2, 7, 5, 5, 21, }, /* left_mode 3 */ + { 120, 12, 1, 2, 83, 3, 0, 4, 1, 40, }, /* left_mode 4 */ + { 4, 3, 1, 2, 1, 2, 5, 0, 3, 6, }, /* left_mode 5 */ + { 10, 2, 13, 6, 6, 6, 8, 2, 4, 5, }, /* left_mode 6 */ + { 58, 10, 5, 1, 28, 1, 1, 33, 1, 9, }, /* left_mode 7 */ + { 8, 2, 1, 4, 2, 5, 1, 1, 2, 10, }, /* left_mode 8 */ + { 76, 7, 5, 7, 18, 2, 2, 0, 5, 45, }, /* left_mode 9 */ + }, + { + /*Above Mode : 5*/ + { 444, 46, 47, 20, 14, 110, 60, 14, 60, 7, }, /* left_mode 0 */ + { 59, 57, 25, 18, 3, 17, 21, 6, 14, 6, }, /* left_mode 1 */ + { 24, 17, 20, 6, 4, 13, 7, 2, 3, 2, }, /* left_mode 2 */ + { 13, 11, 5, 14, 4, 9, 2, 4, 15, 7, }, /* left_mode 3 */ + { 8, 5, 2, 1, 4, 0, 1, 1, 2, 12, }, /* left_mode 4 */ + { 19, 5, 5, 7, 4, 40, 6, 3, 10, 4, }, /* left_mode 5 */ + { 16, 5, 9, 1, 1, 16, 26, 2, 10, 4, }, /* left_mode 6 */ + { 11, 4, 8, 1, 1, 4, 4, 5, 4, 1, }, /* left_mode 7 */ + { 15, 1, 3, 7, 3, 21, 7, 1, 34, 5, }, /* left_mode 8 */ + { 18, 5, 1, 3, 4, 3, 7, 1, 2, 9, }, /* left_mode 9 */ + }, + { + /*Above Mode : 6*/ + { 476, 149, 94, 13, 14, 77, 291, 27, 23, 3, }, /* left_mode 0 */ + { 79, 83, 42, 14, 2, 12, 63, 2, 4, 14, }, /* left_mode 1 */ + { 43, 36, 55, 1, 3, 8, 42, 11, 5, 1, }, /* left_mode 2 */ + { 9, 9, 6, 16, 1, 5, 6, 3, 11, 10, }, /* left_mode 3 */ + { 10, 3, 1, 3, 10, 1, 0, 1, 1, 4, }, /* left_mode 4 */ + { 14, 6, 15, 5, 1, 20, 25, 2, 5, 0, }, /* left_mode 5 */ + { 28, 7, 51, 1, 0, 8, 127, 6, 2, 5, }, /* left_mode 6 */ + { 13, 3, 3, 2, 3, 1, 2, 8, 1, 2, }, /* left_mode 7 */ + { 10, 3, 3, 3, 3, 8, 2, 2, 9, 3, }, /* left_mode 8 */ + { 13, 7, 11, 4, 0, 4, 6, 2, 5, 8, }, /* left_mode 9 */ + }, + { + /*Above Mode : 7*/ + { 376, 135, 119, 6, 32, 8, 31, 224, 9, 3, }, /* left_mode 0 */ + { 93, 60, 54, 6, 13, 7, 8, 92, 2, 12, }, /* left_mode 1 */ + { 74, 36, 84, 0, 3, 2, 9, 67, 2, 1, }, /* left_mode 2 */ + { 19, 4, 4, 8, 8, 2, 4, 7, 6, 16, }, /* left_mode 3 */ + { 51, 7, 4, 1, 77, 3, 0, 14, 1, 15, }, /* left_mode 4 */ + { 7, 7, 5, 7, 4, 7, 4, 5, 0, 3, }, /* left_mode 5 */ + { 18, 2, 19, 2, 2, 4, 12, 11, 1, 2, }, /* left_mode 6 */ + { 129, 6, 27, 1, 21, 3, 0, 189, 0, 6, }, /* left_mode 7 */ + { 9, 1, 2, 8, 3, 7, 0, 5, 3, 3, }, /* left_mode 8 */ + { 20, 4, 5, 10, 4, 2, 7, 17, 3, 16, }, /* left_mode 9 */ + }, + { + /*Above Mode : 8*/ + { 617, 68, 34, 79, 11, 27, 25, 14, 75, 13, }, /* left_mode 0 */ + { 51, 82, 21, 26, 6, 12, 13, 1, 26, 16, }, /* left_mode 1 */ + { 29, 9, 12, 11, 3, 7, 1, 10, 2, 2, }, /* left_mode 2 */ + { 17, 19, 11, 74, 4, 3, 2, 0, 58, 13, }, /* left_mode 3 */ + { 10, 1, 1, 3, 4, 1, 0, 2, 1, 8, }, /* left_mode 4 */ + { 14, 4, 5, 5, 1, 13, 2, 0, 27, 8, }, /* left_mode 5 */ + { 10, 3, 5, 4, 1, 7, 6, 4, 5, 1, }, /* left_mode 6 */ + { 10, 2, 6, 2, 1, 1, 1, 4, 2, 1, }, /* left_mode 7 */ + { 14, 8, 5, 23, 2, 12, 6, 2, 117, 5, }, /* left_mode 8 */ + { 9, 6, 2, 19, 1, 6, 3, 2, 9, 9, }, /* left_mode 9 */ + }, + { + /*Above Mode : 9*/ + { 680, 73, 22, 38, 42, 5, 11, 9, 6, 28, }, /* left_mode 0 */ + { 113, 112, 21, 22, 10, 2, 8, 4, 6, 42, }, /* left_mode 1 */ + { 44, 20, 24, 6, 5, 4, 3, 3, 1, 2, }, /* left_mode 2 */ + { 40, 23, 7, 71, 5, 2, 4, 1, 7, 22, }, /* left_mode 3 */ + { 85, 9, 4, 4, 17, 2, 0, 3, 2, 23, }, /* left_mode 4 */ + { 13, 4, 2, 6, 1, 7, 0, 1, 7, 6, }, /* left_mode 5 */ + { 26, 6, 8, 3, 2, 3, 8, 1, 5, 4, }, /* left_mode 6 */ + { 54, 8, 9, 6, 7, 0, 1, 11, 1, 3, }, /* left_mode 7 */ + { 9, 10, 4, 13, 2, 5, 4, 2, 14, 8, }, /* left_mode 8 */ + { 92, 9, 5, 19, 15, 3, 3, 1, 6, 58, }, /* left_mode 9 */ + }, }; diff --git a/vp8/common/mv.h b/vp8/common/mv.h index 35c4fe947..48c92f958 100644 --- a/vp8/common/mv.h +++ b/vp8/common/mv.h @@ -13,16 +13,14 @@ #define __INC_MV_H #include "vpx/vpx_integer.h" -typedef struct -{ - short row; - short col; +typedef struct { + short row; + short col; } MV; -typedef union -{ - uint32_t as_int; - MV as_mv; +typedef union { + uint32_t as_int; + MV as_mv; } int_mv; /* facilitates faster equality tests and copies */ #endif diff --git a/vp8/common/onyx.h b/vp8/common/onyx.h index 8d4cb3e97..3d8f565e5 100644 --- a/vp8/common/onyx.h +++ b/vp8/common/onyx.h @@ -22,187 +22,179 @@ extern "C" #include "vpx_scale/yv12config.h" #include "type_aliases.h" #include "ppflags.h" - typedef int *VP8_PTR; + typedef int *VP8_PTR; - /* Create/destroy static data structures. */ + /* Create/destroy static data structures. */ - typedef enum - { - NORMAL = 0, - FOURFIVE = 1, - THREEFIVE = 2, - ONETWO = 3 + typedef enum { + NORMAL = 0, + FOURFIVE = 1, + THREEFIVE = 2, + ONETWO = 3 - } VPX_SCALING; + } VPX_SCALING; - typedef enum - { - VP8_LAST_FLAG = 1, - VP8_GOLD_FLAG = 2, - VP8_ALT_FLAG = 4 - } VP8_REFFRAME; + typedef enum { + VP8_LAST_FLAG = 1, + VP8_GOLD_FLAG = 2, + VP8_ALT_FLAG = 4 + } VP8_REFFRAME; - typedef enum - { - USAGE_STREAM_FROM_SERVER = 0x0, - USAGE_LOCAL_FILE_PLAYBACK = 0x1, - USAGE_CONSTRAINED_QUALITY = 0x2 - } END_USAGE; + typedef enum { + USAGE_STREAM_FROM_SERVER = 0x0, + USAGE_LOCAL_FILE_PLAYBACK = 0x1, + USAGE_CONSTRAINED_QUALITY = 0x2 + } END_USAGE; - typedef enum - { - MODE_GOODQUALITY = 0x1, - MODE_BESTQUALITY = 0x2, - MODE_FIRSTPASS = 0x3, - MODE_SECONDPASS = 0x4, - MODE_SECONDPASS_BEST = 0x5, - } MODE; + typedef enum { + MODE_GOODQUALITY = 0x1, + MODE_BESTQUALITY = 0x2, + MODE_FIRSTPASS = 0x3, + MODE_SECONDPASS = 0x4, + MODE_SECONDPASS_BEST = 0x5, + } MODE; - typedef enum - { - FRAMEFLAGS_KEY = 1, - FRAMEFLAGS_GOLDEN = 2, - FRAMEFLAGS_ALTREF = 4, - } FRAMETYPE_FLAGS; + typedef enum { + FRAMEFLAGS_KEY = 1, + FRAMEFLAGS_GOLDEN = 2, + FRAMEFLAGS_ALTREF = 4, + } FRAMETYPE_FLAGS; #include <assert.h> - static __inline void Scale2Ratio(int mode, int *hr, int *hs) - { - switch (mode) - { - case NORMAL: - *hr = 1; - *hs = 1; - break; - case FOURFIVE: - *hr = 4; - *hs = 5; - break; - case THREEFIVE: - *hr = 3; - *hs = 5; - break; - case ONETWO: - *hr = 1; - *hs = 2; - break; - default: - *hr = 1; - *hs = 1; - assert(0); - break; - } + static __inline void Scale2Ratio(int mode, int *hr, int *hs) { + switch (mode) { + case NORMAL: + *hr = 1; + *hs = 1; + break; + case FOURFIVE: + *hr = 4; + *hs = 5; + break; + case THREEFIVE: + *hr = 3; + *hs = 5; + break; + case ONETWO: + *hr = 1; + *hs = 2; + break; + default: + *hr = 1; + *hs = 1; + assert(0); + break; } - - typedef struct - { - int Version; // 4 versions of bitstream defined 0 best quality/slowest decode, 3 lowest quality/fastest decode - int Width; // width of data passed to the compressor - int Height; // height of data passed to the compressor - double frame_rate; // set to passed in framerate - int target_bandwidth; // bandwidth to be used in kilobits per second - - int noise_sensitivity; // parameter used for applying pre processing blur: recommendation 0 - int Sharpness; // parameter used for sharpening output: recommendation 0: - int cpu_used; - unsigned int rc_max_intra_bitrate_pct; - - // mode -> - //(0)=Realtime/Live Encoding. This mode is optimized for realtim encoding (for example, capturing - // a television signal or feed from a live camera). ( speed setting controls how fast ) - //(1)=Good Quality Fast Encoding. The encoder balances quality with the amount of time it takes to - // encode the output. ( speed setting controls how fast ) - //(2)=One Pass - Best Quality. The encoder places priority on the quality of the output over encoding - // speed. The output is compressed at the highest possible quality. This option takes the longest - // amount of time to encode. ( speed setting ignored ) - //(3)=Two Pass - First Pass. The encoder generates a file of statistics for use in the second encoding - // pass. ( speed setting controls how fast ) - //(4)=Two Pass - Second Pass. The encoder uses the statistics that were generated in the first encoding - // pass to create the compressed output. ( speed setting controls how fast ) - //(5)=Two Pass - Second Pass Best. The encoder uses the statistics that were generated in the first - // encoding pass to create the compressed output using the highest possible quality, and taking a - // longer amount of time to encode.. ( speed setting ignored ) - int Mode; // - - // Key Framing Operations - int auto_key; // automatically detect cut scenes and set the keyframes - int key_freq; // maximum distance to key frame. - - int allow_lag; // allow lagged compression (if 0 lagin frames is ignored) - int lag_in_frames; // how many frames lag before we start encoding - - //---------------------------------------------------------------- - // DATARATE CONTROL OPTIONS - - int end_usage; // vbr or cbr - - // buffer targeting aggressiveness - int under_shoot_pct; - int over_shoot_pct; - - // buffering parameters - int starting_buffer_level; // in seconds - int optimal_buffer_level; - int maximum_buffer_size; - - // controlling quality - int fixed_q; - int worst_allowed_q; - int best_allowed_q; - int cq_level; - int lossless; - - // two pass datarate control - int two_pass_vbrbias; // two pass datarate control tweaks - int two_pass_vbrmin_section; - int two_pass_vbrmax_section; - // END DATARATE CONTROL OPTIONS - //---------------------------------------------------------------- - - - // these parameters aren't to be used in final build don't use!!! - int play_alternate; - int alt_freq; - - int encode_breakout; // early breakout encode threshold : for video conf recommend 800 - - int arnr_max_frames; - int arnr_strength ; - int arnr_type ; - - struct vpx_fixed_buf two_pass_stats_in; - struct vpx_codec_pkt_list *output_pkt_list; - - vp8e_tuning tuning; - } VP8_CONFIG; - - - void vp8_initialize(); - - VP8_PTR vp8_create_compressor(VP8_CONFIG *oxcf); - void vp8_remove_compressor(VP8_PTR *comp); - - void vp8_init_config(VP8_PTR onyx, VP8_CONFIG *oxcf); - void vp8_change_config(VP8_PTR onyx, VP8_CONFIG *oxcf); + } + + typedef struct { + int Version; // 4 versions of bitstream defined 0 best quality/slowest decode, 3 lowest quality/fastest decode + int Width; // width of data passed to the compressor + int Height; // height of data passed to the compressor + double frame_rate; // set to passed in framerate + int target_bandwidth; // bandwidth to be used in kilobits per second + + int noise_sensitivity; // parameter used for applying pre processing blur: recommendation 0 + int Sharpness; // parameter used for sharpening output: recommendation 0: + int cpu_used; + unsigned int rc_max_intra_bitrate_pct; + + // mode -> + // (0)=Realtime/Live Encoding. This mode is optimized for realtim encoding (for example, capturing + // a television signal or feed from a live camera). ( speed setting controls how fast ) + // (1)=Good Quality Fast Encoding. The encoder balances quality with the amount of time it takes to + // encode the output. ( speed setting controls how fast ) + // (2)=One Pass - Best Quality. The encoder places priority on the quality of the output over encoding + // speed. The output is compressed at the highest possible quality. This option takes the longest + // amount of time to encode. ( speed setting ignored ) + // (3)=Two Pass - First Pass. The encoder generates a file of statistics for use in the second encoding + // pass. ( speed setting controls how fast ) + // (4)=Two Pass - Second Pass. The encoder uses the statistics that were generated in the first encoding + // pass to create the compressed output. ( speed setting controls how fast ) + // (5)=Two Pass - Second Pass Best. The encoder uses the statistics that were generated in the first + // encoding pass to create the compressed output using the highest possible quality, and taking a + // longer amount of time to encode.. ( speed setting ignored ) + int Mode; // + + // Key Framing Operations + int auto_key; // automatically detect cut scenes and set the keyframes + int key_freq; // maximum distance to key frame. + + int allow_lag; // allow lagged compression (if 0 lagin frames is ignored) + int lag_in_frames; // how many frames lag before we start encoding + + // ---------------------------------------------------------------- + // DATARATE CONTROL OPTIONS + + int end_usage; // vbr or cbr + + // buffer targeting aggressiveness + int under_shoot_pct; + int over_shoot_pct; + + // buffering parameters + int starting_buffer_level; // in seconds + int optimal_buffer_level; + int maximum_buffer_size; + + // controlling quality + int fixed_q; + int worst_allowed_q; + int best_allowed_q; + int cq_level; + int lossless; + + // two pass datarate control + int two_pass_vbrbias; // two pass datarate control tweaks + int two_pass_vbrmin_section; + int two_pass_vbrmax_section; + // END DATARATE CONTROL OPTIONS + // ---------------------------------------------------------------- + + + // these parameters aren't to be used in final build don't use!!! + int play_alternate; + int alt_freq; + + int encode_breakout; // early breakout encode threshold : for video conf recommend 800 + + int arnr_max_frames; + int arnr_strength; + int arnr_type; + + struct vpx_fixed_buf two_pass_stats_in; + struct vpx_codec_pkt_list *output_pkt_list; + + vp8e_tuning tuning; + } VP8_CONFIG; + + + void vp8_initialize(); + + VP8_PTR vp8_create_compressor(VP8_CONFIG *oxcf); + void vp8_remove_compressor(VP8_PTR *comp); + + void vp8_init_config(VP8_PTR onyx, VP8_CONFIG *oxcf); + void vp8_change_config(VP8_PTR onyx, VP8_CONFIG *oxcf); // receive a frames worth of data caller can assume that a copy of this frame is made // and not just a copy of the pointer.. - int vp8_receive_raw_frame(VP8_PTR comp, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time_stamp); - int vp8_get_compressed_data(VP8_PTR comp, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, int64_t *time_stamp, int64_t *time_end, int flush); - int vp8_get_preview_raw_frame(VP8_PTR comp, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *flags); - - int vp8_use_as_reference(VP8_PTR comp, int ref_frame_flags); - int vp8_update_reference(VP8_PTR comp, int ref_frame_flags); - int vp8_get_reference(VP8_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd); - int vp8_set_reference(VP8_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd); - int vp8_update_entropy(VP8_PTR comp, int update); - int vp8_set_roimap(VP8_PTR comp, unsigned char *map, unsigned int rows, unsigned int cols, int delta_q[4], int delta_lf[4], unsigned int threshold[4]); - int vp8_set_active_map(VP8_PTR comp, unsigned char *map, unsigned int rows, unsigned int cols); - int vp8_set_internal_size(VP8_PTR comp, VPX_SCALING horiz_mode, VPX_SCALING vert_mode); - int vp8_get_quantizer(VP8_PTR c); + int vp8_receive_raw_frame(VP8_PTR comp, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time_stamp); + int vp8_get_compressed_data(VP8_PTR comp, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, int64_t *time_stamp, int64_t *time_end, int flush); + int vp8_get_preview_raw_frame(VP8_PTR comp, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *flags); + + int vp8_use_as_reference(VP8_PTR comp, int ref_frame_flags); + int vp8_update_reference(VP8_PTR comp, int ref_frame_flags); + int vp8_get_reference(VP8_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd); + int vp8_set_reference(VP8_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd); + int vp8_update_entropy(VP8_PTR comp, int update); + int vp8_set_roimap(VP8_PTR comp, unsigned char *map, unsigned int rows, unsigned int cols, int delta_q[4], int delta_lf[4], unsigned int threshold[4]); + int vp8_set_active_map(VP8_PTR comp, unsigned char *map, unsigned int rows, unsigned int cols); + int vp8_set_internal_size(VP8_PTR comp, VPX_SCALING horiz_mode, VPX_SCALING vert_mode); + int vp8_get_quantizer(VP8_PTR c); #ifdef __cplusplus } diff --git a/vp8/common/onyxc_int.h b/vp8/common/onyxc_int.h index 93c2fee54..16f52d697 100644 --- a/vp8/common/onyxc_int.h +++ b/vp8/common/onyxc_int.h @@ -42,258 +42,251 @@ void vp8_initialize_common(void); #define COMP_PRED_CONTEXTS 2 -typedef struct frame_contexts -{ - vp8_prob bmode_prob [VP8_BINTRAMODES-1]; - vp8_prob ymode_prob [VP8_YMODES-1]; /* interframe intra mode probs */ - vp8_prob uv_mode_prob [VP8_YMODES][VP8_UV_MODES-1]; - vp8_prob i8x8_mode_prob [VP8_I8X8_MODES-1]; - vp8_prob sub_mv_ref_prob [SUBMVREF_COUNT][VP8_SUBMVREFS-1]; - vp8_prob mbsplit_prob [VP8_NUMMBSPLITS-1]; - vp8_prob coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; - vp8_prob coef_probs_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; - MV_CONTEXT mvc[2]; +typedef struct frame_contexts { + vp8_prob bmode_prob [VP8_BINTRAMODES - 1]; + vp8_prob ymode_prob [VP8_YMODES - 1]; /* interframe intra mode probs */ + vp8_prob uv_mode_prob [VP8_YMODES][VP8_UV_MODES - 1]; + vp8_prob i8x8_mode_prob [VP8_I8X8_MODES - 1]; + vp8_prob sub_mv_ref_prob [SUBMVREF_COUNT][VP8_SUBMVREFS - 1]; + vp8_prob mbsplit_prob [VP8_NUMMBSPLITS - 1]; + vp8_prob coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; + vp8_prob coef_probs_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; + MV_CONTEXT mvc[2]; #if CONFIG_HIGH_PRECISION_MV - MV_CONTEXT_HP mvc_hp[2]; + MV_CONTEXT_HP mvc_hp[2]; #endif #if CONFIG_ADAPTIVE_ENTROPY - MV_CONTEXT pre_mvc[2]; + MV_CONTEXT pre_mvc[2]; #if CONFIG_HIGH_PRECISION_MV - MV_CONTEXT_HP pre_mvc_hp[2]; + MV_CONTEXT_HP pre_mvc_hp[2]; #endif - vp8_prob pre_bmode_prob [VP8_BINTRAMODES-1]; - vp8_prob pre_ymode_prob [VP8_YMODES-1]; /* interframe intra mode probs */ - vp8_prob pre_uv_mode_prob [VP8_YMODES][VP8_UV_MODES-1]; - vp8_prob pre_i8x8_mode_prob [VP8_I8X8_MODES-1]; - vp8_prob pre_sub_mv_ref_prob [SUBMVREF_COUNT][VP8_SUBMVREFS-1]; - vp8_prob pre_mbsplit_prob [VP8_NUMMBSPLITS-1]; - unsigned int bmode_counts [VP8_BINTRAMODES]; - unsigned int ymode_counts [VP8_YMODES]; /* interframe intra mode probs */ - unsigned int uv_mode_counts [VP8_YMODES][VP8_UV_MODES]; - unsigned int i8x8_mode_counts [VP8_I8X8_MODES]; /* interframe intra mode probs */ - unsigned int sub_mv_ref_counts [SUBMVREF_COUNT][VP8_SUBMVREFS]; - unsigned int mbsplit_counts [VP8_NUMMBSPLITS]; - - vp8_prob pre_coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; - vp8_prob pre_coef_probs_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; - unsigned int coef_counts [BLOCK_TYPES] [COEF_BANDS] - [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS]; - unsigned int coef_counts_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS] - [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS]; - unsigned int MVcount [2] [MVvals]; + vp8_prob pre_bmode_prob [VP8_BINTRAMODES - 1]; + vp8_prob pre_ymode_prob [VP8_YMODES - 1]; /* interframe intra mode probs */ + vp8_prob pre_uv_mode_prob [VP8_YMODES][VP8_UV_MODES - 1]; + vp8_prob pre_i8x8_mode_prob [VP8_I8X8_MODES - 1]; + vp8_prob pre_sub_mv_ref_prob [SUBMVREF_COUNT][VP8_SUBMVREFS - 1]; + vp8_prob pre_mbsplit_prob [VP8_NUMMBSPLITS - 1]; + unsigned int bmode_counts [VP8_BINTRAMODES]; + unsigned int ymode_counts [VP8_YMODES]; /* interframe intra mode probs */ + unsigned int uv_mode_counts [VP8_YMODES][VP8_UV_MODES]; + unsigned int i8x8_mode_counts [VP8_I8X8_MODES]; /* interframe intra mode probs */ + unsigned int sub_mv_ref_counts [SUBMVREF_COUNT][VP8_SUBMVREFS]; + unsigned int mbsplit_counts [VP8_NUMMBSPLITS]; + + vp8_prob pre_coef_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; + vp8_prob pre_coef_probs_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES]; + unsigned int coef_counts [BLOCK_TYPES] [COEF_BANDS] + [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS]; + unsigned int coef_counts_8x8 [BLOCK_TYPES_8X8] [COEF_BANDS] + [PREV_COEF_CONTEXTS] [MAX_ENTROPY_TOKENS]; + unsigned int MVcount [2] [MVvals]; #if CONFIG_HIGH_PRECISION_MV - unsigned int MVcount_hp [2] [MVvals_hp]; + unsigned int MVcount_hp [2] [MVvals_hp]; #endif #endif /* CONFIG_ADAPTIVE_ENTROPY */ - int mode_context[6][4]; - int mode_context_a[6][4]; - int vp8_mode_contexts[6][4]; - int mv_ref_ct[6][4][2]; - int mv_ref_ct_a[6][4][2]; + int mode_context[6][4]; + int mode_context_a[6][4]; + int vp8_mode_contexts[6][4]; + int mv_ref_ct[6][4][2]; + int mv_ref_ct_a[6][4][2]; } FRAME_CONTEXT; -typedef enum -{ - RECON_CLAMP_REQUIRED = 0, - RECON_CLAMP_NOTREQUIRED = 1 +typedef enum { + RECON_CLAMP_REQUIRED = 0, + RECON_CLAMP_NOTREQUIRED = 1 } CLAMP_TYPE; -typedef enum -{ - SIXTAP = 0, - BILINEAR = 1, +typedef enum { + SIXTAP = 0, + BILINEAR = 1, #if CONFIG_ENHANCED_INTERP - EIGHTTAP = 2, - EIGHTTAP_SHARP = 3, + EIGHTTAP = 2, + EIGHTTAP_SHARP = 3, #endif } INTERPOLATIONFILTERTYPE; -typedef enum -{ - SINGLE_PREDICTION_ONLY = 0, - COMP_PREDICTION_ONLY = 1, - HYBRID_PREDICTION = 2, - NB_PREDICTION_TYPES = 3, +typedef enum { + SINGLE_PREDICTION_ONLY = 0, + COMP_PREDICTION_ONLY = 1, + HYBRID_PREDICTION = 2, + NB_PREDICTION_TYPES = 3, } COMPPREDMODE_TYPE; /* TODO: allows larger transform */ -typedef enum -{ - ONLY_4X4 = 0, - ALLOW_8X8 = 1 +typedef enum { + ONLY_4X4 = 0, + ALLOW_8X8 = 1 } TXFM_MODE; -typedef struct VP8_COMMON_RTCD -{ +typedef struct VP8_COMMON_RTCD { #if CONFIG_RUNTIME_CPU_DETECT - vp8_idct_rtcd_vtable_t idct; - vp8_recon_rtcd_vtable_t recon; - vp8_subpix_rtcd_vtable_t subpix; - vp8_loopfilter_rtcd_vtable_t loopfilter; + vp8_idct_rtcd_vtable_t idct; + vp8_recon_rtcd_vtable_t recon; + vp8_subpix_rtcd_vtable_t subpix; + vp8_loopfilter_rtcd_vtable_t loopfilter; #if CONFIG_POSTPROC - vp8_postproc_rtcd_vtable_t postproc; + vp8_postproc_rtcd_vtable_t postproc; #endif - int flags; + int flags; #else - int unused; + int unused; #endif } VP8_COMMON_RTCD; -typedef struct VP8Common -{ - struct vpx_internal_error_info error; +typedef struct VP8Common { + struct vpx_internal_error_info error; - DECLARE_ALIGNED(16, short, Y1dequant[QINDEX_RANGE][16]); - DECLARE_ALIGNED(16, short, Y2dequant[QINDEX_RANGE][16]); - DECLARE_ALIGNED(16, short, UVdequant[QINDEX_RANGE][16]); + DECLARE_ALIGNED(16, short, Y1dequant[QINDEX_RANGE][16]); + DECLARE_ALIGNED(16, short, Y2dequant[QINDEX_RANGE][16]); + DECLARE_ALIGNED(16, short, UVdequant[QINDEX_RANGE][16]); - int Width; - int Height; - int horiz_scale; - int vert_scale; + int Width; + int Height; + int horiz_scale; + int vert_scale; - YUV_TYPE clr_type; - CLAMP_TYPE clamp_type; + YUV_TYPE clr_type; + CLAMP_TYPE clamp_type; - YV12_BUFFER_CONFIG *frame_to_show; + YV12_BUFFER_CONFIG *frame_to_show; - YV12_BUFFER_CONFIG yv12_fb[NUM_YV12_BUFFERS]; - int fb_idx_ref_cnt[NUM_YV12_BUFFERS]; - int new_fb_idx, lst_fb_idx, gld_fb_idx, alt_fb_idx; + YV12_BUFFER_CONFIG yv12_fb[NUM_YV12_BUFFERS]; + int fb_idx_ref_cnt[NUM_YV12_BUFFERS]; + int new_fb_idx, lst_fb_idx, gld_fb_idx, alt_fb_idx; - YV12_BUFFER_CONFIG post_proc_buffer; - YV12_BUFFER_CONFIG temp_scale_frame; + YV12_BUFFER_CONFIG post_proc_buffer; + YV12_BUFFER_CONFIG temp_scale_frame; - FRAME_TYPE last_frame_type; /* Save last frame's frame type for motion search. */ - FRAME_TYPE frame_type; + FRAME_TYPE last_frame_type; /* Save last frame's frame type for motion search. */ + FRAME_TYPE frame_type; - int show_frame; + int show_frame; - int frame_flags; - int MBs; - int mb_rows; - int mb_cols; - int mode_info_stride; + int frame_flags; + int MBs; + int mb_rows; + int mb_cols; + int mode_info_stride; - /* profile settings */ - int experimental; - int mb_no_coeff_skip; - TXFM_MODE txfm_mode; - COMPPREDMODE_TYPE comp_pred_mode; - int no_lpf; - int use_bilinear_mc_filter; - int full_pixel; + /* profile settings */ + int experimental; + int mb_no_coeff_skip; + TXFM_MODE txfm_mode; + COMPPREDMODE_TYPE comp_pred_mode; + int no_lpf; + int use_bilinear_mc_filter; + int full_pixel; - int base_qindex; - int last_kf_gf_q; /* Q used on the last GF or KF */ + int base_qindex; + int last_kf_gf_q; /* Q used on the last GF or KF */ - int y1dc_delta_q; - int y2dc_delta_q; - int y2ac_delta_q; - int uvdc_delta_q; - int uvac_delta_q; + int y1dc_delta_q; + int y2dc_delta_q; + int y2ac_delta_q; + int uvdc_delta_q; + int uvac_delta_q; - unsigned int frames_since_golden; - unsigned int frames_till_alt_ref_frame; + unsigned int frames_since_golden; + unsigned int frames_till_alt_ref_frame; - /* We allocate a MODE_INFO struct for each macroblock, together with - an extra row on top and column on the left to simplify prediction. */ + /* We allocate a MODE_INFO struct for each macroblock, together with + an extra row on top and column on the left to simplify prediction. */ - MODE_INFO *mip; /* Base of allocated array */ - MODE_INFO *mi; /* Corresponds to upper left visible macroblock */ - MODE_INFO *prev_mip; /* MODE_INFO array 'mip' from last decoded frame */ - MODE_INFO *prev_mi; /* 'mi' from last frame (points into prev_mip) */ + MODE_INFO *mip; /* Base of allocated array */ + MODE_INFO *mi; /* Corresponds to upper left visible macroblock */ + MODE_INFO *prev_mip; /* MODE_INFO array 'mip' from last decoded frame */ + MODE_INFO *prev_mi; /* 'mi' from last frame (points into prev_mip) */ - // Persistent mb segment id map used in prediction. - unsigned char * last_frame_seg_map; + // Persistent mb segment id map used in prediction. + unsigned char *last_frame_seg_map; - INTERPOLATIONFILTERTYPE mcomp_filter_type; - LOOPFILTERTYPE filter_type; + INTERPOLATIONFILTERTYPE mcomp_filter_type; + LOOPFILTERTYPE filter_type; - loop_filter_info_n lf_info; + loop_filter_info_n lf_info; - int filter_level; - int last_sharpness_level; - int sharpness_level; + int filter_level; + int last_sharpness_level; + int sharpness_level; - int refresh_last_frame; /* Two state 0 = NO, 1 = YES */ - int refresh_golden_frame; /* Two state 0 = NO, 1 = YES */ - int refresh_alt_ref_frame; /* Two state 0 = NO, 1 = YES */ + int refresh_last_frame; /* Two state 0 = NO, 1 = YES */ + int refresh_golden_frame; /* Two state 0 = NO, 1 = YES */ + int refresh_alt_ref_frame; /* Two state 0 = NO, 1 = YES */ - int copy_buffer_to_gf; /* 0 none, 1 Last to GF, 2 ARF to GF */ - int copy_buffer_to_arf; /* 0 none, 1 Last to ARF, 2 GF to ARF */ + int copy_buffer_to_gf; /* 0 none, 1 Last to GF, 2 ARF to GF */ + int copy_buffer_to_arf; /* 0 none, 1 Last to ARF, 2 GF to ARF */ - int refresh_entropy_probs; /* Two state 0 = NO, 1 = YES */ + int refresh_entropy_probs; /* Two state 0 = NO, 1 = YES */ - int ref_frame_sign_bias[MAX_REF_FRAMES]; /* Two state 0, 1 */ + int ref_frame_sign_bias[MAX_REF_FRAMES]; /* Two state 0, 1 */ - /* Y,U,V,Y2 */ - ENTROPY_CONTEXT_PLANES *above_context; /* row of context for each plane */ - ENTROPY_CONTEXT_PLANES left_context; /* (up to) 4 contexts "" */ + /* Y,U,V,Y2 */ + ENTROPY_CONTEXT_PLANES *above_context; /* row of context for each plane */ + ENTROPY_CONTEXT_PLANES left_context; /* (up to) 4 contexts "" */ - /* keyframe block modes are predicted by their above, left neighbors */ + /* keyframe block modes are predicted by their above, left neighbors */ - vp8_prob kf_bmode_prob [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1]; - vp8_prob kf_ymode_prob[8][VP8_YMODES-1]; /* keyframe "" */ - int kf_ymode_probs_index; - int kf_ymode_probs_update; - vp8_prob kf_uv_mode_prob[VP8_YMODES] [VP8_UV_MODES-1]; + vp8_prob kf_bmode_prob [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES - 1]; + vp8_prob kf_ymode_prob[8][VP8_YMODES - 1]; /* keyframe "" */ + int kf_ymode_probs_index; + int kf_ymode_probs_update; + vp8_prob kf_uv_mode_prob[VP8_YMODES] [VP8_UV_MODES - 1]; - vp8_prob prob_intra_coded; - vp8_prob prob_last_coded; - vp8_prob prob_gf_coded; + vp8_prob prob_intra_coded; + vp8_prob prob_last_coded; + vp8_prob prob_gf_coded; - // Context probabilities when using predictive coding of segment id - vp8_prob segment_pred_probs[PREDICTION_PROBS]; - unsigned char temporal_update; + // Context probabilities when using predictive coding of segment id + vp8_prob segment_pred_probs[PREDICTION_PROBS]; + unsigned char temporal_update; - // Context probabilities for reference frame prediction - unsigned char ref_scores[MAX_REF_FRAMES]; - vp8_prob ref_pred_probs[PREDICTION_PROBS]; - vp8_prob mod_refprobs[MAX_REF_FRAMES][PREDICTION_PROBS]; + // Context probabilities for reference frame prediction + unsigned char ref_scores[MAX_REF_FRAMES]; + vp8_prob ref_pred_probs[PREDICTION_PROBS]; + vp8_prob mod_refprobs[MAX_REF_FRAMES][PREDICTION_PROBS]; - vp8_prob prob_comppred[COMP_PRED_CONTEXTS]; + vp8_prob prob_comppred[COMP_PRED_CONTEXTS]; #if CONFIG_NEWENTROPY - vp8_prob mbskip_pred_probs[MBSKIP_CONTEXTS]; + vp8_prob mbskip_pred_probs[MBSKIP_CONTEXTS]; #endif - FRAME_CONTEXT lfc_a; /* last alt ref entropy */ - FRAME_CONTEXT lfc; /* last frame entropy */ - FRAME_CONTEXT fc; /* this frame entropy */ + FRAME_CONTEXT lfc_a; /* last alt ref entropy */ + FRAME_CONTEXT lfc; /* last frame entropy */ + FRAME_CONTEXT fc; /* this frame entropy */ - //int mv_ref_ct[6][4][2]; - //int mv_ref_ct_a[6][4][2]; - //int mode_context[6][4]; - //int mode_context_a[6][4]; - //int vp8_mode_contexts[6][4]; + // int mv_ref_ct[6][4][2]; + // int mv_ref_ct_a[6][4][2]; + // int mode_context[6][4]; + // int mode_context_a[6][4]; + // int vp8_mode_contexts[6][4]; - unsigned int current_video_frame; - int near_boffset[3]; - int version; + unsigned int current_video_frame; + int near_boffset[3]; + int version; #ifdef PACKET_TESTING - VP8_HEADER oh; + VP8_HEADER oh; #endif - double bitrate; - double framerate; + double bitrate; + double framerate; #if CONFIG_RUNTIME_CPU_DETECT - VP8_COMMON_RTCD rtcd; + VP8_COMMON_RTCD rtcd; #endif #if CONFIG_POSTPROC - struct postproc_state postproc_state; + struct postproc_state postproc_state; #endif #if CONFIG_PRED_FILTER - /* Prediction filter variables */ - int pred_filter_mode; // 0=disabled at the frame level (no MB filtered) - // 1=enabled at the frame level (all MB filtered) - // 2=specified per MB (1=filtered, 0=non-filtered) - vp8_prob prob_pred_filter_off; + /* Prediction filter variables */ + int pred_filter_mode; // 0=disabled at the frame level (no MB filtered) + // 1=enabled at the frame level (all MB filtered) + // 2=specified per MB (1=filtered, 0=non-filtered) + vp8_prob prob_pred_filter_off; #endif } VP8_COMMON; diff --git a/vp8/common/onyxd.h b/vp8/common/onyxd.h index d3b2c18d1..3c9968fb5 100644 --- a/vp8/common/onyxd.h +++ b/vp8/common/onyxd.h @@ -24,43 +24,40 @@ extern "C" #include "vpx_ports/mem.h" #include "vpx/vpx_codec.h" - typedef void *VP8D_PTR; - typedef struct - { - int Width; - int Height; - int Version; - int postprocess; - int max_threads; - int input_partition; - } VP8D_CONFIG; - typedef enum - { - VP8_LAST_FLAG = 1, - VP8_GOLD_FLAG = 2, - VP8_ALT_FLAG = 4 - } VP8_REFFRAME; - - typedef enum - { - VP8D_OK = 0 - } VP8D_SETTING; - - void vp8dx_initialize(void); - - void vp8dx_set_setting(VP8D_PTR comp, VP8D_SETTING oxst, int x); - - int vp8dx_get_setting(VP8D_PTR comp, VP8D_SETTING oxst); - - int vp8dx_receive_compressed_data(VP8D_PTR comp, unsigned long size, const unsigned char *dest, int64_t time_stamp); - int vp8dx_get_raw_frame(VP8D_PTR comp, YV12_BUFFER_CONFIG *sd, int64_t *time_stamp, int64_t *time_end_stamp, vp8_ppflags_t *flags); - - vpx_codec_err_t vp8dx_get_reference(VP8D_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd); - vpx_codec_err_t vp8dx_set_reference(VP8D_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd); - - VP8D_PTR vp8dx_create_decompressor(VP8D_CONFIG *oxcf); - - void vp8dx_remove_decompressor(VP8D_PTR comp); + typedef void *VP8D_PTR; + typedef struct { + int Width; + int Height; + int Version; + int postprocess; + int max_threads; + int input_partition; + } VP8D_CONFIG; + typedef enum { + VP8_LAST_FLAG = 1, + VP8_GOLD_FLAG = 2, + VP8_ALT_FLAG = 4 + } VP8_REFFRAME; + + typedef enum { + VP8D_OK = 0 + } VP8D_SETTING; + + void vp8dx_initialize(void); + + void vp8dx_set_setting(VP8D_PTR comp, VP8D_SETTING oxst, int x); + + int vp8dx_get_setting(VP8D_PTR comp, VP8D_SETTING oxst); + + int vp8dx_receive_compressed_data(VP8D_PTR comp, unsigned long size, const unsigned char *dest, int64_t time_stamp); + int vp8dx_get_raw_frame(VP8D_PTR comp, YV12_BUFFER_CONFIG *sd, int64_t *time_stamp, int64_t *time_end_stamp, vp8_ppflags_t *flags); + + vpx_codec_err_t vp8dx_get_reference(VP8D_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd); + vpx_codec_err_t vp8dx_set_reference(VP8D_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd); + + VP8D_PTR vp8dx_create_decompressor(VP8D_CONFIG *oxcf); + + void vp8dx_remove_decompressor(VP8D_PTR comp); #ifdef __cplusplus } diff --git a/vp8/common/postproc.c b/vp8/common/postproc.c index 7e7ed3cb7..66bd539d1 100644 --- a/vp8/common/postproc.c +++ b/vp8/common/postproc.c @@ -21,113 +21,108 @@ #include <stdio.h> #define RGB_TO_YUV(t) \ - ( (0.257*(float)(t>>16)) + (0.504*(float)(t>>8&0xff)) + (0.098*(float)(t&0xff)) + 16), \ - (-(0.148*(float)(t>>16)) - (0.291*(float)(t>>8&0xff)) + (0.439*(float)(t&0xff)) + 128), \ - ( (0.439*(float)(t>>16)) - (0.368*(float)(t>>8&0xff)) - (0.071*(float)(t&0xff)) + 128) + ( (0.257*(float)(t>>16)) + (0.504*(float)(t>>8&0xff)) + (0.098*(float)(t&0xff)) + 16), \ + (-(0.148*(float)(t>>16)) - (0.291*(float)(t>>8&0xff)) + (0.439*(float)(t&0xff)) + 128), \ + ( (0.439*(float)(t>>16)) - (0.368*(float)(t>>8&0xff)) - (0.071*(float)(t&0xff)) + 128) /* global constants */ #if CONFIG_POSTPROC_VISUALIZER -static const unsigned char MB_PREDICTION_MODE_colors[MB_MODE_COUNT][3] = -{ - { RGB_TO_YUV(0x98FB98) }, /* PaleGreen */ - { RGB_TO_YUV(0x00FF00) }, /* Green */ - { RGB_TO_YUV(0xADFF2F) }, /* GreenYellow */ +static const unsigned char MB_PREDICTION_MODE_colors[MB_MODE_COUNT][3] = { + { RGB_TO_YUV(0x98FB98) }, /* PaleGreen */ + { RGB_TO_YUV(0x00FF00) }, /* Green */ + { RGB_TO_YUV(0xADFF2F) }, /* GreenYellow */ #if CONFIG_NEWINTRAMODES - { RGB_TO_YUV(0x8F0000) }, /* Dark Red */ - { RGB_TO_YUV(0x008F8F) }, /* Dark Cyan */ - { RGB_TO_YUV(0x008F8F) }, /* Dark Cyan */ - { RGB_TO_YUV(0x008F8F) }, /* Dark Cyan */ - { RGB_TO_YUV(0x8F0000) }, /* Dark Red */ - { RGB_TO_YUV(0x8F0000) }, /* Dark Red */ + { RGB_TO_YUV(0x8F0000) }, /* Dark Red */ + { RGB_TO_YUV(0x008F8F) }, /* Dark Cyan */ + { RGB_TO_YUV(0x008F8F) }, /* Dark Cyan */ + { RGB_TO_YUV(0x008F8F) }, /* Dark Cyan */ + { RGB_TO_YUV(0x8F0000) }, /* Dark Red */ + { RGB_TO_YUV(0x8F0000) }, /* Dark Red */ #endif - { RGB_TO_YUV(0x228B22) }, /* ForestGreen */ - { RGB_TO_YUV(0x006400) }, /* DarkGreen */ - { RGB_TO_YUV(0x98F5FF) }, /* Cadet Blue */ - { RGB_TO_YUV(0x6CA6CD) }, /* Sky Blue */ - { RGB_TO_YUV(0x00008B) }, /* Dark blue */ - { RGB_TO_YUV(0x551A8B) }, /* Purple */ - { RGB_TO_YUV(0xFF0000) } /* Red */ - { RGB_TO_YUV(0xCC33FF) }, /* Magenta */ + { RGB_TO_YUV(0x228B22) }, /* ForestGreen */ + { RGB_TO_YUV(0x006400) }, /* DarkGreen */ + { RGB_TO_YUV(0x98F5FF) }, /* Cadet Blue */ + { RGB_TO_YUV(0x6CA6CD) }, /* Sky Blue */ + { RGB_TO_YUV(0x00008B) }, /* Dark blue */ + { RGB_TO_YUV(0x551A8B) }, /* Purple */ + { RGB_TO_YUV(0xFF0000) } /* Red */ + { RGB_TO_YUV(0xCC33FF) }, /* Magenta */ }; -static const unsigned char B_PREDICTION_MODE_colors[B_MODE_COUNT][3] = -{ - { RGB_TO_YUV(0x6633ff) }, /* Purple */ - { RGB_TO_YUV(0xcc33ff) }, /* Magenta */ - { RGB_TO_YUV(0xff33cc) }, /* Pink */ - { RGB_TO_YUV(0xff3366) }, /* Coral */ - { RGB_TO_YUV(0x3366ff) }, /* Blue */ - { RGB_TO_YUV(0xed00f5) }, /* Dark Blue */ - { RGB_TO_YUV(0x2e00b8) }, /* Dark Purple */ - { RGB_TO_YUV(0xff6633) }, /* Orange */ - { RGB_TO_YUV(0x33ccff) }, /* Light Blue */ - { RGB_TO_YUV(0x8ab800) }, /* Green */ - { RGB_TO_YUV(0xffcc33) }, /* Light Orange */ - { RGB_TO_YUV(0x33ffcc) }, /* Aqua */ - { RGB_TO_YUV(0x66ff33) }, /* Light Green */ - { RGB_TO_YUV(0xccff33) }, /* Yellow */ +static const unsigned char B_PREDICTION_MODE_colors[B_MODE_COUNT][3] = { + { RGB_TO_YUV(0x6633ff) }, /* Purple */ + { RGB_TO_YUV(0xcc33ff) }, /* Magenta */ + { RGB_TO_YUV(0xff33cc) }, /* Pink */ + { RGB_TO_YUV(0xff3366) }, /* Coral */ + { RGB_TO_YUV(0x3366ff) }, /* Blue */ + { RGB_TO_YUV(0xed00f5) }, /* Dark Blue */ + { RGB_TO_YUV(0x2e00b8) }, /* Dark Purple */ + { RGB_TO_YUV(0xff6633) }, /* Orange */ + { RGB_TO_YUV(0x33ccff) }, /* Light Blue */ + { RGB_TO_YUV(0x8ab800) }, /* Green */ + { RGB_TO_YUV(0xffcc33) }, /* Light Orange */ + { RGB_TO_YUV(0x33ffcc) }, /* Aqua */ + { RGB_TO_YUV(0x66ff33) }, /* Light Green */ + { RGB_TO_YUV(0xccff33) }, /* Yellow */ }; -static const unsigned char MV_REFERENCE_FRAME_colors[MAX_REF_FRAMES][3] = -{ - { RGB_TO_YUV(0x00ff00) }, /* Blue */ - { RGB_TO_YUV(0x0000ff) }, /* Green */ - { RGB_TO_YUV(0xffff00) }, /* Yellow */ - { RGB_TO_YUV(0xff0000) }, /* Red */ +static const unsigned char MV_REFERENCE_FRAME_colors[MAX_REF_FRAMES][3] = { + { RGB_TO_YUV(0x00ff00) }, /* Blue */ + { RGB_TO_YUV(0x0000ff) }, /* Green */ + { RGB_TO_YUV(0xffff00) }, /* Yellow */ + { RGB_TO_YUV(0xff0000) }, /* Red */ }; #endif -static const short kernel5[] = -{ - 1, 1, 4, 1, 1 +static const short kernel5[] = { + 1, 1, 4, 1, 1 }; -const short vp8_rv[] = -{ - 8, 5, 2, 2, 8, 12, 4, 9, 8, 3, - 0, 3, 9, 0, 0, 0, 8, 3, 14, 4, - 10, 1, 11, 14, 1, 14, 9, 6, 12, 11, - 8, 6, 10, 0, 0, 8, 9, 0, 3, 14, - 8, 11, 13, 4, 2, 9, 0, 3, 9, 6, - 1, 2, 3, 14, 13, 1, 8, 2, 9, 7, - 3, 3, 1, 13, 13, 6, 6, 5, 2, 7, - 11, 9, 11, 8, 7, 3, 2, 0, 13, 13, - 14, 4, 12, 5, 12, 10, 8, 10, 13, 10, - 4, 14, 4, 10, 0, 8, 11, 1, 13, 7, - 7, 14, 6, 14, 13, 2, 13, 5, 4, 4, - 0, 10, 0, 5, 13, 2, 12, 7, 11, 13, - 8, 0, 4, 10, 7, 2, 7, 2, 2, 5, - 3, 4, 7, 3, 3, 14, 14, 5, 9, 13, - 3, 14, 3, 6, 3, 0, 11, 8, 13, 1, - 13, 1, 12, 0, 10, 9, 7, 6, 2, 8, - 5, 2, 13, 7, 1, 13, 14, 7, 6, 7, - 9, 6, 10, 11, 7, 8, 7, 5, 14, 8, - 4, 4, 0, 8, 7, 10, 0, 8, 14, 11, - 3, 12, 5, 7, 14, 3, 14, 5, 2, 6, - 11, 12, 12, 8, 0, 11, 13, 1, 2, 0, - 5, 10, 14, 7, 8, 0, 4, 11, 0, 8, - 0, 3, 10, 5, 8, 0, 11, 6, 7, 8, - 10, 7, 13, 9, 2, 5, 1, 5, 10, 2, - 4, 3, 5, 6, 10, 8, 9, 4, 11, 14, - 0, 10, 0, 5, 13, 2, 12, 7, 11, 13, - 8, 0, 4, 10, 7, 2, 7, 2, 2, 5, - 3, 4, 7, 3, 3, 14, 14, 5, 9, 13, - 3, 14, 3, 6, 3, 0, 11, 8, 13, 1, - 13, 1, 12, 0, 10, 9, 7, 6, 2, 8, - 5, 2, 13, 7, 1, 13, 14, 7, 6, 7, - 9, 6, 10, 11, 7, 8, 7, 5, 14, 8, - 4, 4, 0, 8, 7, 10, 0, 8, 14, 11, - 3, 12, 5, 7, 14, 3, 14, 5, 2, 6, - 11, 12, 12, 8, 0, 11, 13, 1, 2, 0, - 5, 10, 14, 7, 8, 0, 4, 11, 0, 8, - 0, 3, 10, 5, 8, 0, 11, 6, 7, 8, - 10, 7, 13, 9, 2, 5, 1, 5, 10, 2, - 4, 3, 5, 6, 10, 8, 9, 4, 11, 14, - 3, 8, 3, 7, 8, 5, 11, 4, 12, 3, - 11, 9, 14, 8, 14, 13, 4, 3, 1, 2, - 14, 6, 5, 4, 4, 11, 4, 6, 2, 1, - 5, 8, 8, 12, 13, 5, 14, 10, 12, 13, - 0, 9, 5, 5, 11, 10, 13, 9, 10, 13, +const short vp8_rv[] = { + 8, 5, 2, 2, 8, 12, 4, 9, 8, 3, + 0, 3, 9, 0, 0, 0, 8, 3, 14, 4, + 10, 1, 11, 14, 1, 14, 9, 6, 12, 11, + 8, 6, 10, 0, 0, 8, 9, 0, 3, 14, + 8, 11, 13, 4, 2, 9, 0, 3, 9, 6, + 1, 2, 3, 14, 13, 1, 8, 2, 9, 7, + 3, 3, 1, 13, 13, 6, 6, 5, 2, 7, + 11, 9, 11, 8, 7, 3, 2, 0, 13, 13, + 14, 4, 12, 5, 12, 10, 8, 10, 13, 10, + 4, 14, 4, 10, 0, 8, 11, 1, 13, 7, + 7, 14, 6, 14, 13, 2, 13, 5, 4, 4, + 0, 10, 0, 5, 13, 2, 12, 7, 11, 13, + 8, 0, 4, 10, 7, 2, 7, 2, 2, 5, + 3, 4, 7, 3, 3, 14, 14, 5, 9, 13, + 3, 14, 3, 6, 3, 0, 11, 8, 13, 1, + 13, 1, 12, 0, 10, 9, 7, 6, 2, 8, + 5, 2, 13, 7, 1, 13, 14, 7, 6, 7, + 9, 6, 10, 11, 7, 8, 7, 5, 14, 8, + 4, 4, 0, 8, 7, 10, 0, 8, 14, 11, + 3, 12, 5, 7, 14, 3, 14, 5, 2, 6, + 11, 12, 12, 8, 0, 11, 13, 1, 2, 0, + 5, 10, 14, 7, 8, 0, 4, 11, 0, 8, + 0, 3, 10, 5, 8, 0, 11, 6, 7, 8, + 10, 7, 13, 9, 2, 5, 1, 5, 10, 2, + 4, 3, 5, 6, 10, 8, 9, 4, 11, 14, + 0, 10, 0, 5, 13, 2, 12, 7, 11, 13, + 8, 0, 4, 10, 7, 2, 7, 2, 2, 5, + 3, 4, 7, 3, 3, 14, 14, 5, 9, 13, + 3, 14, 3, 6, 3, 0, 11, 8, 13, 1, + 13, 1, 12, 0, 10, 9, 7, 6, 2, 8, + 5, 2, 13, 7, 1, 13, 14, 7, 6, 7, + 9, 6, 10, 11, 7, 8, 7, 5, 14, 8, + 4, 4, 0, 8, 7, 10, 0, 8, 14, 11, + 3, 12, 5, 7, 14, 3, 14, 5, 2, 6, + 11, 12, 12, 8, 0, 11, 13, 1, 2, 0, + 5, 10, 14, 7, 8, 0, 4, 11, 0, 8, + 0, 3, 10, 5, 8, 0, 11, 6, 7, 8, + 10, 7, 13, 9, 2, 5, 1, 5, 10, 2, + 4, 3, 5, 6, 10, 8, 9, 4, 11, 14, + 3, 8, 3, 7, 8, 5, 11, 4, 12, 3, + 11, 9, 14, 8, 14, 13, 4, 3, 1, 2, + 14, 6, 5, 4, 4, 11, 4, 6, 2, 1, + 5, 8, 8, 12, 13, 5, 14, 10, 12, 13, + 0, 9, 5, 5, 11, 10, 13, 9, 10, 13, }; @@ -137,215 +132,196 @@ extern void vp8_blit_line(int x0, int x1, int y0, int y1, unsigned char *image, */ void vp8_post_proc_down_and_across_c ( - unsigned char *src_ptr, - unsigned char *dst_ptr, - int src_pixels_per_line, - int dst_pixels_per_line, - int rows, - int cols, - int flimit -) -{ - unsigned char *p_src, *p_dst; - int row; - int col; - int i; - int v; - int pitch = src_pixels_per_line; - unsigned char d[8]; - (void)dst_pixels_per_line; - - for (row = 0; row < rows; row++) - { - /* post_proc_down for one row */ - p_src = src_ptr; - p_dst = dst_ptr; - - for (col = 0; col < cols; col++) - { - - int kernel = 4; - int v = p_src[col]; - - for (i = -2; i <= 2; i++) - { - if (abs(v - p_src[col+i*pitch]) > flimit) - goto down_skip_convolve; - - kernel += kernel5[2+i] * p_src[col+i*pitch]; - } + unsigned char *src_ptr, + unsigned char *dst_ptr, + int src_pixels_per_line, + int dst_pixels_per_line, + int rows, + int cols, + int flimit +) { + unsigned char *p_src, *p_dst; + int row; + int col; + int i; + int v; + int pitch = src_pixels_per_line; + unsigned char d[8]; + (void)dst_pixels_per_line; - v = (kernel >> 3); - down_skip_convolve: - p_dst[col] = v; - } + for (row = 0; row < rows; row++) { + /* post_proc_down for one row */ + p_src = src_ptr; + p_dst = dst_ptr; - /* now post_proc_across */ - p_src = dst_ptr; - p_dst = dst_ptr; + for (col = 0; col < cols; col++) { - for (i = 0; i < 8; i++) - d[i] = p_src[i]; + int kernel = 4; + int v = p_src[col]; - for (col = 0; col < cols; col++) - { - int kernel = 4; - v = p_src[col]; + for (i = -2; i <= 2; i++) { + if (abs(v - p_src[col + i * pitch]) > flimit) + goto down_skip_convolve; - d[col&7] = v; + kernel += kernel5[2 + i] * p_src[col + i * pitch]; + } - for (i = -2; i <= 2; i++) - { - if (abs(v - p_src[col+i]) > flimit) - goto across_skip_convolve; + v = (kernel >> 3); + down_skip_convolve: + p_dst[col] = v; + } - kernel += kernel5[2+i] * p_src[col+i]; - } + /* now post_proc_across */ + p_src = dst_ptr; + p_dst = dst_ptr; - d[col&7] = (kernel >> 3); - across_skip_convolve: + for (i = 0; i < 8; i++) + d[i] = p_src[i]; - if (col >= 2) - p_dst[col-2] = d[(col-2)&7]; - } + for (col = 0; col < cols; col++) { + int kernel = 4; + v = p_src[col]; + + d[col & 7] = v; + + for (i = -2; i <= 2; i++) { + if (abs(v - p_src[col + i]) > flimit) + goto across_skip_convolve; - /* handle the last two pixels */ - p_dst[col-2] = d[(col-2)&7]; - p_dst[col-1] = d[(col-1)&7]; + kernel += kernel5[2 + i] * p_src[col + i]; + } + d[col & 7] = (kernel >> 3); + across_skip_convolve: - /* next row */ - src_ptr += pitch; - dst_ptr += pitch; + if (col >= 2) + p_dst[col - 2] = d[(col - 2) & 7]; } -} -static int q2mbl(int x) -{ - if (x < 20) x = 20; + /* handle the last two pixels */ + p_dst[col - 2] = d[(col - 2) & 7]; + p_dst[col - 1] = d[(col - 1) & 7]; + - x = 50 + (x - 50) * 10 / 8; - return x * x / 3; + /* next row */ + src_ptr += pitch; + dst_ptr += pitch; + } } -void vp8_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, int cols, int flimit) -{ - int r, c, i; - unsigned char *s = src; - unsigned char d[16]; +static int q2mbl(int x) { + if (x < 20) x = 20; + x = 50 + (x - 50) * 10 / 8; + return x * x / 3; +} +void vp8_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, int cols, int flimit) { + int r, c, i; - for (r = 0; r < rows; r++) - { - int sumsq = 0; - int sum = 0; + unsigned char *s = src; + unsigned char d[16]; - for (i = -8; i <= 6; i++) - { - sumsq += s[i] * s[i]; - sum += s[i]; - d[i+8] = 0; - } - for (c = 0; c < cols + 8; c++) - { - int x = s[c+7] - s[c-8]; - int y = s[c+7] + s[c-8]; + for (r = 0; r < rows; r++) { + int sumsq = 0; + int sum = 0; - sum += x; - sumsq += x * y; + for (i = -8; i <= 6; i++) { + sumsq += s[i] * s[i]; + sum += s[i]; + d[i + 8] = 0; + } - d[c&15] = s[c]; + for (c = 0; c < cols + 8; c++) { + int x = s[c + 7] - s[c - 8]; + int y = s[c + 7] + s[c - 8]; - if (sumsq * 15 - sum * sum < flimit) - { - d[c&15] = (8 + sum + s[c]) >> 4; - } + sum += x; + sumsq += x * y; - s[c-8] = d[(c-8)&15]; - } + d[c & 15] = s[c]; + + if (sumsq * 15 - sum * sum < flimit) { + d[c & 15] = (8 + sum + s[c]) >> 4; + } - s += pitch; + s[c - 8] = d[(c - 8) & 15]; } + + s += pitch; + } } -void vp8_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int cols, int flimit) -{ - int r, c, i; - const short *rv3 = &vp8_rv[63&rand()]; +void vp8_mbpost_proc_down_c(unsigned char *dst, int pitch, int rows, int cols, int flimit) { + int r, c, i; + const short *rv3 = &vp8_rv[63 & rand()]; - for (c = 0; c < cols; c++) - { - unsigned char *s = &dst[c]; - int sumsq = 0; - int sum = 0; - unsigned char d[16]; - const short *rv2 = rv3 + ((c * 17) & 127); + for (c = 0; c < cols; c++) { + unsigned char *s = &dst[c]; + int sumsq = 0; + int sum = 0; + unsigned char d[16]; + const short *rv2 = rv3 + ((c * 17) & 127); - for (i = -8; i <= 6; i++) - { - sumsq += s[i*pitch] * s[i*pitch]; - sum += s[i*pitch]; - } + for (i = -8; i <= 6; i++) { + sumsq += s[i * pitch] * s[i * pitch]; + sum += s[i * pitch]; + } - for (r = 0; r < rows + 8; r++) - { - sumsq += s[7*pitch] * s[ 7*pitch] - s[-8*pitch] * s[-8*pitch]; - sum += s[7*pitch] - s[-8*pitch]; - d[r&15] = s[0]; + for (r = 0; r < rows + 8; r++) { + sumsq += s[7 * pitch] * s[ 7 * pitch] - s[-8 * pitch] * s[-8 * pitch]; + sum += s[7 * pitch] - s[-8 * pitch]; + d[r & 15] = s[0]; - if (sumsq * 15 - sum * sum < flimit) - { - d[r&15] = (rv2[r&127] + sum + s[0]) >> 4; - } + if (sumsq * 15 - sum * sum < flimit) { + d[r & 15] = (rv2[r & 127] + sum + s[0]) >> 4; + } - s[-8*pitch] = d[(r-8)&15]; - s += pitch; - } + s[-8 * pitch] = d[(r - 8) & 15]; + s += pitch; } + } } static void vp8_deblock_and_de_macro_block(YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *post, - int q, - int low_var_thresh, - int flag, - vp8_postproc_rtcd_vtable_t *rtcd) -{ - double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065; - int ppl = (int)(level + .5); - (void) low_var_thresh; - (void) flag; - - POSTPROC_INVOKE(rtcd, downacross)(source->y_buffer, post->y_buffer, source->y_stride, post->y_stride, source->y_height, source->y_width, ppl); - POSTPROC_INVOKE(rtcd, across)(post->y_buffer, post->y_stride, post->y_height, post->y_width, q2mbl(q)); - POSTPROC_INVOKE(rtcd, down)(post->y_buffer, post->y_stride, post->y_height, post->y_width, q2mbl(q)); - - POSTPROC_INVOKE(rtcd, downacross)(source->u_buffer, post->u_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl); - POSTPROC_INVOKE(rtcd, downacross)(source->v_buffer, post->v_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl); + YV12_BUFFER_CONFIG *post, + int q, + int low_var_thresh, + int flag, + vp8_postproc_rtcd_vtable_t *rtcd) { + double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065; + int ppl = (int)(level + .5); + (void) low_var_thresh; + (void) flag; + + POSTPROC_INVOKE(rtcd, downacross)(source->y_buffer, post->y_buffer, source->y_stride, post->y_stride, source->y_height, source->y_width, ppl); + POSTPROC_INVOKE(rtcd, across)(post->y_buffer, post->y_stride, post->y_height, post->y_width, q2mbl(q)); + POSTPROC_INVOKE(rtcd, down)(post->y_buffer, post->y_stride, post->y_height, post->y_width, q2mbl(q)); + + POSTPROC_INVOKE(rtcd, downacross)(source->u_buffer, post->u_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl); + POSTPROC_INVOKE(rtcd, downacross)(source->v_buffer, post->v_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl); } void vp8_deblock(YV12_BUFFER_CONFIG *source, - YV12_BUFFER_CONFIG *post, - int q, - int low_var_thresh, - int flag, - vp8_postproc_rtcd_vtable_t *rtcd) -{ - double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065; - int ppl = (int)(level + .5); - (void) low_var_thresh; - (void) flag; - - POSTPROC_INVOKE(rtcd, downacross)(source->y_buffer, post->y_buffer, source->y_stride, post->y_stride, source->y_height, source->y_width, ppl); - POSTPROC_INVOKE(rtcd, downacross)(source->u_buffer, post->u_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl); - POSTPROC_INVOKE(rtcd, downacross)(source->v_buffer, post->v_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl); + YV12_BUFFER_CONFIG *post, + int q, + int low_var_thresh, + int flag, + vp8_postproc_rtcd_vtable_t *rtcd) { + double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065; + int ppl = (int)(level + .5); + (void) low_var_thresh; + (void) flag; + + POSTPROC_INVOKE(rtcd, downacross)(source->y_buffer, post->y_buffer, source->y_stride, post->y_stride, source->y_height, source->y_width, ppl); + POSTPROC_INVOKE(rtcd, downacross)(source->u_buffer, post->u_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl); + POSTPROC_INVOKE(rtcd, downacross)(source->v_buffer, post->v_buffer, source->uv_stride, post->uv_stride, source->uv_height, source->uv_width, ppl); } void vp8_de_noise(YV12_BUFFER_CONFIG *source, @@ -353,104 +329,96 @@ void vp8_de_noise(YV12_BUFFER_CONFIG *source, int q, int low_var_thresh, int flag, - vp8_postproc_rtcd_vtable_t *rtcd) -{ - double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065; - int ppl = (int)(level + .5); - (void) post; - (void) low_var_thresh; - (void) flag; - - POSTPROC_INVOKE(rtcd, downacross)( - source->y_buffer + 2 * source->y_stride + 2, - source->y_buffer + 2 * source->y_stride + 2, - source->y_stride, - source->y_stride, - source->y_height - 4, - source->y_width - 4, - ppl); - POSTPROC_INVOKE(rtcd, downacross)( - source->u_buffer + 2 * source->uv_stride + 2, - source->u_buffer + 2 * source->uv_stride + 2, - source->uv_stride, - source->uv_stride, - source->uv_height - 4, - source->uv_width - 4, ppl); - POSTPROC_INVOKE(rtcd, downacross)( - source->v_buffer + 2 * source->uv_stride + 2, - source->v_buffer + 2 * source->uv_stride + 2, - source->uv_stride, - source->uv_stride, - source->uv_height - 4, - source->uv_width - 4, ppl); + vp8_postproc_rtcd_vtable_t *rtcd) { + double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065; + int ppl = (int)(level + .5); + (void) post; + (void) low_var_thresh; + (void) flag; + + POSTPROC_INVOKE(rtcd, downacross)( + source->y_buffer + 2 * source->y_stride + 2, + source->y_buffer + 2 * source->y_stride + 2, + source->y_stride, + source->y_stride, + source->y_height - 4, + source->y_width - 4, + ppl); + POSTPROC_INVOKE(rtcd, downacross)( + source->u_buffer + 2 * source->uv_stride + 2, + source->u_buffer + 2 * source->uv_stride + 2, + source->uv_stride, + source->uv_stride, + source->uv_height - 4, + source->uv_width - 4, ppl); + POSTPROC_INVOKE(rtcd, downacross)( + source->v_buffer + 2 * source->uv_stride + 2, + source->v_buffer + 2 * source->uv_stride + 2, + source->uv_stride, + source->uv_stride, + source->uv_height - 4, + source->uv_width - 4, ppl); } -double vp8_gaussian(double sigma, double mu, double x) -{ - return 1 / (sigma * sqrt(2.0 * 3.14159265)) * - (exp(-(x - mu) * (x - mu) / (2 * sigma * sigma))); +double vp8_gaussian(double sigma, double mu, double x) { + return 1 / (sigma * sqrt(2.0 * 3.14159265)) * + (exp(-(x - mu) * (x - mu) / (2 * sigma * sigma))); } extern void (*vp8_clear_system_state)(void); -static void fillrd(struct postproc_state *state, int q, int a) -{ - char char_dist[300]; - - double sigma; - int ai = a, qi = q, i; - - vp8_clear_system_state(); +static void fillrd(struct postproc_state *state, int q, int a) { + char char_dist[300]; + double sigma; + int ai = a, qi = q, i; - sigma = ai + .5 + .6 * (63 - qi) / 63.0; + vp8_clear_system_state(); - /* set up a lookup table of 256 entries that matches - * a gaussian distribution with sigma determined by q. - */ - { - double i; - int next, j; - next = 0; + sigma = ai + .5 + .6 * (63 - qi) / 63.0; - for (i = -32; i < 32; i++) - { - int a = (int)(.5 + 256 * vp8_gaussian(sigma, 0, i)); + /* set up a lookup table of 256 entries that matches + * a gaussian distribution with sigma determined by q. + */ + { + double i; + int next, j; - if (a) - { - for (j = 0; j < a; j++) - { - char_dist[next+j] = (char) i; - } + next = 0; - next = next + j; - } + for (i = -32; i < 32; i++) { + int a = (int)(.5 + 256 * vp8_gaussian(sigma, 0, i)); + if (a) { + for (j = 0; j < a; j++) { + char_dist[next + j] = (char) i; } - for (next = next; next < 256; next++) - char_dist[next] = 0; + next = next + j; + } } - for (i = 0; i < 3072; i++) - { - state->noise[i] = char_dist[rand() & 0xff]; - } + for (next = next; next < 256; next++) + char_dist[next] = 0; - for (i = 0; i < 16; i++) - { - state->blackclamp[i] = -char_dist[0]; - state->whiteclamp[i] = -char_dist[0]; - state->bothclamp[i] = -2 * char_dist[0]; - } + } + + for (i = 0; i < 3072; i++) { + state->noise[i] = char_dist[rand() & 0xff]; + } - state->last_q = q; - state->last_noise = a; + for (i = 0; i < 16; i++) { + state->blackclamp[i] = -char_dist[0]; + state->whiteclamp[i] = -char_dist[0]; + state->bothclamp[i] = -2 * char_dist[0]; + } + + state->last_q = q; + state->last_noise = a; } /**************************************************************************** @@ -478,206 +446,179 @@ void vp8_plane_add_noise_c(unsigned char *Start, char *noise, char blackclamp[16], char whiteclamp[16], char bothclamp[16], - unsigned int Width, unsigned int Height, int Pitch) -{ - unsigned int i, j; + unsigned int Width, unsigned int Height, int Pitch) { + unsigned int i, j; - for (i = 0; i < Height; i++) - { - unsigned char *Pos = Start + i * Pitch; - char *Ref = (char *)(noise + (rand() & 0xff)); + for (i = 0; i < Height; i++) { + unsigned char *Pos = Start + i * Pitch; + char *Ref = (char *)(noise + (rand() & 0xff)); - for (j = 0; j < Width; j++) - { - if (Pos[j] < blackclamp[0]) - Pos[j] = blackclamp[0]; + for (j = 0; j < Width; j++) { + if (Pos[j] < blackclamp[0]) + Pos[j] = blackclamp[0]; - if (Pos[j] > 255 + whiteclamp[0]) - Pos[j] = 255 + whiteclamp[0]; + if (Pos[j] > 255 + whiteclamp[0]) + Pos[j] = 255 + whiteclamp[0]; - Pos[j] += Ref[j]; - } + Pos[j] += Ref[j]; } + } } /* Blend the macro block with a solid colored square. Leave the * edges unblended to give distinction to macro blocks in areas * filled with the same color block. */ -void vp8_blend_mb_inner_c (unsigned char *y, unsigned char *u, unsigned char *v, - int y1, int u1, int v1, int alpha, int stride) -{ - int i, j; - int y1_const = y1*((1<<16)-alpha); - int u1_const = u1*((1<<16)-alpha); - int v1_const = v1*((1<<16)-alpha); - - y += 2*stride + 2; - for (i = 0; i < 12; i++) - { - for (j = 0; j < 12; j++) - { - y[j] = (y[j]*alpha + y1_const)>>16; - } - y += stride; +void vp8_blend_mb_inner_c(unsigned char *y, unsigned char *u, unsigned char *v, + int y1, int u1, int v1, int alpha, int stride) { + int i, j; + int y1_const = y1 * ((1 << 16) - alpha); + int u1_const = u1 * ((1 << 16) - alpha); + int v1_const = v1 * ((1 << 16) - alpha); + + y += 2 * stride + 2; + for (i = 0; i < 12; i++) { + for (j = 0; j < 12; j++) { + y[j] = (y[j] * alpha + y1_const) >> 16; } + y += stride; + } - stride >>= 1; + stride >>= 1; - u += stride + 1; - v += stride + 1; + u += stride + 1; + v += stride + 1; - for (i = 0; i < 6; i++) - { - for (j = 0; j < 6; j++) - { - u[j] = (u[j]*alpha + u1_const)>>16; - v[j] = (v[j]*alpha + v1_const)>>16; - } - u += stride; - v += stride; + for (i = 0; i < 6; i++) { + for (j = 0; j < 6; j++) { + u[j] = (u[j] * alpha + u1_const) >> 16; + v[j] = (v[j] * alpha + v1_const) >> 16; } + u += stride; + v += stride; + } } /* Blend only the edge of the macro block. Leave center * unblended to allow for other visualizations to be layered. */ -void vp8_blend_mb_outer_c (unsigned char *y, unsigned char *u, unsigned char *v, - int y1, int u1, int v1, int alpha, int stride) -{ - int i, j; - int y1_const = y1*((1<<16)-alpha); - int u1_const = u1*((1<<16)-alpha); - int v1_const = v1*((1<<16)-alpha); - - for (i = 0; i < 2; i++) - { - for (j = 0; j < 16; j++) - { - y[j] = (y[j]*alpha + y1_const)>>16; - } - y += stride; - } +void vp8_blend_mb_outer_c(unsigned char *y, unsigned char *u, unsigned char *v, + int y1, int u1, int v1, int alpha, int stride) { + int i, j; + int y1_const = y1 * ((1 << 16) - alpha); + int u1_const = u1 * ((1 << 16) - alpha); + int v1_const = v1 * ((1 << 16) - alpha); + + for (i = 0; i < 2; i++) { + for (j = 0; j < 16; j++) { + y[j] = (y[j] * alpha + y1_const) >> 16; + } + y += stride; + } + + for (i = 0; i < 12; i++) { + y[0] = (y[0] * alpha + y1_const) >> 16; + y[1] = (y[1] * alpha + y1_const) >> 16; + y[14] = (y[14] * alpha + y1_const) >> 16; + y[15] = (y[15] * alpha + y1_const) >> 16; + y += stride; + } + + for (i = 0; i < 2; i++) { + for (j = 0; j < 16; j++) { + y[j] = (y[j] * alpha + y1_const) >> 16; + } + y += stride; + } + + stride >>= 1; + + for (j = 0; j < 8; j++) { + u[j] = (u[j] * alpha + u1_const) >> 16; + v[j] = (v[j] * alpha + v1_const) >> 16; + } + u += stride; + v += stride; + + for (i = 0; i < 6; i++) { + u[0] = (u[0] * alpha + u1_const) >> 16; + v[0] = (v[0] * alpha + v1_const) >> 16; + + u[7] = (u[7] * alpha + u1_const) >> 16; + v[7] = (v[7] * alpha + v1_const) >> 16; - for (i = 0; i < 12; i++) - { - y[0] = (y[0]*alpha + y1_const)>>16; - y[1] = (y[1]*alpha + y1_const)>>16; - y[14] = (y[14]*alpha + y1_const)>>16; - y[15] = (y[15]*alpha + y1_const)>>16; - y += stride; - } - - for (i = 0; i < 2; i++) - { - for (j = 0; j < 16; j++) - { - y[j] = (y[j]*alpha + y1_const)>>16; - } - y += stride; - } - - stride >>= 1; - - for (j = 0; j < 8; j++) - { - u[j] = (u[j]*alpha + u1_const)>>16; - v[j] = (v[j]*alpha + v1_const)>>16; - } u += stride; v += stride; + } - for (i = 0; i < 6; i++) - { - u[0] = (u[0]*alpha + u1_const)>>16; - v[0] = (v[0]*alpha + v1_const)>>16; - - u[7] = (u[7]*alpha + u1_const)>>16; - v[7] = (v[7]*alpha + v1_const)>>16; - - u += stride; - v += stride; - } - - for (j = 0; j < 8; j++) - { - u[j] = (u[j]*alpha + u1_const)>>16; - v[j] = (v[j]*alpha + v1_const)>>16; - } + for (j = 0; j < 8; j++) { + u[j] = (u[j] * alpha + u1_const) >> 16; + v[j] = (v[j] * alpha + v1_const) >> 16; + } } -void vp8_blend_b_c (unsigned char *y, unsigned char *u, unsigned char *v, - int y1, int u1, int v1, int alpha, int stride) -{ - int i, j; - int y1_const = y1*((1<<16)-alpha); - int u1_const = u1*((1<<16)-alpha); - int v1_const = v1*((1<<16)-alpha); - - for (i = 0; i < 4; i++) - { - for (j = 0; j < 4; j++) - { - y[j] = (y[j]*alpha + y1_const)>>16; - } - y += stride; +void vp8_blend_b_c(unsigned char *y, unsigned char *u, unsigned char *v, + int y1, int u1, int v1, int alpha, int stride) { + int i, j; + int y1_const = y1 * ((1 << 16) - alpha); + int u1_const = u1 * ((1 << 16) - alpha); + int v1_const = v1 * ((1 << 16) - alpha); + + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + y[j] = (y[j] * alpha + y1_const) >> 16; } + y += stride; + } - stride >>= 1; + stride >>= 1; - for (i = 0; i < 2; i++) - { - for (j = 0; j < 2; j++) - { - u[j] = (u[j]*alpha + u1_const)>>16; - v[j] = (v[j]*alpha + v1_const)>>16; - } - u += stride; - v += stride; + for (i = 0; i < 2; i++) { + for (j = 0; j < 2; j++) { + u[j] = (u[j] * alpha + u1_const) >> 16; + v[j] = (v[j] * alpha + v1_const) >> 16; } + u += stride; + v += stride; + } } -static void constrain_line (int x0, int *x1, int y0, int *y1, int width, int height) -{ - int dx; - int dy; - - if (*x1 > width) - { - dx = *x1 - x0; - dy = *y1 - y0; - - *x1 = width; - if (dx) - *y1 = ((width-x0)*dy)/dx + y0; - } - if (*x1 < 0) - { - dx = *x1 - x0; - dy = *y1 - y0; - - *x1 = 0; - if (dx) - *y1 = ((0-x0)*dy)/dx + y0; - } - if (*y1 > height) - { - dx = *x1 - x0; - dy = *y1 - y0; - - *y1 = height; - if (dy) - *x1 = ((height-y0)*dx)/dy + x0; - } - if (*y1 < 0) - { - dx = *x1 - x0; - dy = *y1 - y0; - - *y1 = 0; - if (dy) - *x1 = ((0-y0)*dx)/dy + x0; - } +static void constrain_line(int x0, int *x1, int y0, int *y1, int width, int height) { + int dx; + int dy; + + if (*x1 > width) { + dx = *x1 - x0; + dy = *y1 - y0; + + *x1 = width; + if (dx) + *y1 = ((width - x0) * dy) / dx + y0; + } + if (*x1 < 0) { + dx = *x1 - x0; + dy = *y1 - y0; + + *x1 = 0; + if (dx) + *y1 = ((0 - x0) * dy) / dx + y0; + } + if (*y1 > height) { + dx = *x1 - x0; + dy = *y1 - y0; + + *y1 = height; + if (dy) + *x1 = ((height - y0) * dx) / dy + x0; + } + if (*y1 < 0) { + dx = *x1 - x0; + dy = *y1 - y0; + + *y1 = 0; + if (dy) + *x1 = ((0 - y0) * dx) / dy + x0; + } } @@ -687,432 +628,386 @@ static void constrain_line (int x0, int *x1, int y0, int *y1, int width, int hei #define RTCD_VTABLE(oci) NULL #endif -int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *ppflags) -{ - int q = oci->filter_level * 10 / 6; - int flags = ppflags->post_proc_flag; - int deblock_level = ppflags->deblocking_level; - int noise_level = ppflags->noise_level; +int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *ppflags) { + int q = oci->filter_level * 10 / 6; + int flags = ppflags->post_proc_flag; + int deblock_level = ppflags->deblocking_level; + int noise_level = ppflags->noise_level; - if (!oci->frame_to_show) - return -1; + if (!oci->frame_to_show) + return -1; - if (q > 63) - q = 63; + if (q > 63) + q = 63; - if (!flags) - { - *dest = *oci->frame_to_show; + if (!flags) { + *dest = *oci->frame_to_show; - /* handle problem with extending borders */ - dest->y_width = oci->Width; - dest->y_height = oci->Height; - dest->uv_height = dest->y_height / 2; - return 0; + /* handle problem with extending borders */ + dest->y_width = oci->Width; + dest->y_height = oci->Height; + dest->uv_height = dest->y_height / 2; + return 0; - } + } #if ARCH_X86||ARCH_X86_64 - vpx_reset_mmx_state(); + vpx_reset_mmx_state(); #endif - if (flags & VP8D_DEMACROBLOCK) - { - vp8_deblock_and_de_macro_block(oci->frame_to_show, &oci->post_proc_buffer, - q + (deblock_level - 5) * 10, 1, 0, RTCD_VTABLE(oci)); - } - else if (flags & VP8D_DEBLOCK) - { - vp8_deblock(oci->frame_to_show, &oci->post_proc_buffer, - q, 1, 0, RTCD_VTABLE(oci)); - } - else - { - vp8_yv12_copy_frame_ptr(oci->frame_to_show, &oci->post_proc_buffer); - } - - if (flags & VP8D_ADDNOISE) - { - if (oci->postproc_state.last_q != q - || oci->postproc_state.last_noise != noise_level) - { - fillrd(&oci->postproc_state, 63 - q, noise_level); - } - - POSTPROC_INVOKE(RTCD_VTABLE(oci), addnoise) - (oci->post_proc_buffer.y_buffer, - oci->postproc_state.noise, - oci->postproc_state.blackclamp, - oci->postproc_state.whiteclamp, - oci->postproc_state.bothclamp, - oci->post_proc_buffer.y_width, oci->post_proc_buffer.y_height, - oci->post_proc_buffer.y_stride); - } + if (flags & VP8D_DEMACROBLOCK) { + vp8_deblock_and_de_macro_block(oci->frame_to_show, &oci->post_proc_buffer, + q + (deblock_level - 5) * 10, 1, 0, RTCD_VTABLE(oci)); + } else if (flags & VP8D_DEBLOCK) { + vp8_deblock(oci->frame_to_show, &oci->post_proc_buffer, + q, 1, 0, RTCD_VTABLE(oci)); + } else { + vp8_yv12_copy_frame_ptr(oci->frame_to_show, &oci->post_proc_buffer); + } + + if (flags & VP8D_ADDNOISE) { + if (oci->postproc_state.last_q != q + || oci->postproc_state.last_noise != noise_level) { + fillrd(&oci->postproc_state, 63 - q, noise_level); + } + + POSTPROC_INVOKE(RTCD_VTABLE(oci), addnoise) + (oci->post_proc_buffer.y_buffer, + oci->postproc_state.noise, + oci->postproc_state.blackclamp, + oci->postproc_state.whiteclamp, + oci->postproc_state.bothclamp, + oci->post_proc_buffer.y_width, oci->post_proc_buffer.y_height, + oci->post_proc_buffer.y_stride); + } #if CONFIG_POSTPROC_VISUALIZER - if (flags & VP8D_DEBUG_TXT_FRAME_INFO) - { - char message[512]; - sprintf(message, "F%1dG%1dQ%3dF%3dP%d_s%dx%d", - (oci->frame_type == KEY_FRAME), - oci->refresh_golden_frame, - oci->base_qindex, - oci->filter_level, - flags, - oci->mb_cols, oci->mb_rows); - vp8_blit_text(message, oci->post_proc_buffer.y_buffer, oci->post_proc_buffer.y_stride); - } - - if (flags & VP8D_DEBUG_TXT_MBLK_MODES) - { - int i, j; - unsigned char *y_ptr; - YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; - int mb_rows = post->y_height >> 4; - int mb_cols = post->y_width >> 4; - int mb_index = 0; - MODE_INFO *mi = oci->mi; - - y_ptr = post->y_buffer + 4 * post->y_stride + 4; - - /* vp8_filter each macro block */ - for (i = 0; i < mb_rows; i++) - { - for (j = 0; j < mb_cols; j++) - { - char zz[4]; - - sprintf(zz, "%c", mi[mb_index].mbmi.mode + 'a'); - - vp8_blit_text(zz, y_ptr, post->y_stride); - mb_index ++; - y_ptr += 16; - } + if (flags & VP8D_DEBUG_TXT_FRAME_INFO) { + char message[512]; + sprintf(message, "F%1dG%1dQ%3dF%3dP%d_s%dx%d", + (oci->frame_type == KEY_FRAME), + oci->refresh_golden_frame, + oci->base_qindex, + oci->filter_level, + flags, + oci->mb_cols, oci->mb_rows); + vp8_blit_text(message, oci->post_proc_buffer.y_buffer, oci->post_proc_buffer.y_stride); + } + + if (flags & VP8D_DEBUG_TXT_MBLK_MODES) { + int i, j; + unsigned char *y_ptr; + YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; + int mb_rows = post->y_height >> 4; + int mb_cols = post->y_width >> 4; + int mb_index = 0; + MODE_INFO *mi = oci->mi; - mb_index ++; /* border */ - y_ptr += post->y_stride * 16 - post->y_width; + y_ptr = post->y_buffer + 4 * post->y_stride + 4; - } - } + /* vp8_filter each macro block */ + for (i = 0; i < mb_rows; i++) { + for (j = 0; j < mb_cols; j++) { + char zz[4]; - if (flags & VP8D_DEBUG_TXT_DC_DIFF) - { - int i, j; - unsigned char *y_ptr; - YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; - int mb_rows = post->y_height >> 4; - int mb_cols = post->y_width >> 4; - int mb_index = 0; - MODE_INFO *mi = oci->mi; - - y_ptr = post->y_buffer + 4 * post->y_stride + 4; - - /* vp8_filter each macro block */ - for (i = 0; i < mb_rows; i++) - { - for (j = 0; j < mb_cols; j++) - { - char zz[4]; - int dc_diff = !(mi[mb_index].mbmi.mode != B_PRED && - mi[mb_index].mbmi.mode != SPLITMV && - mi[mb_index].mbmi.mb_skip_coeff); - - if (oci->frame_type == KEY_FRAME) - sprintf(zz, "a"); - else - sprintf(zz, "%c", dc_diff + '0'); - - vp8_blit_text(zz, y_ptr, post->y_stride); - mb_index ++; - y_ptr += 16; - } + sprintf(zz, "%c", mi[mb_index].mbmi.mode + 'a'); - mb_index ++; /* border */ - y_ptr += post->y_stride * 16 - post->y_width; + vp8_blit_text(zz, y_ptr, post->y_stride); + mb_index++; + y_ptr += 16; + } - } - } + mb_index++; /* border */ + y_ptr += post->y_stride * 16 - post->y_width; - if (flags & VP8D_DEBUG_TXT_RATE_INFO) - { - char message[512]; - sprintf(message, "Bitrate: %10.2f frame_rate: %10.2f ", oci->bitrate, oci->framerate); - vp8_blit_text(message, oci->post_proc_buffer.y_buffer, oci->post_proc_buffer.y_stride); } + } - /* Draw motion vectors */ - if ((flags & VP8D_DEBUG_DRAW_MV) && ppflags->display_mv_flag) - { - YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; - int width = post->y_width; - int height = post->y_height; - unsigned char *y_buffer = oci->post_proc_buffer.y_buffer; - int y_stride = oci->post_proc_buffer.y_stride; - MODE_INFO *mi = oci->mi; - int x0, y0; - - for (y0 = 0; y0 < height; y0 += 16) - { - for (x0 = 0; x0 < width; x0 += 16) - { - int x1, y1; - - if (!(ppflags->display_mv_flag & (1<<mi->mbmi.mode))) - { - mi++; - continue; - } + if (flags & VP8D_DEBUG_TXT_DC_DIFF) { + int i, j; + unsigned char *y_ptr; + YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; + int mb_rows = post->y_height >> 4; + int mb_cols = post->y_width >> 4; + int mb_index = 0; + MODE_INFO *mi = oci->mi; + + y_ptr = post->y_buffer + 4 * post->y_stride + 4; + + /* vp8_filter each macro block */ + for (i = 0; i < mb_rows; i++) { + for (j = 0; j < mb_cols; j++) { + char zz[4]; + int dc_diff = !(mi[mb_index].mbmi.mode != B_PRED && + mi[mb_index].mbmi.mode != SPLITMV && + mi[mb_index].mbmi.mb_skip_coeff); + + if (oci->frame_type == KEY_FRAME) + sprintf(zz, "a"); + else + sprintf(zz, "%c", dc_diff + '0'); + + vp8_blit_text(zz, y_ptr, post->y_stride); + mb_index++; + y_ptr += 16; + } + + mb_index++; /* border */ + y_ptr += post->y_stride * 16 - post->y_width; + + } + } + + if (flags & VP8D_DEBUG_TXT_RATE_INFO) { + char message[512]; + sprintf(message, "Bitrate: %10.2f frame_rate: %10.2f ", oci->bitrate, oci->framerate); + vp8_blit_text(message, oci->post_proc_buffer.y_buffer, oci->post_proc_buffer.y_stride); + } + + /* Draw motion vectors */ + if ((flags & VP8D_DEBUG_DRAW_MV) && ppflags->display_mv_flag) { + YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; + int width = post->y_width; + int height = post->y_height; + unsigned char *y_buffer = oci->post_proc_buffer.y_buffer; + int y_stride = oci->post_proc_buffer.y_stride; + MODE_INFO *mi = oci->mi; + int x0, y0; + + for (y0 = 0; y0 < height; y0 += 16) { + for (x0 = 0; x0 < width; x0 += 16) { + int x1, y1; + + if (!(ppflags->display_mv_flag & (1 << mi->mbmi.mode))) { + mi++; + continue; + } - if (mi->mbmi.mode == SPLITMV) - { - switch (mi->mbmi.partitioning) - { - case 0 : /* mv_top_bottom */ - { - union b_mode_info *bmi = &mi->bmi[0]; - MV *mv = &bmi->mv.as_mv; + if (mi->mbmi.mode == SPLITMV) { + switch (mi->mbmi.partitioning) { + case 0 : { /* mv_top_bottom */ + union b_mode_info *bmi = &mi->bmi[0]; + MV *mv = &bmi->mv.as_mv; - x1 = x0 + 8 + (mv->col >> 3); - y1 = y0 + 4 + (mv->row >> 3); + x1 = x0 + 8 + (mv->col >> 3); + y1 = y0 + 4 + (mv->row >> 3); - constrain_line (x0+8, &x1, y0+4, &y1, width, height); - vp8_blit_line (x0+8, x1, y0+4, y1, y_buffer, y_stride); + constrain_line(x0 + 8, &x1, y0 + 4, &y1, width, height); + vp8_blit_line(x0 + 8, x1, y0 + 4, y1, y_buffer, y_stride); - bmi = &mi->bmi[8]; + bmi = &mi->bmi[8]; - x1 = x0 + 8 + (mv->col >> 3); - y1 = y0 +12 + (mv->row >> 3); + x1 = x0 + 8 + (mv->col >> 3); + y1 = y0 + 12 + (mv->row >> 3); - constrain_line (x0+8, &x1, y0+12, &y1, width, height); - vp8_blit_line (x0+8, x1, y0+12, y1, y_buffer, y_stride); + constrain_line(x0 + 8, &x1, y0 + 12, &y1, width, height); + vp8_blit_line(x0 + 8, x1, y0 + 12, y1, y_buffer, y_stride); - break; - } - case 1 : /* mv_left_right */ - { - union b_mode_info *bmi = &mi->bmi[0]; - MV *mv = &bmi->mv.as_mv; + break; + } + case 1 : { /* mv_left_right */ + union b_mode_info *bmi = &mi->bmi[0]; + MV *mv = &bmi->mv.as_mv; - x1 = x0 + 4 + (mv->col >> 3); - y1 = y0 + 8 + (mv->row >> 3); + x1 = x0 + 4 + (mv->col >> 3); + y1 = y0 + 8 + (mv->row >> 3); - constrain_line (x0+4, &x1, y0+8, &y1, width, height); - vp8_blit_line (x0+4, x1, y0+8, y1, y_buffer, y_stride); + constrain_line(x0 + 4, &x1, y0 + 8, &y1, width, height); + vp8_blit_line(x0 + 4, x1, y0 + 8, y1, y_buffer, y_stride); - bmi = &mi->bmi[2]; + bmi = &mi->bmi[2]; - x1 = x0 +12 + (mv->col >> 3); - y1 = y0 + 8 + (mv->row >> 3); + x1 = x0 + 12 + (mv->col >> 3); + y1 = y0 + 8 + (mv->row >> 3); - constrain_line (x0+12, &x1, y0+8, &y1, width, height); - vp8_blit_line (x0+12, x1, y0+8, y1, y_buffer, y_stride); + constrain_line(x0 + 12, &x1, y0 + 8, &y1, width, height); + vp8_blit_line(x0 + 12, x1, y0 + 8, y1, y_buffer, y_stride); - break; - } - case 2 : /* mv_quarters */ - { - union b_mode_info *bmi = &mi->bmi[0]; - MV *mv = &bmi->mv.as_mv; + break; + } + case 2 : { /* mv_quarters */ + union b_mode_info *bmi = &mi->bmi[0]; + MV *mv = &bmi->mv.as_mv; - x1 = x0 + 4 + (mv->col >> 3); - y1 = y0 + 4 + (mv->row >> 3); + x1 = x0 + 4 + (mv->col >> 3); + y1 = y0 + 4 + (mv->row >> 3); - constrain_line (x0+4, &x1, y0+4, &y1, width, height); - vp8_blit_line (x0+4, x1, y0+4, y1, y_buffer, y_stride); + constrain_line(x0 + 4, &x1, y0 + 4, &y1, width, height); + vp8_blit_line(x0 + 4, x1, y0 + 4, y1, y_buffer, y_stride); - bmi = &mi->bmi[2]; + bmi = &mi->bmi[2]; - x1 = x0 +12 + (mv->col >> 3); - y1 = y0 + 4 + (mv->row >> 3); + x1 = x0 + 12 + (mv->col >> 3); + y1 = y0 + 4 + (mv->row >> 3); - constrain_line (x0+12, &x1, y0+4, &y1, width, height); - vp8_blit_line (x0+12, x1, y0+4, y1, y_buffer, y_stride); + constrain_line(x0 + 12, &x1, y0 + 4, &y1, width, height); + vp8_blit_line(x0 + 12, x1, y0 + 4, y1, y_buffer, y_stride); - bmi = &mi->bmi[8]; + bmi = &mi->bmi[8]; - x1 = x0 + 4 + (mv->col >> 3); - y1 = y0 +12 + (mv->row >> 3); + x1 = x0 + 4 + (mv->col >> 3); + y1 = y0 + 12 + (mv->row >> 3); - constrain_line (x0+4, &x1, y0+12, &y1, width, height); - vp8_blit_line (x0+4, x1, y0+12, y1, y_buffer, y_stride); + constrain_line(x0 + 4, &x1, y0 + 12, &y1, width, height); + vp8_blit_line(x0 + 4, x1, y0 + 12, y1, y_buffer, y_stride); - bmi = &mi->bmi[10]; + bmi = &mi->bmi[10]; - x1 = x0 +12 + (mv->col >> 3); - y1 = y0 +12 + (mv->row >> 3); + x1 = x0 + 12 + (mv->col >> 3); + y1 = y0 + 12 + (mv->row >> 3); - constrain_line (x0+12, &x1, y0+12, &y1, width, height); - vp8_blit_line (x0+12, x1, y0+12, y1, y_buffer, y_stride); - break; - } - default : - { - union b_mode_info *bmi = mi->bmi; - int bx0, by0; + constrain_line(x0 + 12, &x1, y0 + 12, &y1, width, height); + vp8_blit_line(x0 + 12, x1, y0 + 12, y1, y_buffer, y_stride); + break; + } + default : { + union b_mode_info *bmi = mi->bmi; + int bx0, by0; - for (by0 = y0; by0 < (y0+16); by0 += 4) - { - for (bx0 = x0; bx0 < (x0+16); bx0 += 4) - { - MV *mv = &bmi->mv.as_mv; + for (by0 = y0; by0 < (y0 + 16); by0 += 4) { + for (bx0 = x0; bx0 < (x0 + 16); bx0 += 4) { + MV *mv = &bmi->mv.as_mv; - x1 = bx0 + 2 + (mv->col >> 3); - y1 = by0 + 2 + (mv->row >> 3); + x1 = bx0 + 2 + (mv->col >> 3); + y1 = by0 + 2 + (mv->row >> 3); - constrain_line (bx0+2, &x1, by0+2, &y1, width, height); - vp8_blit_line (bx0+2, x1, by0+2, y1, y_buffer, y_stride); + constrain_line(bx0 + 2, &x1, by0 + 2, &y1, width, height); + vp8_blit_line(bx0 + 2, x1, by0 + 2, y1, y_buffer, y_stride); - bmi++; - } - } - } - } + bmi++; } - else if (mi->mbmi.mode >= NEARESTMV) - { - MV *mv = &mi->mbmi.mv.as_mv; - const int lx0 = x0 + 8; - const int ly0 = y0 + 8; - - x1 = lx0 + (mv->col >> 3); - y1 = ly0 + (mv->row >> 3); - - if (x1 != lx0 && y1 != ly0) - { - constrain_line (lx0, &x1, ly0-1, &y1, width, height); - vp8_blit_line (lx0, x1, ly0-1, y1, y_buffer, y_stride); - - constrain_line (lx0, &x1, ly0+1, &y1, width, height); - vp8_blit_line (lx0, x1, ly0+1, y1, y_buffer, y_stride); - } - else - vp8_blit_line (lx0, x1, ly0, y1, y_buffer, y_stride); - } - - mi++; + } } - mi++; + } + } else if (mi->mbmi.mode >= NEARESTMV) { + MV *mv = &mi->mbmi.mv.as_mv; + const int lx0 = x0 + 8; + const int ly0 = y0 + 8; + + x1 = lx0 + (mv->col >> 3); + y1 = ly0 + (mv->row >> 3); + + if (x1 != lx0 && y1 != ly0) { + constrain_line(lx0, &x1, ly0 - 1, &y1, width, height); + vp8_blit_line(lx0, x1, ly0 - 1, y1, y_buffer, y_stride); + + constrain_line(lx0, &x1, ly0 + 1, &y1, width, height); + vp8_blit_line(lx0, x1, ly0 + 1, y1, y_buffer, y_stride); + } else + vp8_blit_line(lx0, x1, ly0, y1, y_buffer, y_stride); } - } - /* Color in block modes */ - if ((flags & VP8D_DEBUG_CLR_BLK_MODES) - && (ppflags->display_mb_modes_flag || ppflags->display_b_modes_flag)) - { - int y, x; - YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; - int width = post->y_width; - int height = post->y_height; - unsigned char *y_ptr = oci->post_proc_buffer.y_buffer; - unsigned char *u_ptr = oci->post_proc_buffer.u_buffer; - unsigned char *v_ptr = oci->post_proc_buffer.v_buffer; - int y_stride = oci->post_proc_buffer.y_stride; - MODE_INFO *mi = oci->mi; - - for (y = 0; y < height; y += 16) - { - for (x = 0; x < width; x += 16) - { - int Y = 0, U = 0, V = 0; - - if (mi->mbmi.mode == B_PRED && - ((ppflags->display_mb_modes_flag & B_PRED) || ppflags->display_b_modes_flag)) - { - int by, bx; - unsigned char *yl, *ul, *vl; - union b_mode_info *bmi = mi->bmi; - - yl = y_ptr + x; - ul = u_ptr + (x>>1); - vl = v_ptr + (x>>1); - - for (by = 0; by < 16; by += 4) - { - for (bx = 0; bx < 16; bx += 4) - { - if ((ppflags->display_b_modes_flag & (1<<mi->mbmi.mode)) - || (ppflags->display_mb_modes_flag & B_PRED)) - { - Y = B_PREDICTION_MODE_colors[bmi->as_mode.first][0]; - U = B_PREDICTION_MODE_colors[bmi->as_mode.first][1]; - V = B_PREDICTION_MODE_colors[bmi->as_mode.first][2]; - - POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_b) - (yl+bx, ul+(bx>>1), vl+(bx>>1), Y, U, V, 0xc000, y_stride); - } - bmi++; - } - - yl += y_stride*4; - ul += y_stride*1; - vl += y_stride*1; - } - } - else if (ppflags->display_mb_modes_flag & (1<<mi->mbmi.mode)) - { - Y = MB_PREDICTION_MODE_colors[mi->mbmi.mode][0]; - U = MB_PREDICTION_MODE_colors[mi->mbmi.mode][1]; - V = MB_PREDICTION_MODE_colors[mi->mbmi.mode][2]; - - POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_mb_inner) - (y_ptr+x, u_ptr+(x>>1), v_ptr+(x>>1), Y, U, V, 0xc000, y_stride); - } - - mi++; + mi++; + } + mi++; + } + } + + /* Color in block modes */ + if ((flags & VP8D_DEBUG_CLR_BLK_MODES) + && (ppflags->display_mb_modes_flag || ppflags->display_b_modes_flag)) { + int y, x; + YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; + int width = post->y_width; + int height = post->y_height; + unsigned char *y_ptr = oci->post_proc_buffer.y_buffer; + unsigned char *u_ptr = oci->post_proc_buffer.u_buffer; + unsigned char *v_ptr = oci->post_proc_buffer.v_buffer; + int y_stride = oci->post_proc_buffer.y_stride; + MODE_INFO *mi = oci->mi; + + for (y = 0; y < height; y += 16) { + for (x = 0; x < width; x += 16) { + int Y = 0, U = 0, V = 0; + + if (mi->mbmi.mode == B_PRED && + ((ppflags->display_mb_modes_flag & B_PRED) || ppflags->display_b_modes_flag)) { + int by, bx; + unsigned char *yl, *ul, *vl; + union b_mode_info *bmi = mi->bmi; + + yl = y_ptr + x; + ul = u_ptr + (x >> 1); + vl = v_ptr + (x >> 1); + + for (by = 0; by < 16; by += 4) { + for (bx = 0; bx < 16; bx += 4) { + if ((ppflags->display_b_modes_flag & (1 << mi->mbmi.mode)) + || (ppflags->display_mb_modes_flag & B_PRED)) { + Y = B_PREDICTION_MODE_colors[bmi->as_mode.first][0]; + U = B_PREDICTION_MODE_colors[bmi->as_mode.first][1]; + V = B_PREDICTION_MODE_colors[bmi->as_mode.first][2]; + + POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_b) + (yl + bx, ul + (bx >> 1), vl + (bx >> 1), Y, U, V, 0xc000, y_stride); + } + bmi++; } - y_ptr += y_stride*16; - u_ptr += y_stride*4; - v_ptr += y_stride*4; - mi++; + yl += y_stride * 4; + ul += y_stride * 1; + vl += y_stride * 1; + } + } else if (ppflags->display_mb_modes_flag & (1 << mi->mbmi.mode)) { + Y = MB_PREDICTION_MODE_colors[mi->mbmi.mode][0]; + U = MB_PREDICTION_MODE_colors[mi->mbmi.mode][1]; + V = MB_PREDICTION_MODE_colors[mi->mbmi.mode][2]; + + POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_mb_inner) + (y_ptr + x, u_ptr + (x >> 1), v_ptr + (x >> 1), Y, U, V, 0xc000, y_stride); } - } - /* Color in frame reference blocks */ - if ((flags & VP8D_DEBUG_CLR_FRM_REF_BLKS) && ppflags->display_ref_frame_flag) - { - int y, x; - YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; - int width = post->y_width; - int height = post->y_height; - unsigned char *y_ptr = oci->post_proc_buffer.y_buffer; - unsigned char *u_ptr = oci->post_proc_buffer.u_buffer; - unsigned char *v_ptr = oci->post_proc_buffer.v_buffer; - int y_stride = oci->post_proc_buffer.y_stride; - MODE_INFO *mi = oci->mi; - - for (y = 0; y < height; y += 16) - { - for (x = 0; x < width; x +=16) - { - int Y = 0, U = 0, V = 0; - - if (ppflags->display_ref_frame_flag & (1<<mi->mbmi.ref_frame)) - { - Y = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][0]; - U = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][1]; - V = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][2]; - - POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_mb_outer) - (y_ptr+x, u_ptr+(x>>1), v_ptr+(x>>1), Y, U, V, 0xc000, y_stride); - } + mi++; + } + y_ptr += y_stride * 16; + u_ptr += y_stride * 4; + v_ptr += y_stride * 4; + + mi++; + } + } + + /* Color in frame reference blocks */ + if ((flags & VP8D_DEBUG_CLR_FRM_REF_BLKS) && ppflags->display_ref_frame_flag) { + int y, x; + YV12_BUFFER_CONFIG *post = &oci->post_proc_buffer; + int width = post->y_width; + int height = post->y_height; + unsigned char *y_ptr = oci->post_proc_buffer.y_buffer; + unsigned char *u_ptr = oci->post_proc_buffer.u_buffer; + unsigned char *v_ptr = oci->post_proc_buffer.v_buffer; + int y_stride = oci->post_proc_buffer.y_stride; + MODE_INFO *mi = oci->mi; + + for (y = 0; y < height; y += 16) { + for (x = 0; x < width; x += 16) { + int Y = 0, U = 0, V = 0; + + if (ppflags->display_ref_frame_flag & (1 << mi->mbmi.ref_frame)) { + Y = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][0]; + U = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][1]; + V = MV_REFERENCE_FRAME_colors[mi->mbmi.ref_frame][2]; + + POSTPROC_INVOKE(RTCD_VTABLE(oci), blend_mb_outer) + (y_ptr + x, u_ptr + (x >> 1), v_ptr + (x >> 1), Y, U, V, 0xc000, y_stride); + } - mi++; - } - y_ptr += y_stride*16; - u_ptr += y_stride*4; - v_ptr += y_stride*4; + mi++; + } + y_ptr += y_stride * 16; + u_ptr += y_stride * 4; + v_ptr += y_stride * 4; - mi++; - } + mi++; } + } #endif - *dest = oci->post_proc_buffer; + *dest = oci->post_proc_buffer; - /* handle problem with extending borders */ - dest->y_width = oci->Width; - dest->y_height = oci->Height; - dest->uv_height = dest->y_height / 2; - return 0; + /* handle problem with extending borders */ + dest->y_width = oci->Width; + dest->y_height = oci->Height; + dest->uv_height = dest->y_height / 2; + return 0; } diff --git a/vp8/common/postproc.h b/vp8/common/postproc.h index c641b9ca5..322089210 100644 --- a/vp8/common/postproc.h +++ b/vp8/common/postproc.h @@ -13,28 +13,28 @@ #define POSTPROC_H #define prototype_postproc_inplace(sym)\ - void sym (unsigned char *dst, int pitch, int rows, int cols,int flimit) + void sym (unsigned char *dst, int pitch, int rows, int cols,int flimit) #define prototype_postproc(sym)\ - void sym (unsigned char *src, unsigned char *dst, int src_pitch,\ - int dst_pitch, int rows, int cols, int flimit) + void sym (unsigned char *src, unsigned char *dst, int src_pitch,\ + int dst_pitch, int rows, int cols, int flimit) #define prototype_postproc_addnoise(sym) \ - void sym (unsigned char *s, char *noise, char blackclamp[16],\ - char whiteclamp[16], char bothclamp[16],\ - unsigned int w, unsigned int h, int pitch) + void sym (unsigned char *s, char *noise, char blackclamp[16],\ + char whiteclamp[16], char bothclamp[16],\ + unsigned int w, unsigned int h, int pitch) #define prototype_postproc_blend_mb_inner(sym)\ - void sym (unsigned char *y, unsigned char *u, unsigned char *v,\ - int y1, int u1, int v1, int alpha, int stride) + void sym (unsigned char *y, unsigned char *u, unsigned char *v,\ + int y1, int u1, int v1, int alpha, int stride) #define prototype_postproc_blend_mb_outer(sym)\ - void sym (unsigned char *y, unsigned char *u, unsigned char *v,\ - int y1, int u1, int v1, int alpha, int stride) + void sym (unsigned char *y, unsigned char *u, unsigned char *v,\ + int y1, int u1, int v1, int alpha, int stride) #define prototype_postproc_blend_b(sym)\ - void sym (unsigned char *y, unsigned char *u, unsigned char *v,\ - int y1, int u1, int v1, int alpha, int stride) + void sym (unsigned char *y, unsigned char *u, unsigned char *v,\ + int y1, int u1, int v1, int alpha, int stride) #if ARCH_X86 || ARCH_X86_64 #include "x86/postproc_x86.h" @@ -81,15 +81,14 @@ typedef prototype_postproc_addnoise((*vp8_postproc_addnoise_fn_t)); typedef prototype_postproc_blend_mb_inner((*vp8_postproc_blend_mb_inner_fn_t)); typedef prototype_postproc_blend_mb_outer((*vp8_postproc_blend_mb_outer_fn_t)); typedef prototype_postproc_blend_b((*vp8_postproc_blend_b_fn_t)); -typedef struct -{ - vp8_postproc_inplace_fn_t down; - vp8_postproc_inplace_fn_t across; - vp8_postproc_fn_t downacross; - vp8_postproc_addnoise_fn_t addnoise; - vp8_postproc_blend_mb_inner_fn_t blend_mb_inner; - vp8_postproc_blend_mb_outer_fn_t blend_mb_outer; - vp8_postproc_blend_b_fn_t blend_b; +typedef struct { + vp8_postproc_inplace_fn_t down; + vp8_postproc_inplace_fn_t across; + vp8_postproc_fn_t downacross; + vp8_postproc_addnoise_fn_t addnoise; + vp8_postproc_blend_mb_inner_fn_t blend_mb_inner; + vp8_postproc_blend_mb_outer_fn_t blend_mb_outer; + vp8_postproc_blend_b_fn_t blend_b; } vp8_postproc_rtcd_vtable_t; #if CONFIG_RUNTIME_CPU_DETECT @@ -99,14 +98,13 @@ typedef struct #endif #include "vpx_ports/mem.h" -struct postproc_state -{ - int last_q; - int last_noise; - char noise[3072]; - DECLARE_ALIGNED(16, char, blackclamp[16]); - DECLARE_ALIGNED(16, char, whiteclamp[16]); - DECLARE_ALIGNED(16, char, bothclamp[16]); +struct postproc_state { + int last_q; + int last_noise; + char noise[3072]; + DECLARE_ALIGNED(16, char, blackclamp[16]); + DECLARE_ALIGNED(16, char, whiteclamp[16]); + DECLARE_ALIGNED(16, char, bothclamp[16]); }; #include "onyxc_int.h" #include "ppflags.h" diff --git a/vp8/common/ppc/loopfilter_altivec.c b/vp8/common/ppc/loopfilter_altivec.c index 71bf6e2d7..962da2319 100644 --- a/vp8/common/ppc/loopfilter_altivec.c +++ b/vp8/common/ppc/loopfilter_altivec.c @@ -14,28 +14,28 @@ typedef void loop_filter_function_y_ppc ( - unsigned char *s, // source pointer - int p, // pitch - const signed char *flimit, - const signed char *limit, - const signed char *thresh + unsigned char *s, // source pointer + int p, // pitch + const signed char *flimit, + const signed char *limit, + const signed char *thresh ); typedef void loop_filter_function_uv_ppc ( - unsigned char *u, // source pointer - unsigned char *v, // source pointer - int p, // pitch - const signed char *flimit, - const signed char *limit, - const signed char *thresh + unsigned char *u, // source pointer + unsigned char *v, // source pointer + int p, // pitch + const signed char *flimit, + const signed char *limit, + const signed char *thresh ); typedef void loop_filter_function_s_ppc ( - unsigned char *s, // source pointer - int p, // pitch - const signed char *flimit + unsigned char *s, // source pointer + int p, // pitch + const signed char *flimit ); loop_filter_function_y_ppc mbloop_filter_horizontal_edge_y_ppc; @@ -53,83 +53,75 @@ loop_filter_function_s_ppc loop_filter_simple_vertical_edge_ppc; // Horizontal MB filtering void loop_filter_mbh_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - mbloop_filter_horizontal_edge_y_ppc(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr); + int y_stride, int uv_stride, loop_filter_info *lfi) { + mbloop_filter_horizontal_edge_y_ppc(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr); - if (u_ptr) - mbloop_filter_horizontal_edge_uv_ppc(u_ptr, v_ptr, uv_stride, lfi->mbflim, lfi->lim, lfi->thr); + if (u_ptr) + mbloop_filter_horizontal_edge_uv_ppc(u_ptr, v_ptr, uv_stride, lfi->mbflim, lfi->lim, lfi->thr); } void loop_filter_mbhs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - (void)u_ptr; - (void)v_ptr; - (void)uv_stride; - loop_filter_simple_horizontal_edge_ppc(y_ptr, y_stride, lfi->mbflim); + int y_stride, int uv_stride, loop_filter_info *lfi) { + (void)u_ptr; + (void)v_ptr; + (void)uv_stride; + loop_filter_simple_horizontal_edge_ppc(y_ptr, y_stride, lfi->mbflim); } // Vertical MB Filtering void loop_filter_mbv_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - mbloop_filter_vertical_edge_y_ppc(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr); + int y_stride, int uv_stride, loop_filter_info *lfi) { + mbloop_filter_vertical_edge_y_ppc(y_ptr, y_stride, lfi->mbflim, lfi->lim, lfi->thr); - if (u_ptr) - mbloop_filter_vertical_edge_uv_ppc(u_ptr, v_ptr, uv_stride, lfi->mbflim, lfi->lim, lfi->thr); + if (u_ptr) + mbloop_filter_vertical_edge_uv_ppc(u_ptr, v_ptr, uv_stride, lfi->mbflim, lfi->lim, lfi->thr); } void loop_filter_mbvs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - (void)u_ptr; - (void)v_ptr; - (void)uv_stride; - loop_filter_simple_vertical_edge_ppc(y_ptr, y_stride, lfi->mbflim); + int y_stride, int uv_stride, loop_filter_info *lfi) { + (void)u_ptr; + (void)v_ptr; + (void)uv_stride; + loop_filter_simple_vertical_edge_ppc(y_ptr, y_stride, lfi->mbflim); } // Horizontal B Filtering void loop_filter_bh_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - // These should all be done at once with one call, instead of 3 - loop_filter_horizontal_edge_y_ppc(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr); - loop_filter_horizontal_edge_y_ppc(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr); - loop_filter_horizontal_edge_y_ppc(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr); - - if (u_ptr) - loop_filter_horizontal_edge_uv_ppc(u_ptr + 4 * uv_stride, v_ptr + 4 * uv_stride, uv_stride, lfi->flim, lfi->lim, lfi->thr); + int y_stride, int uv_stride, loop_filter_info *lfi) { + // These should all be done at once with one call, instead of 3 + loop_filter_horizontal_edge_y_ppc(y_ptr + 4 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr); + loop_filter_horizontal_edge_y_ppc(y_ptr + 8 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr); + loop_filter_horizontal_edge_y_ppc(y_ptr + 12 * y_stride, y_stride, lfi->flim, lfi->lim, lfi->thr); + + if (u_ptr) + loop_filter_horizontal_edge_uv_ppc(u_ptr + 4 * uv_stride, v_ptr + 4 * uv_stride, uv_stride, lfi->flim, lfi->lim, lfi->thr); } void loop_filter_bhs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - (void)u_ptr; - (void)v_ptr; - (void)uv_stride; - loop_filter_simple_horizontal_edge_ppc(y_ptr + 4 * y_stride, y_stride, lfi->flim); - loop_filter_simple_horizontal_edge_ppc(y_ptr + 8 * y_stride, y_stride, lfi->flim); - loop_filter_simple_horizontal_edge_ppc(y_ptr + 12 * y_stride, y_stride, lfi->flim); + int y_stride, int uv_stride, loop_filter_info *lfi) { + (void)u_ptr; + (void)v_ptr; + (void)uv_stride; + loop_filter_simple_horizontal_edge_ppc(y_ptr + 4 * y_stride, y_stride, lfi->flim); + loop_filter_simple_horizontal_edge_ppc(y_ptr + 8 * y_stride, y_stride, lfi->flim); + loop_filter_simple_horizontal_edge_ppc(y_ptr + 12 * y_stride, y_stride, lfi->flim); } // Vertical B Filtering void loop_filter_bv_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - loop_filter_vertical_edge_y_ppc(y_ptr, y_stride, lfi->flim, lfi->lim, lfi->thr); + int y_stride, int uv_stride, loop_filter_info *lfi) { + loop_filter_vertical_edge_y_ppc(y_ptr, y_stride, lfi->flim, lfi->lim, lfi->thr); - if (u_ptr) - loop_filter_vertical_edge_uv_ppc(u_ptr + 4, v_ptr + 4, uv_stride, lfi->flim, lfi->lim, lfi->thr); + if (u_ptr) + loop_filter_vertical_edge_uv_ppc(u_ptr + 4, v_ptr + 4, uv_stride, lfi->flim, lfi->lim, lfi->thr); } void loop_filter_bvs_ppc(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - (void)u_ptr; - (void)v_ptr; - (void)uv_stride; - loop_filter_simple_vertical_edge_ppc(y_ptr + 4, y_stride, lfi->flim); - loop_filter_simple_vertical_edge_ppc(y_ptr + 8, y_stride, lfi->flim); - loop_filter_simple_vertical_edge_ppc(y_ptr + 12, y_stride, lfi->flim); + int y_stride, int uv_stride, loop_filter_info *lfi) { + (void)u_ptr; + (void)v_ptr; + (void)uv_stride; + loop_filter_simple_vertical_edge_ppc(y_ptr + 4, y_stride, lfi->flim); + loop_filter_simple_vertical_edge_ppc(y_ptr + 8, y_stride, lfi->flim); + loop_filter_simple_vertical_edge_ppc(y_ptr + 12, y_stride, lfi->flim); } diff --git a/vp8/common/ppc/systemdependent.c b/vp8/common/ppc/systemdependent.c index 1f5d79068..6d68b9a03 100644 --- a/vp8/common/ppc/systemdependent.c +++ b/vp8/common/ppc/systemdependent.c @@ -21,13 +21,13 @@ void (*vp8_short_idct4x4_1)(short *input, short *output, int pitch); void (*vp8_dc_only_idct)(short input_dc, short *output, int pitch); extern void (*vp8_post_proc_down_and_across)( - unsigned char *src_ptr, - unsigned char *dst_ptr, - int src_pixels_per_line, - int dst_pixels_per_line, - int rows, - int cols, - int flimit + unsigned char *src_ptr, + unsigned char *dst_ptr, + int src_pixels_per_line, + int dst_pixels_per_line, + int rows, + int cols, + int flimit ); extern void (*vp8_mbpost_proc_down)(unsigned char *dst, int pitch, int rows, int cols, int flimit); @@ -37,13 +37,13 @@ extern void vp8_mbpost_proc_across_ip_c(unsigned char *src, int pitch, int rows, extern void vp8_post_proc_down_and_across_c ( - unsigned char *src_ptr, - unsigned char *dst_ptr, - int src_pixels_per_line, - int dst_pixels_per_line, - int rows, - int cols, - int flimit + unsigned char *src_ptr, + unsigned char *dst_ptr, + int src_pixels_per_line, + int dst_pixels_per_line, + int rows, + int cols, + int flimit ); void vp8_plane_add_noise_c(unsigned char *Start, unsigned int Width, unsigned int Height, int Pitch, int q, int a); @@ -123,49 +123,47 @@ extern loop_filter_block_function *vp8_lf_mbhsimple; extern loop_filter_block_function *vp8_lf_bvsimple; extern loop_filter_block_function *vp8_lf_bhsimple; -void vp8_clear_c(void) -{ +void vp8_clear_c(void) { } -void vp8_machine_specific_config(void) -{ - // Pure C: - vp8_clear_system_state = vp8_clear_c; - vp8_recon_b = vp8_recon_b_c; - vp8_recon4b = vp8_recon4b_c; - vp8_recon2b = vp8_recon2b_c; - - vp8_bilinear_predict16x16 = bilinear_predict16x16_ppc; - vp8_bilinear_predict8x8 = bilinear_predict8x8_ppc; - vp8_bilinear_predict8x4 = bilinear_predict8x4_ppc; - vp8_bilinear_predict = bilinear_predict4x4_ppc; - - vp8_sixtap_predict16x16 = sixtap_predict16x16_ppc; - vp8_sixtap_predict8x8 = sixtap_predict8x8_ppc; - vp8_sixtap_predict8x4 = sixtap_predict8x4_ppc; - vp8_sixtap_predict = sixtap_predict_ppc; - - vp8_short_idct4x4_1 = vp8_short_idct4x4llm_1_c; - vp8_short_idct4x4 = short_idct4x4llm_ppc; - vp8_dc_only_idct = vp8_dc_only_idct_c; - - vp8_lf_mbvfull = loop_filter_mbv_ppc; - vp8_lf_bvfull = loop_filter_bv_ppc; - vp8_lf_mbhfull = loop_filter_mbh_ppc; - vp8_lf_bhfull = loop_filter_bh_ppc; - - vp8_lf_mbvsimple = loop_filter_mbvs_ppc; - vp8_lf_bvsimple = loop_filter_bvs_ppc; - vp8_lf_mbhsimple = loop_filter_mbhs_ppc; - vp8_lf_bhsimple = loop_filter_bhs_ppc; - - vp8_post_proc_down_and_across = vp8_post_proc_down_and_across_c; - vp8_mbpost_proc_down = vp8_mbpost_proc_down_c; - vp8_mbpost_proc_across_ip = vp8_mbpost_proc_across_ip_c; - vp8_plane_add_noise = vp8_plane_add_noise_c; - - vp8_copy_mem16x16 = copy_mem16x16_ppc; - vp8_copy_mem8x8 = vp8_copy_mem8x8_c; - vp8_copy_mem8x4 = vp8_copy_mem8x4_c; +void vp8_machine_specific_config(void) { + // Pure C: + vp8_clear_system_state = vp8_clear_c; + vp8_recon_b = vp8_recon_b_c; + vp8_recon4b = vp8_recon4b_c; + vp8_recon2b = vp8_recon2b_c; + + vp8_bilinear_predict16x16 = bilinear_predict16x16_ppc; + vp8_bilinear_predict8x8 = bilinear_predict8x8_ppc; + vp8_bilinear_predict8x4 = bilinear_predict8x4_ppc; + vp8_bilinear_predict = bilinear_predict4x4_ppc; + + vp8_sixtap_predict16x16 = sixtap_predict16x16_ppc; + vp8_sixtap_predict8x8 = sixtap_predict8x8_ppc; + vp8_sixtap_predict8x4 = sixtap_predict8x4_ppc; + vp8_sixtap_predict = sixtap_predict_ppc; + + vp8_short_idct4x4_1 = vp8_short_idct4x4llm_1_c; + vp8_short_idct4x4 = short_idct4x4llm_ppc; + vp8_dc_only_idct = vp8_dc_only_idct_c; + + vp8_lf_mbvfull = loop_filter_mbv_ppc; + vp8_lf_bvfull = loop_filter_bv_ppc; + vp8_lf_mbhfull = loop_filter_mbh_ppc; + vp8_lf_bhfull = loop_filter_bh_ppc; + + vp8_lf_mbvsimple = loop_filter_mbvs_ppc; + vp8_lf_bvsimple = loop_filter_bvs_ppc; + vp8_lf_mbhsimple = loop_filter_mbhs_ppc; + vp8_lf_bhsimple = loop_filter_bhs_ppc; + + vp8_post_proc_down_and_across = vp8_post_proc_down_and_across_c; + vp8_mbpost_proc_down = vp8_mbpost_proc_down_c; + vp8_mbpost_proc_across_ip = vp8_mbpost_proc_across_ip_c; + vp8_plane_add_noise = vp8_plane_add_noise_c; + + vp8_copy_mem16x16 = copy_mem16x16_ppc; + vp8_copy_mem8x8 = vp8_copy_mem8x8_c; + vp8_copy_mem8x4 = vp8_copy_mem8x4_c; } diff --git a/vp8/common/ppflags.h b/vp8/common/ppflags.h index 65b0cab6a..9d3f1a8af 100644 --- a/vp8/common/ppflags.h +++ b/vp8/common/ppflags.h @@ -11,30 +11,28 @@ #ifndef __INC_PPFLAGS_H #define __INC_PPFLAGS_H -enum -{ - VP8D_NOFILTERING = 0, - VP8D_DEBLOCK = 1<<0, - VP8D_DEMACROBLOCK = 1<<1, - VP8D_ADDNOISE = 1<<2, - VP8D_DEBUG_TXT_FRAME_INFO = 1<<3, - VP8D_DEBUG_TXT_MBLK_MODES = 1<<4, - VP8D_DEBUG_TXT_DC_DIFF = 1<<5, - VP8D_DEBUG_TXT_RATE_INFO = 1<<6, - VP8D_DEBUG_DRAW_MV = 1<<7, - VP8D_DEBUG_CLR_BLK_MODES = 1<<8, - VP8D_DEBUG_CLR_FRM_REF_BLKS = 1<<9 +enum { + VP8D_NOFILTERING = 0, + VP8D_DEBLOCK = 1 << 0, + VP8D_DEMACROBLOCK = 1 << 1, + VP8D_ADDNOISE = 1 << 2, + VP8D_DEBUG_TXT_FRAME_INFO = 1 << 3, + VP8D_DEBUG_TXT_MBLK_MODES = 1 << 4, + VP8D_DEBUG_TXT_DC_DIFF = 1 << 5, + VP8D_DEBUG_TXT_RATE_INFO = 1 << 6, + VP8D_DEBUG_DRAW_MV = 1 << 7, + VP8D_DEBUG_CLR_BLK_MODES = 1 << 8, + VP8D_DEBUG_CLR_FRM_REF_BLKS = 1 << 9 }; -typedef struct -{ - int post_proc_flag; - int deblocking_level; - int noise_level; - int display_ref_frame_flag; - int display_mb_modes_flag; - int display_b_modes_flag; - int display_mv_flag; +typedef struct { + int post_proc_flag; + int deblocking_level; + int noise_level; + int display_ref_frame_flag; + int display_mb_modes_flag; + int display_b_modes_flag; + int display_mv_flag; } vp8_ppflags_t; #endif diff --git a/vp8/common/pred_common.c b/vp8/common/pred_common.c index 02a626575..f617a0fb4 100644 --- a/vp8/common/pred_common.c +++ b/vp8/common/pred_common.c @@ -14,169 +14,161 @@ // TBD prediction functions for various bitstream signals // Returns a context number for the given MB prediction signal -unsigned char get_pred_context( VP8_COMMON *const cm, - MACROBLOCKD *const xd, - PRED_ID pred_id ) -{ - int pred_context; - MODE_INFO *m = xd->mode_info_context; - - // Note: - // The mode info data structure has a one element border above and to the - // left of the entries correpsonding to real macroblocks. - // The prediction flags in these dummy entries are initialised to 0. - switch (pred_id) - { +unsigned char get_pred_context(VP8_COMMON *const cm, + MACROBLOCKD *const xd, + PRED_ID pred_id) { + int pred_context; + MODE_INFO *m = xd->mode_info_context; + + // Note: + // The mode info data structure has a one element border above and to the + // left of the entries correpsonding to real macroblocks. + // The prediction flags in these dummy entries are initialised to 0. + switch (pred_id) { case PRED_SEG_ID: - pred_context = (m - 1)->mbmi.seg_id_predicted + - (m - cm->mode_info_stride)->mbmi.seg_id_predicted; - break; + pred_context = (m - 1)->mbmi.seg_id_predicted + + (m - cm->mode_info_stride)->mbmi.seg_id_predicted; + break; case PRED_REF: - pred_context = (m - 1)->mbmi.ref_predicted + - (m - cm->mode_info_stride)->mbmi.ref_predicted; - break; + pred_context = (m - 1)->mbmi.ref_predicted + + (m - cm->mode_info_stride)->mbmi.ref_predicted; + break; case PRED_COMP: - // Context based on use of comp pred flag by neighbours - //pred_context = - // ((m - 1)->mbmi.second_ref_frame != INTRA_FRAME) + - // ((m - cm->mode_info_stride)->mbmi.second_ref_frame != INTRA_FRAME); - - // Context based on mode and reference frame - //if ( m->mbmi.ref_frame == LAST_FRAME ) - // pred_context = 0 + (m->mbmi.mode != ZEROMV); - //else if ( m->mbmi.ref_frame == GOLDEN_FRAME ) - // pred_context = 2 + (m->mbmi.mode != ZEROMV); - //else - // pred_context = 4 + (m->mbmi.mode != ZEROMV); - - if ( m->mbmi.ref_frame == LAST_FRAME ) - pred_context = 0; - else - pred_context = 1; - - break; + // Context based on use of comp pred flag by neighbours + // pred_context = + // ((m - 1)->mbmi.second_ref_frame != INTRA_FRAME) + + // ((m - cm->mode_info_stride)->mbmi.second_ref_frame != INTRA_FRAME); + + // Context based on mode and reference frame + // if ( m->mbmi.ref_frame == LAST_FRAME ) + // pred_context = 0 + (m->mbmi.mode != ZEROMV); + // else if ( m->mbmi.ref_frame == GOLDEN_FRAME ) + // pred_context = 2 + (m->mbmi.mode != ZEROMV); + // else + // pred_context = 4 + (m->mbmi.mode != ZEROMV); + + if (m->mbmi.ref_frame == LAST_FRAME) + pred_context = 0; + else + pred_context = 1; + + break; #if CONFIG_NEWENTROPY case PRED_MBSKIP: - pred_context = (m - 1)->mbmi.mb_skip_coeff + - (m - cm->mode_info_stride)->mbmi.mb_skip_coeff; - break; + pred_context = (m - 1)->mbmi.mb_skip_coeff + + (m - cm->mode_info_stride)->mbmi.mb_skip_coeff; + break; #endif default: - // TODO *** add error trap code. - pred_context = 0; - break; - } + // TODO *** add error trap code. + pred_context = 0; + break; + } - return pred_context; + return pred_context; } // This function returns a context probability for coding a given // prediction signal -vp8_prob get_pred_prob( VP8_COMMON *const cm, - MACROBLOCKD *const xd, - PRED_ID pred_id ) -{ - vp8_prob pred_probability; - int pred_context; - - // Get the appropriate prediction context - pred_context = get_pred_context( cm, xd, pred_id ); - - switch (pred_id) - { +vp8_prob get_pred_prob(VP8_COMMON *const cm, + MACROBLOCKD *const xd, + PRED_ID pred_id) { + vp8_prob pred_probability; + int pred_context; + + // Get the appropriate prediction context + pred_context = get_pred_context(cm, xd, pred_id); + + switch (pred_id) { case PRED_SEG_ID: - pred_probability = cm->segment_pred_probs[pred_context]; - break; + pred_probability = cm->segment_pred_probs[pred_context]; + break; case PRED_REF: - pred_probability = cm->ref_pred_probs[pred_context]; - break; + pred_probability = cm->ref_pred_probs[pred_context]; + break; case PRED_COMP: - // In keeping with convention elsewhre the probability returned is - // the probability of a "0" outcome which in this case means the - // probability of comp pred off. - pred_probability = cm->prob_comppred[pred_context]; - break; + // In keeping with convention elsewhre the probability returned is + // the probability of a "0" outcome which in this case means the + // probability of comp pred off. + pred_probability = cm->prob_comppred[pred_context]; + break; #if CONFIG_NEWENTROPY case PRED_MBSKIP: - pred_probability = cm->mbskip_pred_probs[pred_context]; - break; + pred_probability = cm->mbskip_pred_probs[pred_context]; + break; #endif default: - // TODO *** add error trap code. - pred_probability = 128; - break; - } + // TODO *** add error trap code. + pred_probability = 128; + break; + } - return pred_probability; + return pred_probability; } // This function returns the status of the given prediction signal. // I.e. is the predicted value for the given signal correct. -unsigned char get_pred_flag( MACROBLOCKD *const xd, - PRED_ID pred_id ) -{ - unsigned char pred_flag = 0; +unsigned char get_pred_flag(MACROBLOCKD *const xd, + PRED_ID pred_id) { + unsigned char pred_flag = 0; - switch (pred_id) - { + switch (pred_id) { case PRED_SEG_ID: - pred_flag = xd->mode_info_context->mbmi.seg_id_predicted; - break; + pred_flag = xd->mode_info_context->mbmi.seg_id_predicted; + break; case PRED_REF: - pred_flag = xd->mode_info_context->mbmi.ref_predicted; - break; + pred_flag = xd->mode_info_context->mbmi.ref_predicted; + break; #if CONFIG_NEWENTROPY case PRED_MBSKIP: - pred_flag = xd->mode_info_context->mbmi.mb_skip_coeff; - break; + pred_flag = xd->mode_info_context->mbmi.mb_skip_coeff; + break; #endif default: - // TODO *** add error trap code. - pred_flag = 0; - break; - } + // TODO *** add error trap code. + pred_flag = 0; + break; + } - return pred_flag; + return pred_flag; } // This function sets the status of the given prediction signal. // I.e. is the predicted value for the given signal correct. -void set_pred_flag( MACROBLOCKD *const xd, - PRED_ID pred_id, - unsigned char pred_flag) -{ - switch (pred_id) - { +void set_pred_flag(MACROBLOCKD *const xd, + PRED_ID pred_id, + unsigned char pred_flag) { + switch (pred_id) { case PRED_SEG_ID: - xd->mode_info_context->mbmi.seg_id_predicted = pred_flag; - break; + xd->mode_info_context->mbmi.seg_id_predicted = pred_flag; + break; case PRED_REF: - xd->mode_info_context->mbmi.ref_predicted = pred_flag; - break; + xd->mode_info_context->mbmi.ref_predicted = pred_flag; + break; #if CONFIG_NEWENTROPY case PRED_MBSKIP: - xd->mode_info_context->mbmi.mb_skip_coeff = pred_flag; - break; + xd->mode_info_context->mbmi.mb_skip_coeff = pred_flag; + break; #endif default: - // TODO *** add error trap code. - break; - } + // TODO *** add error trap code. + break; + } } @@ -184,123 +176,107 @@ void set_pred_flag( MACROBLOCKD *const xd, // peredict various bitstream signals. // Macroblock segment id prediction function -unsigned char get_pred_mb_segid( VP8_COMMON *const cm, int MbIndex ) -{ - // Currently the prediction for the macroblock segment ID is - // the value stored for this macroblock in the previous frame. - return cm->last_frame_seg_map[MbIndex]; +unsigned char get_pred_mb_segid(VP8_COMMON *const cm, int MbIndex) { + // Currently the prediction for the macroblock segment ID is + // the value stored for this macroblock in the previous frame. + return cm->last_frame_seg_map[MbIndex]; } -MV_REFERENCE_FRAME get_pred_ref( VP8_COMMON *const cm, - MACROBLOCKD *const xd ) -{ - MODE_INFO *m = xd->mode_info_context; - - MV_REFERENCE_FRAME left; - MV_REFERENCE_FRAME above; - MV_REFERENCE_FRAME above_left; - MV_REFERENCE_FRAME pred_ref = LAST_FRAME; - - int segment_id = xd->mode_info_context->mbmi.segment_id; - int seg_ref_active; - int i; - - unsigned char frame_allowed[MAX_REF_FRAMES] = {1,1,1,1}; - unsigned char ref_score[MAX_REF_FRAMES]; - unsigned char best_score = 0; - unsigned char left_in_image; - unsigned char above_in_image; - unsigned char above_left_in_image; - - // Is segment coding ennabled - seg_ref_active = segfeature_active( xd, segment_id, SEG_LVL_REF_FRAME ); - - // Special case treatment if segment coding is enabled. - // Dont allow prediction of a reference frame that the segment - // does not allow - if ( seg_ref_active ) - { - for ( i = 0; i < MAX_REF_FRAMES; i++ ) - { - frame_allowed[i] = - check_segref( xd, segment_id, i ); - - // Score set to 0 if ref frame not allowed - ref_score[i] = cm->ref_scores[i] * frame_allowed[i]; - } - } - else - vpx_memcpy( ref_score, cm->ref_scores, sizeof(ref_score) ); - - // Reference frames used by neighbours - left = (m - 1)->mbmi.ref_frame; - above = (m - cm->mode_info_stride)->mbmi.ref_frame; - above_left = (m - 1 - cm->mode_info_stride)->mbmi.ref_frame; - - // Are neighbours in image - left_in_image = (m - 1)->mbmi.mb_in_image; - above_in_image = (m - cm->mode_info_stride)->mbmi.mb_in_image; - above_left_in_image = (m - 1 - cm->mode_info_stride)->mbmi.mb_in_image; - - // Adjust scores for candidate reference frames based on neigbours - if ( frame_allowed[left] && left_in_image ) - { - ref_score[left] += 16; - if ( above_left_in_image && (left == above_left) ) - ref_score[left] += 4; +MV_REFERENCE_FRAME get_pred_ref(VP8_COMMON *const cm, + MACROBLOCKD *const xd) { + MODE_INFO *m = xd->mode_info_context; + + MV_REFERENCE_FRAME left; + MV_REFERENCE_FRAME above; + MV_REFERENCE_FRAME above_left; + MV_REFERENCE_FRAME pred_ref = LAST_FRAME; + + int segment_id = xd->mode_info_context->mbmi.segment_id; + int seg_ref_active; + int i; + + unsigned char frame_allowed[MAX_REF_FRAMES] = {1, 1, 1, 1}; + unsigned char ref_score[MAX_REF_FRAMES]; + unsigned char best_score = 0; + unsigned char left_in_image; + unsigned char above_in_image; + unsigned char above_left_in_image; + + // Is segment coding ennabled + seg_ref_active = segfeature_active(xd, segment_id, SEG_LVL_REF_FRAME); + + // Special case treatment if segment coding is enabled. + // Dont allow prediction of a reference frame that the segment + // does not allow + if (seg_ref_active) { + for (i = 0; i < MAX_REF_FRAMES; i++) { + frame_allowed[i] = + check_segref(xd, segment_id, i); + + // Score set to 0 if ref frame not allowed + ref_score[i] = cm->ref_scores[i] * frame_allowed[i]; } - if ( frame_allowed[above] && above_in_image ) - { - ref_score[above] += 16; - if ( above_left_in_image && (above == above_left) ) - ref_score[above] += 4; - } - - // Now choose the candidate with the highest score - for ( i = 0; i < MAX_REF_FRAMES; i++ ) - { - if ( ref_score[i] > best_score ) - { - pred_ref = i; - best_score = ref_score[i]; - } + } else + vpx_memcpy(ref_score, cm->ref_scores, sizeof(ref_score)); + + // Reference frames used by neighbours + left = (m - 1)->mbmi.ref_frame; + above = (m - cm->mode_info_stride)->mbmi.ref_frame; + above_left = (m - 1 - cm->mode_info_stride)->mbmi.ref_frame; + + // Are neighbours in image + left_in_image = (m - 1)->mbmi.mb_in_image; + above_in_image = (m - cm->mode_info_stride)->mbmi.mb_in_image; + above_left_in_image = (m - 1 - cm->mode_info_stride)->mbmi.mb_in_image; + + // Adjust scores for candidate reference frames based on neigbours + if (frame_allowed[left] && left_in_image) { + ref_score[left] += 16; + if (above_left_in_image && (left == above_left)) + ref_score[left] += 4; + } + if (frame_allowed[above] && above_in_image) { + ref_score[above] += 16; + if (above_left_in_image && (above == above_left)) + ref_score[above] += 4; + } + + // Now choose the candidate with the highest score + for (i = 0; i < MAX_REF_FRAMES; i++) { + if (ref_score[i] > best_score) { + pred_ref = i; + best_score = ref_score[i]; } + } - return pred_ref; + return pred_ref; } // Functions to computes a set of modified reference frame probabilities // to use when the prediction of the reference frame value fails -void calc_ref_probs( int * count, vp8_prob * probs ) -{ - int tot_count; - - tot_count = count[0] + count[1] + count[2] + count[3]; - if ( tot_count ) - { - probs[0] = (vp8_prob)((count[0] * 255 + (tot_count >> 1)) / tot_count); - probs[0] += !probs[0]; - } - else - probs[0] = 128; - - tot_count -= count[0]; - if ( tot_count ) - { - probs[1] = (vp8_prob)((count[1] * 255 + (tot_count >> 1)) / tot_count); - probs[1] += !probs[1]; - } - else - probs[1] = 128; - - tot_count -= count[1]; - if ( tot_count ) - { - probs[2] = (vp8_prob)((count[2] * 255 + (tot_count >> 1)) / tot_count); - probs[2] += !probs[2]; - } - else - probs[2] = 128; +void calc_ref_probs(int *count, vp8_prob *probs) { + int tot_count; + + tot_count = count[0] + count[1] + count[2] + count[3]; + if (tot_count) { + probs[0] = (vp8_prob)((count[0] * 255 + (tot_count >> 1)) / tot_count); + probs[0] += !probs[0]; + } else + probs[0] = 128; + + tot_count -= count[0]; + if (tot_count) { + probs[1] = (vp8_prob)((count[1] * 255 + (tot_count >> 1)) / tot_count); + probs[1] += !probs[1]; + } else + probs[1] = 128; + + tot_count -= count[1]; + if (tot_count) { + probs[2] = (vp8_prob)((count[2] * 255 + (tot_count >> 1)) / tot_count); + probs[2] += !probs[2]; + } else + probs[2] = 128; } @@ -308,58 +284,57 @@ void calc_ref_probs( int * count, vp8_prob * probs ) // Values willbe set to 0 for reference frame options that are not possible // because wither they were predicted and prediction has failed or because // they are not allowed for a given segment. -void compute_mod_refprobs( VP8_COMMON *const cm ) -{ - int norm_cnt[MAX_REF_FRAMES]; - int intra_count; - int inter_count; - int last_count; - int gfarf_count; - int gf_count; - int arf_count; - - intra_count = cm->prob_intra_coded; - inter_count = (255 - intra_count); - last_count = (inter_count * cm->prob_last_coded)/255; - gfarf_count = inter_count - last_count; - gf_count = (gfarf_count * cm->prob_gf_coded)/255; - arf_count = gfarf_count - gf_count; - - // Work out modified reference frame probabilities to use where prediction - // of the reference frame fails - norm_cnt[0] = 0; - norm_cnt[1] = last_count; - norm_cnt[2] = gf_count; - norm_cnt[3] = arf_count; - calc_ref_probs( norm_cnt, cm->mod_refprobs[INTRA_FRAME] ); - cm->mod_refprobs[INTRA_FRAME][0] = 0; // This branch implicit - - norm_cnt[0] = intra_count; - norm_cnt[1] = 0; - norm_cnt[2] = gf_count; - norm_cnt[3] = arf_count; - calc_ref_probs( norm_cnt, cm->mod_refprobs[LAST_FRAME]); - cm->mod_refprobs[LAST_FRAME][1] = 0; // This branch implicit - - norm_cnt[0] = intra_count; - norm_cnt[1] = last_count; - norm_cnt[2] = 0; - norm_cnt[3] = arf_count; - calc_ref_probs( norm_cnt, cm->mod_refprobs[GOLDEN_FRAME] ); - cm->mod_refprobs[GOLDEN_FRAME][2] = 0; // This branch implicit - - norm_cnt[0] = intra_count; - norm_cnt[1] = last_count; - norm_cnt[2] = gf_count; - norm_cnt[3] = 0; - calc_ref_probs( norm_cnt, cm->mod_refprobs[ALTREF_FRAME] ); - cm->mod_refprobs[ALTREF_FRAME][2] = 0; // This branch implicit - - // Score the reference frames based on overal frequency. - // These scores contribute to the prediction choices. - // Max score 17 min 1 - cm->ref_scores[INTRA_FRAME] = 1 + (intra_count * 16 / 255); - cm->ref_scores[LAST_FRAME] = 1 + (last_count * 16 / 255); - cm->ref_scores[GOLDEN_FRAME] = 1 + (gf_count * 16 / 255); - cm->ref_scores[ALTREF_FRAME] = 1 + (arf_count * 16 / 255); +void compute_mod_refprobs(VP8_COMMON *const cm) { + int norm_cnt[MAX_REF_FRAMES]; + int intra_count; + int inter_count; + int last_count; + int gfarf_count; + int gf_count; + int arf_count; + + intra_count = cm->prob_intra_coded; + inter_count = (255 - intra_count); + last_count = (inter_count * cm->prob_last_coded) / 255; + gfarf_count = inter_count - last_count; + gf_count = (gfarf_count * cm->prob_gf_coded) / 255; + arf_count = gfarf_count - gf_count; + + // Work out modified reference frame probabilities to use where prediction + // of the reference frame fails + norm_cnt[0] = 0; + norm_cnt[1] = last_count; + norm_cnt[2] = gf_count; + norm_cnt[3] = arf_count; + calc_ref_probs(norm_cnt, cm->mod_refprobs[INTRA_FRAME]); + cm->mod_refprobs[INTRA_FRAME][0] = 0; // This branch implicit + + norm_cnt[0] = intra_count; + norm_cnt[1] = 0; + norm_cnt[2] = gf_count; + norm_cnt[3] = arf_count; + calc_ref_probs(norm_cnt, cm->mod_refprobs[LAST_FRAME]); + cm->mod_refprobs[LAST_FRAME][1] = 0; // This branch implicit + + norm_cnt[0] = intra_count; + norm_cnt[1] = last_count; + norm_cnt[2] = 0; + norm_cnt[3] = arf_count; + calc_ref_probs(norm_cnt, cm->mod_refprobs[GOLDEN_FRAME]); + cm->mod_refprobs[GOLDEN_FRAME][2] = 0; // This branch implicit + + norm_cnt[0] = intra_count; + norm_cnt[1] = last_count; + norm_cnt[2] = gf_count; + norm_cnt[3] = 0; + calc_ref_probs(norm_cnt, cm->mod_refprobs[ALTREF_FRAME]); + cm->mod_refprobs[ALTREF_FRAME][2] = 0; // This branch implicit + + // Score the reference frames based on overal frequency. + // These scores contribute to the prediction choices. + // Max score 17 min 1 + cm->ref_scores[INTRA_FRAME] = 1 + (intra_count * 16 / 255); + cm->ref_scores[LAST_FRAME] = 1 + (last_count * 16 / 255); + cm->ref_scores[GOLDEN_FRAME] = 1 + (gf_count * 16 / 255); + cm->ref_scores[ALTREF_FRAME] = 1 + (arf_count * 16 / 255); } diff --git a/vp8/common/pred_common.h b/vp8/common/pred_common.h index 3499b0d41..9a7c13cc8 100644 --- a/vp8/common/pred_common.h +++ b/vp8/common/pred_common.h @@ -17,38 +17,37 @@ // Predicted items -typedef enum -{ - PRED_SEG_ID = 0, // Segment identifier - PRED_REF = 1, - PRED_COMP = 2, +typedef enum { + PRED_SEG_ID = 0, // Segment identifier + PRED_REF = 1, + PRED_COMP = 2, #if CONFIG_NEWENTROPY - PRED_MBSKIP = 3, + PRED_MBSKIP = 3, #endif } PRED_ID; -extern unsigned char get_pred_context( VP8_COMMON *const cm, - MACROBLOCKD *const xd, - PRED_ID pred_id ); +extern unsigned char get_pred_context(VP8_COMMON *const cm, + MACROBLOCKD *const xd, + PRED_ID pred_id); -extern vp8_prob get_pred_prob( VP8_COMMON *const cm, - MACROBLOCKD *const xd, - PRED_ID pred_id ); +extern vp8_prob get_pred_prob(VP8_COMMON *const cm, + MACROBLOCKD *const xd, + PRED_ID pred_id); -extern unsigned char get_pred_flag( MACROBLOCKD *const xd, - PRED_ID pred_id ); +extern unsigned char get_pred_flag(MACROBLOCKD *const xd, + PRED_ID pred_id); -extern void set_pred_flag( MACROBLOCKD *const xd, - PRED_ID pred_id, - unsigned char pred_flag); +extern void set_pred_flag(MACROBLOCKD *const xd, + PRED_ID pred_id, + unsigned char pred_flag); -extern unsigned char get_pred_mb_segid( VP8_COMMON *const cm, int MbIndex ); +extern unsigned char get_pred_mb_segid(VP8_COMMON *const cm, int MbIndex); -extern MV_REFERENCE_FRAME get_pred_ref( VP8_COMMON *const cm, - MACROBLOCKD *const xd ); -extern void compute_mod_refprobs( VP8_COMMON *const cm ); +extern MV_REFERENCE_FRAME get_pred_ref(VP8_COMMON *const cm, + MACROBLOCKD *const xd); +extern void compute_mod_refprobs(VP8_COMMON *const cm); #endif /* __INC_PRED_COMMON_H__ */ diff --git a/vp8/common/predict_rotated.c b/vp8/common/predict_rotated.c index 0880bfb4c..29ef65cea 100644 --- a/vp8/common/predict_rotated.c +++ b/vp8/common/predict_rotated.c @@ -9,74 +9,61 @@ */ #if CONFIG_ROTATION -typedef struct -{ - int y; - int x; - unsigned long t; +typedef struct { + int y; + int x; + unsigned long t; } tap; -typedef struct -{ - tap pt[4]; +typedef struct { + tap pt[4]; } point_taps; -typedef struct -{ - point_taps pt[256]; +typedef struct { + point_taps pt[256]; } mb_taps; -mb_taps mt_8x8[] = -{ - #include "rotate2.h" +mb_taps mt_8x8[] = { +#include "rotate2.h" }; -mb_taps mt[] = -{ - #include "rotate.h" +mb_taps mt[] = { +#include "rotate.h" }; void predict_rotated_16x16(int rotation_index, unsigned char *src, int sp, - unsigned char *dst, int dp) -{ - int i, j, k, p = 0; + unsigned char *dst, int dp) { + int i, j, k, p = 0; - for (i = 0; i < 16; i++, dst += dp) - { - for (j = 0; j < 16; j++, p++) - { - unsigned int sum = 32768; + for (i = 0; i < 16; i++, dst += dp) { + for (j = 0; j < 16; j++, p++) { + unsigned int sum = 32768; - for (k = 0; k < 4; k++) - { - tap *tp = &mt[rotation_index].pt[p].pt[k]; - sum += src[tp->y * sp + tp->x] * tp->t; - } - sum >>= 16; - dst[j] = sum; - } + for (k = 0; k < 4; k++) { + tap *tp = &mt[rotation_index].pt[p].pt[k]; + sum += src[tp->y * sp + tp->x] * tp->t; + } + sum >>= 16; + dst[j] = sum; } + } } void predict_rotated_8x8(int rotation_index, unsigned char *src, int sp, - unsigned char *dst, int dp) -{ - int i, j, k, p = 0; + unsigned char *dst, int dp) { + int i, j, k, p = 0; - for (i = 0; i < 8; i++, dst += dp) - { - for (j = 0; j < 8; j++, p++) - { - unsigned int sum = 32768; + for (i = 0; i < 8; i++, dst += dp) { + for (j = 0; j < 8; j++, p++) { + unsigned int sum = 32768; - for (k = 0; k < 4; k++) - { - tap *tp = &mt_8x8[rotation_index].pt[p].pt[k]; - sum += src[tp->y * sp + tp->x] * tp->t; - } - sum >>= 16; - dst[j] = sum; - } + for (k = 0; k < 4; k++) { + tap *tp = &mt_8x8[rotation_index].pt[p].pt[k]; + sum += src[tp->y * sp + tp->x] * tp->t; + } + sum >>= 16; + dst[j] = sum; } + } } #endif diff --git a/vp8/common/quant_common.c b/vp8/common/quant_common.c index 0bb44f588..65453d88c 100644 --- a/vp8/common/quant_common.c +++ b/vp8/common/quant_common.c @@ -16,118 +16,110 @@ static int ac_qlookup[QINDEX_RANGE]; #define ACDC_MIN 4 -void vp8_init_quant_tables() -{ - int i; - int current_val = 4; - int last_val = 4; - int ac_val; - - for ( i = 0; i < QINDEX_RANGE; i++ ) - { - ac_qlookup[i] = current_val; - current_val = (int)((double)current_val * 1.02); - if ( current_val == last_val ) - current_val++; - last_val = current_val; - - ac_val = ac_qlookup[i]; - dc_qlookup[i] = (0.000000305 * ac_val * ac_val * ac_val) + - (-0.00065 * ac_val * ac_val) + - (0.9 * ac_val) + 0.5; - if ( dc_qlookup[i] < ACDC_MIN ) - dc_qlookup[i] = ACDC_MIN; - } +void vp8_init_quant_tables() { + int i; + int current_val = 4; + int last_val = 4; + int ac_val; + + for (i = 0; i < QINDEX_RANGE; i++) { + ac_qlookup[i] = current_val; + current_val = (int)((double)current_val * 1.02); + if (current_val == last_val) + current_val++; + last_val = current_val; + + ac_val = ac_qlookup[i]; + dc_qlookup[i] = (0.000000305 * ac_val * ac_val * ac_val) + + (-0.00065 * ac_val * ac_val) + + (0.9 * ac_val) + 0.5; + if (dc_qlookup[i] < ACDC_MIN) + dc_qlookup[i] = ACDC_MIN; + } } -int vp8_dc_quant(int QIndex, int Delta) -{ - int retval; +int vp8_dc_quant(int QIndex, int Delta) { + int retval; - QIndex = QIndex + Delta; + QIndex = QIndex + Delta; - if (QIndex > MAXQ) - QIndex = MAXQ; - else if (QIndex < 0) - QIndex = 0; + if (QIndex > MAXQ) + QIndex = MAXQ; + else if (QIndex < 0) + QIndex = 0; - retval = dc_qlookup[ QIndex ]; - return retval; + retval = dc_qlookup[ QIndex ]; + return retval; } -int vp8_dc2quant(int QIndex, int Delta) -{ - int retval; +int vp8_dc2quant(int QIndex, int Delta) { + int retval; - QIndex = QIndex + Delta; + QIndex = QIndex + Delta; - if (QIndex > MAXQ) - QIndex = MAXQ; - else if (QIndex < 0) - QIndex = 0; + if (QIndex > MAXQ) + QIndex = MAXQ; + else if (QIndex < 0) + QIndex = 0; - retval = dc_qlookup[ QIndex ]; + retval = dc_qlookup[ QIndex ]; - return retval; + return retval; } -int vp8_dc_uv_quant(int QIndex, int Delta) -{ - int retval; +int vp8_dc_uv_quant(int QIndex, int Delta) { + int retval; - QIndex = QIndex + Delta; + QIndex = QIndex + Delta; - if (QIndex > MAXQ) - QIndex = MAXQ; - else if (QIndex < 0) - QIndex = 0; + if (QIndex > MAXQ) + QIndex = MAXQ; + else if (QIndex < 0) + QIndex = 0; - retval = dc_qlookup[ QIndex ]; + retval = dc_qlookup[ QIndex ]; - return retval; + return retval; } -int vp8_ac_yquant(int QIndex) -{ - int retval; +int vp8_ac_yquant(int QIndex) { + int retval; - if (QIndex > MAXQ) - QIndex = MAXQ; - else if (QIndex < 0) - QIndex = 0; + if (QIndex > MAXQ) + QIndex = MAXQ; + else if (QIndex < 0) + QIndex = 0; - retval = ac_qlookup[ QIndex ]; - return retval; + retval = ac_qlookup[ QIndex ]; + return retval; } -int vp8_ac2quant(int QIndex, int Delta) -{ - int retval; +int vp8_ac2quant(int QIndex, int Delta) { + int retval; - QIndex = QIndex + Delta; + QIndex = QIndex + Delta; - if (QIndex > MAXQ) - QIndex = MAXQ; - else if (QIndex < 0) - QIndex = 0; + if (QIndex > MAXQ) + QIndex = MAXQ; + else if (QIndex < 0) + QIndex = 0; - retval = (ac_qlookup[ QIndex ] * 775) / 1000; - if (retval < 4) - retval = 4; + retval = (ac_qlookup[ QIndex ] * 775) / 1000; + if (retval < 4) + retval = 4; - return retval; + return retval; } -int vp8_ac_uv_quant(int QIndex, int Delta) -{ - int retval; +int vp8_ac_uv_quant(int QIndex, int Delta) { + int retval; - QIndex = QIndex + Delta; + QIndex = QIndex + Delta; - if (QIndex > MAXQ) - QIndex = MAXQ; - else if (QIndex < 0) - QIndex = 0; + if (QIndex > MAXQ) + QIndex = MAXQ; + else if (QIndex < 0) + QIndex = 0; - retval = ac_qlookup[ QIndex ]; - return retval; + retval = ac_qlookup[ QIndex ]; + return retval; } diff --git a/vp8/common/recon.c b/vp8/common/recon.c index 279fbe82f..943faeef2 100644 --- a/vp8/common/recon.c +++ b/vp8/common/recon.c @@ -15,197 +15,180 @@ void vp8_recon_b_c ( - unsigned char *pred_ptr, - short *diff_ptr, - unsigned char *dst_ptr, - int stride -) -{ - int r, c; - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - int a = diff_ptr[c] + pred_ptr[c] ; - - if (a < 0) - a = 0; - - if (a > 255) - a = 255; - - dst_ptr[c] = (unsigned char) a ; - } - - dst_ptr += stride; - diff_ptr += 16; - pred_ptr += 16; + unsigned char *pred_ptr, + short *diff_ptr, + unsigned char *dst_ptr, + int stride +) { + int r, c; + + for (r = 0; r < 4; r++) { + for (c = 0; c < 4; c++) { + int a = diff_ptr[c] + pred_ptr[c]; + + if (a < 0) + a = 0; + + if (a > 255) + a = 255; + + dst_ptr[c] = (unsigned char) a; } + + dst_ptr += stride; + diff_ptr += 16; + pred_ptr += 16; + } } void vp8_recon_uv_b_c ( - unsigned char *pred_ptr, - short *diff_ptr, - unsigned char *dst_ptr, - int stride -) -{ - int r, c; - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - int a = diff_ptr[c] + pred_ptr[c] ; - - if (a < 0) - a = 0; - - if (a > 255) - a = 255; - - dst_ptr[c] = (unsigned char) a ; - } - - dst_ptr += stride; - diff_ptr += 8; - pred_ptr += 8; + unsigned char *pred_ptr, + short *diff_ptr, + unsigned char *dst_ptr, + int stride +) { + int r, c; + + for (r = 0; r < 4; r++) { + for (c = 0; c < 4; c++) { + int a = diff_ptr[c] + pred_ptr[c]; + + if (a < 0) + a = 0; + + if (a > 255) + a = 255; + + dst_ptr[c] = (unsigned char) a; } + + dst_ptr += stride; + diff_ptr += 8; + pred_ptr += 8; + } } void vp8_recon4b_c ( - unsigned char *pred_ptr, - short *diff_ptr, - unsigned char *dst_ptr, - int stride -) -{ - int r, c; - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 16; c++) - { - int a = diff_ptr[c] + pred_ptr[c] ; - - if (a < 0) - a = 0; - - if (a > 255) - a = 255; - - dst_ptr[c] = (unsigned char) a ; - } - - dst_ptr += stride; - diff_ptr += 16; - pred_ptr += 16; + unsigned char *pred_ptr, + short *diff_ptr, + unsigned char *dst_ptr, + int stride +) { + int r, c; + + for (r = 0; r < 4; r++) { + for (c = 0; c < 16; c++) { + int a = diff_ptr[c] + pred_ptr[c]; + + if (a < 0) + a = 0; + + if (a > 255) + a = 255; + + dst_ptr[c] = (unsigned char) a; } + + dst_ptr += stride; + diff_ptr += 16; + pred_ptr += 16; + } } void vp8_recon2b_c ( - unsigned char *pred_ptr, - short *diff_ptr, - unsigned char *dst_ptr, - int stride -) -{ - int r, c; - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 8; c++) - { - int a = diff_ptr[c] + pred_ptr[c] ; - - if (a < 0) - a = 0; - - if (a > 255) - a = 255; - - dst_ptr[c] = (unsigned char) a ; - } - - dst_ptr += stride; - diff_ptr += 8; - pred_ptr += 8; + unsigned char *pred_ptr, + short *diff_ptr, + unsigned char *dst_ptr, + int stride +) { + int r, c; + + for (r = 0; r < 4; r++) { + for (c = 0; c < 8; c++) { + int a = diff_ptr[c] + pred_ptr[c]; + + if (a < 0) + a = 0; + + if (a > 255) + a = 255; + + dst_ptr[c] = (unsigned char) a; } + + dst_ptr += stride; + diff_ptr += 8; + pred_ptr += 8; + } } -void vp8_recon_mby_c(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x) -{ +void vp8_recon_mby_c(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x) { #if ARCH_ARM - BLOCKD *b = &x->block[0]; - RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); + BLOCKD *b = &x->block[0]; + RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); - /*b = &x->block[4];*/ - b += 4; - RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); + /*b = &x->block[4];*/ + b += 4; + RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); - /*b = &x->block[8];*/ - b += 4; - RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); + /*b = &x->block[8];*/ + b += 4; + RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); - /*b = &x->block[12];*/ - b += 4; - RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); + /*b = &x->block[12];*/ + b += 4; + RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); #else - int i; + int i; - for (i = 0; i < 16; i += 4) - { - BLOCKD *b = &x->block[i]; + for (i = 0; i < 16; i += 4) { + BLOCKD *b = &x->block[i]; - RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); - } + RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); + } #endif } -void vp8_recon_mb_c(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x) -{ +void vp8_recon_mb_c(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x) { #if ARCH_ARM - BLOCKD *b = &x->block[0]; - - RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); - b += 4; - RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); - b += 4; - RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); - b += 4; - RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); - b += 4; - - /*b = &x->block[16];*/ - - RECON_INVOKE(rtcd, recon2)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); - b++; - b++; - RECON_INVOKE(rtcd, recon2)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); - b++; - b++; - RECON_INVOKE(rtcd, recon2)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); - b++; - b++; - RECON_INVOKE(rtcd, recon2)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); + BLOCKD *b = &x->block[0]; + + RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); + b += 4; + RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); + b += 4; + RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); + b += 4; + RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); + b += 4; + + /*b = &x->block[16];*/ + + RECON_INVOKE(rtcd, recon2)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); + b++; + b++; + RECON_INVOKE(rtcd, recon2)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); + b++; + b++; + RECON_INVOKE(rtcd, recon2)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); + b++; + b++; + RECON_INVOKE(rtcd, recon2)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); #else - int i; + int i; - for (i = 0; i < 16; i += 4) - { - BLOCKD *b = &x->block[i]; + for (i = 0; i < 16; i += 4) { + BLOCKD *b = &x->block[i]; - RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); - } + RECON_INVOKE(rtcd, recon4)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); + } - for (i = 16; i < 24; i += 2) - { - BLOCKD *b = &x->block[i]; + for (i = 16; i < 24; i += 2) { + BLOCKD *b = &x->block[i]; - RECON_INVOKE(rtcd, recon2)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); - } + RECON_INVOKE(rtcd, recon2)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); + } #endif } diff --git a/vp8/common/recon.h b/vp8/common/recon.h index 9fb12c85d..665fec3c4 100644 --- a/vp8/common/recon.h +++ b/vp8/common/recon.h @@ -15,23 +15,23 @@ #include "blockd.h" #define prototype_copy_block(sym) \ - void sym(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch) + void sym(unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch) #define prototype_recon_block(sym) \ - void sym(unsigned char *pred, short *diff, unsigned char *dst, int pitch) + void sym(unsigned char *pred, short *diff, unsigned char *dst, int pitch) #define prototype_recon_macroblock(sym) \ - void sym(const struct vp8_recon_rtcd_vtable *rtcd, MACROBLOCKD *x) + void sym(const struct vp8_recon_rtcd_vtable *rtcd, MACROBLOCKD *x) #define prototype_build_intra_predictors(sym) \ - void sym(MACROBLOCKD *x) + void sym(MACROBLOCKD *x) #define prototype_intra4x4_predict(sym) \ - void sym(BLOCKD *x, int b_mode, unsigned char *predictor) + void sym(BLOCKD *x, int b_mode, unsigned char *predictor) #if CONFIG_COMP_INTRA_PRED #define prototype_comp_intra4x4_predict(sym) \ - void sym(BLOCKD *x, int b_mode, int mode2, unsigned char *predictor) + void sym(BLOCKD *x, int b_mode, int mode2, unsigned char *predictor) #endif struct vp8_recon_rtcd_vtable; @@ -104,94 +104,94 @@ extern prototype_recon_macroblock(vp8_recon_recon_mby); #define vp8_recon_build_intra_predictors_mby vp8_build_intra_predictors_mby #endif extern prototype_build_intra_predictors\ - (vp8_recon_build_intra_predictors_mby); +(vp8_recon_build_intra_predictors_mby); #if CONFIG_COMP_INTRA_PRED #ifndef vp8_recon_build_comp_intra_predictors_mby #define vp8_recon_build_comp_intra_predictors_mby vp8_build_comp_intra_predictors_mby #endif extern prototype_build_intra_predictors\ - (vp8_recon_build_comp_intra_predictors_mby); +(vp8_recon_build_comp_intra_predictors_mby); #endif #ifndef vp8_recon_build_intra8x8_predictors_mby #define vp8_recon_build_intra8x8_predictors_mby vp8_build_intra8x8_predictors_mby #endif extern prototype_build_intra_predictors\ - (vp8_recon_build_intra8x8_predictors_mby); +(vp8_recon_build_intra8x8_predictors_mby); #ifndef vp8_recon_build_intra_predictors_mby_s #define vp8_recon_build_intra_predictors_mby_s vp8_build_intra_predictors_mby_s #endif extern prototype_build_intra_predictors\ - (vp8_recon_build_intra_predictors_mby_s); +(vp8_recon_build_intra_predictors_mby_s); #ifndef vp8_recon_build_intra_predictors_mbuv #define vp8_recon_build_intra_predictors_mbuv vp8_build_intra_predictors_mbuv #endif extern prototype_build_intra_predictors\ - (vp8_recon_build_intra_predictors_mbuv); +(vp8_recon_build_intra_predictors_mbuv); #ifndef vp8_recon_build_intra8x8_predictors_mbuv #define vp8_recon_build_intra8x8_predictors_mbuv vp8_build_intra8x8_predictors_mbuv #endif extern prototype_build_intra_predictors\ - (vp8_recon_build_intra8x8_predictors_mbuv); +(vp8_recon_build_intra8x8_predictors_mbuv); #ifndef vp8_recon_build_intra_predictors_mbuv_s #define vp8_recon_build_intra_predictors_mbuv_s vp8_build_intra_predictors_mbuv_s #endif extern prototype_build_intra_predictors\ - (vp8_recon_build_intra_predictors_mbuv_s); +(vp8_recon_build_intra_predictors_mbuv_s); #if CONFIG_COMP_INTRA_PRED #ifndef vp8_recon_build_comp_intra_predictors_mbuv #define vp8_recon_build_comp_intra_predictors_mbuv vp8_build_comp_intra_predictors_mbuv #endif extern prototype_build_intra_predictors\ - (vp8_recon_build_comp_intra_predictors_mbuv); +(vp8_recon_build_comp_intra_predictors_mbuv); #endif #ifndef vp8_recon_intra4x4_predict #define vp8_recon_intra4x4_predict vp8_intra4x4_predict #endif extern prototype_intra4x4_predict\ - (vp8_recon_intra4x4_predict); +(vp8_recon_intra4x4_predict); #if CONFIG_COMP_INTRA_PRED #ifndef vp8_recon_comp_intra4x4_predict #define vp8_recon_comp_intra4x4_predict vp8_comp_intra4x4_predict #endif extern prototype_comp_intra4x4_predict\ - (vp8_recon_comp_intra4x4_predict); +(vp8_recon_comp_intra4x4_predict); #endif #ifndef vp8_recon_intra8x8_predict #define vp8_recon_intra8x8_predict vp8_intra8x8_predict #endif extern prototype_intra4x4_predict\ - (vp8_recon_intra8x8_predict); +(vp8_recon_intra8x8_predict); #if CONFIG_COMP_INTRA_PRED #ifndef vp8_recon_comp_intra8x8_predict #define vp8_recon_comp_intra8x8_predict vp8_comp_intra8x8_predict #endif extern prototype_comp_intra4x4_predict\ - (vp8_recon_comp_intra8x8_predict); +(vp8_recon_comp_intra8x8_predict); #endif #ifndef vp8_recon_intra_uv4x4_predict #define vp8_recon_intra_uv4x4_predict vp8_intra_uv4x4_predict #endif extern prototype_intra4x4_predict\ - (vp8_recon_intra_uv4x4_predict); +(vp8_recon_intra_uv4x4_predict); #if CONFIG_COMP_INTRA_PRED #ifndef vp8_recon_comp_intra_uv4x4_predict #define vp8_recon_comp_intra_uv4x4_predict vp8_comp_intra_uv4x4_predict #endif extern prototype_comp_intra4x4_predict\ - (vp8_recon_comp_intra_uv4x4_predict); +(vp8_recon_comp_intra_uv4x4_predict); #endif typedef prototype_copy_block((*vp8_copy_block_fn_t)); @@ -202,40 +202,39 @@ typedef prototype_intra4x4_predict((*vp8_intra4x4_pred_fn_t)); #if CONFIG_COMP_INTRA_PRED typedef prototype_comp_intra4x4_predict((*vp8_comp_intra4x4_pred_fn_t)); #endif -typedef struct vp8_recon_rtcd_vtable -{ - vp8_copy_block_fn_t copy16x16; - vp8_copy_block_fn_t copy8x8; - vp8_copy_block_fn_t avg16x16; - vp8_copy_block_fn_t avg8x8; - vp8_copy_block_fn_t copy8x4; - vp8_recon_fn_t recon; - vp8_recon_fn_t recon_uv; - vp8_recon_fn_t recon2; - vp8_recon_fn_t recon4; - vp8_recon_mb_fn_t recon_mb; - vp8_recon_mb_fn_t recon_mby; - vp8_build_intra_pred_fn_t build_intra_predictors_mby_s; - vp8_build_intra_pred_fn_t build_intra_predictors_mby; +typedef struct vp8_recon_rtcd_vtable { + vp8_copy_block_fn_t copy16x16; + vp8_copy_block_fn_t copy8x8; + vp8_copy_block_fn_t avg16x16; + vp8_copy_block_fn_t avg8x8; + vp8_copy_block_fn_t copy8x4; + vp8_recon_fn_t recon; + vp8_recon_fn_t recon_uv; + vp8_recon_fn_t recon2; + vp8_recon_fn_t recon4; + vp8_recon_mb_fn_t recon_mb; + vp8_recon_mb_fn_t recon_mby; + vp8_build_intra_pred_fn_t build_intra_predictors_mby_s; + vp8_build_intra_pred_fn_t build_intra_predictors_mby; #if CONFIG_COMP_INTRA_PRED - vp8_build_intra_pred_fn_t build_comp_intra_predictors_mby; + vp8_build_intra_pred_fn_t build_comp_intra_predictors_mby; #endif - vp8_build_intra_pred_fn_t build_intra_predictors_mbuv_s; - vp8_build_intra_pred_fn_t build_intra_predictors_mbuv; + vp8_build_intra_pred_fn_t build_intra_predictors_mbuv_s; + vp8_build_intra_pred_fn_t build_intra_predictors_mbuv; #if CONFIG_COMP_INTRA_PRED - vp8_build_intra_pred_fn_t build_comp_intra_predictors_mbuv; + vp8_build_intra_pred_fn_t build_comp_intra_predictors_mbuv; #endif - vp8_intra4x4_pred_fn_t intra4x4_predict; + vp8_intra4x4_pred_fn_t intra4x4_predict; #if CONFIG_COMP_INTRA_PRED - vp8_comp_intra4x4_pred_fn_t comp_intra4x4_predict; + vp8_comp_intra4x4_pred_fn_t comp_intra4x4_predict; #endif - vp8_intra4x4_pred_fn_t intra8x8_predict; + vp8_intra4x4_pred_fn_t intra8x8_predict; #if CONFIG_COMP_INTRA_PRED - vp8_comp_intra4x4_pred_fn_t comp_intra8x8_predict; + vp8_comp_intra4x4_pred_fn_t comp_intra8x8_predict; #endif - vp8_intra4x4_pred_fn_t intra_uv4x4_predict; + vp8_intra4x4_pred_fn_t intra_uv4x4_predict; #if CONFIG_COMP_INTRA_PRED - vp8_comp_intra4x4_pred_fn_t comp_intra_uv4x4_predict; + vp8_comp_intra4x4_pred_fn_t comp_intra_uv4x4_predict; #endif } vp8_recon_rtcd_vtable_t; diff --git a/vp8/common/reconinter.c b/vp8/common/reconinter.c index 71a54e29e..853429e4c 100644 --- a/vp8/common/reconinter.c +++ b/vp8/common/reconinter.c @@ -20,193 +20,176 @@ #endif void vp8_copy_mem16x16_c( - unsigned char *src, - int src_stride, - unsigned char *dst, - int dst_stride) -{ + unsigned char *src, + int src_stride, + unsigned char *dst, + int dst_stride) { - int r; + int r; - for (r = 0; r < 16; r++) - { + for (r = 0; r < 16; r++) { #if !(CONFIG_FAST_UNALIGNED) - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; - dst[4] = src[4]; - dst[5] = src[5]; - dst[6] = src[6]; - dst[7] = src[7]; - dst[8] = src[8]; - dst[9] = src[9]; - dst[10] = src[10]; - dst[11] = src[11]; - dst[12] = src[12]; - dst[13] = src[13]; - dst[14] = src[14]; - dst[15] = src[15]; + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; + dst[4] = src[4]; + dst[5] = src[5]; + dst[6] = src[6]; + dst[7] = src[7]; + dst[8] = src[8]; + dst[9] = src[9]; + dst[10] = src[10]; + dst[11] = src[11]; + dst[12] = src[12]; + dst[13] = src[13]; + dst[14] = src[14]; + dst[15] = src[15]; #else - ((uint32_t *)dst)[0] = ((uint32_t *)src)[0] ; - ((uint32_t *)dst)[1] = ((uint32_t *)src)[1] ; - ((uint32_t *)dst)[2] = ((uint32_t *)src)[2] ; - ((uint32_t *)dst)[3] = ((uint32_t *)src)[3] ; + ((uint32_t *)dst)[0] = ((uint32_t *)src)[0]; + ((uint32_t *)dst)[1] = ((uint32_t *)src)[1]; + ((uint32_t *)dst)[2] = ((uint32_t *)src)[2]; + ((uint32_t *)dst)[3] = ((uint32_t *)src)[3]; #endif - src += src_stride; - dst += dst_stride; + src += src_stride; + dst += dst_stride; - } + } } void vp8_avg_mem16x16_c( - unsigned char *src, - int src_stride, - unsigned char *dst, - int dst_stride) -{ - int r; - - for (r = 0; r < 16; r++) - { - int n; - - for (n = 0; n < 16; n++) - { - dst[n] = (dst[n] + src[n] + 1) >> 1; - } + unsigned char *src, + int src_stride, + unsigned char *dst, + int dst_stride) { + int r; - src += src_stride; - dst += dst_stride; + for (r = 0; r < 16; r++) { + int n; + + for (n = 0; n < 16; n++) { + dst[n] = (dst[n] + src[n] + 1) >> 1; } + + src += src_stride; + dst += dst_stride; + } } void vp8_copy_mem8x8_c( - unsigned char *src, - int src_stride, - unsigned char *dst, - int dst_stride) -{ - int r; - - for (r = 0; r < 8; r++) - { + unsigned char *src, + int src_stride, + unsigned char *dst, + int dst_stride) { + int r; + + for (r = 0; r < 8; r++) { #if !(CONFIG_FAST_UNALIGNED) - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; - dst[4] = src[4]; - dst[5] = src[5]; - dst[6] = src[6]; - dst[7] = src[7]; + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; + dst[4] = src[4]; + dst[5] = src[5]; + dst[6] = src[6]; + dst[7] = src[7]; #else - ((uint32_t *)dst)[0] = ((uint32_t *)src)[0] ; - ((uint32_t *)dst)[1] = ((uint32_t *)src)[1] ; + ((uint32_t *)dst)[0] = ((uint32_t *)src)[0]; + ((uint32_t *)dst)[1] = ((uint32_t *)src)[1]; #endif - src += src_stride; - dst += dst_stride; + src += src_stride; + dst += dst_stride; - } + } } void vp8_avg_mem8x8_c( - unsigned char *src, - int src_stride, - unsigned char *dst, - int dst_stride) -{ - int r; - - for (r = 0; r < 8; r++) - { - int n; - - for (n = 0; n < 8; n++) - { - dst[n] = (dst[n] + src[n] + 1) >> 1; - } + unsigned char *src, + int src_stride, + unsigned char *dst, + int dst_stride) { + int r; - src += src_stride; - dst += dst_stride; + for (r = 0; r < 8; r++) { + int n; + + for (n = 0; n < 8; n++) { + dst[n] = (dst[n] + src[n] + 1) >> 1; } + + src += src_stride; + dst += dst_stride; + } } void vp8_copy_mem8x4_c( - unsigned char *src, - int src_stride, - unsigned char *dst, - int dst_stride) -{ - int r; - - for (r = 0; r < 4; r++) - { + unsigned char *src, + int src_stride, + unsigned char *dst, + int dst_stride) { + int r; + + for (r = 0; r < 4; r++) { #if !(CONFIG_FAST_UNALIGNED) - dst[0] = src[0]; - dst[1] = src[1]; - dst[2] = src[2]; - dst[3] = src[3]; - dst[4] = src[4]; - dst[5] = src[5]; - dst[6] = src[6]; - dst[7] = src[7]; + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; + dst[3] = src[3]; + dst[4] = src[4]; + dst[5] = src[5]; + dst[6] = src[6]; + dst[7] = src[7]; #else - ((uint32_t *)dst)[0] = ((uint32_t *)src)[0] ; - ((uint32_t *)dst)[1] = ((uint32_t *)src)[1] ; + ((uint32_t *)dst)[0] = ((uint32_t *)src)[0]; + ((uint32_t *)dst)[1] = ((uint32_t *)src)[1]; #endif - src += src_stride; - dst += dst_stride; + src += src_stride; + dst += dst_stride; - } + } } -void vp8_build_inter_predictors_b(BLOCKD *d, int pitch, vp8_subpix_fn_t sppf) -{ - int r; - unsigned char *ptr_base; - unsigned char *ptr; - unsigned char *pred_ptr = d->predictor; - int_mv mv; +void vp8_build_inter_predictors_b(BLOCKD *d, int pitch, vp8_subpix_fn_t sppf) { + int r; + unsigned char *ptr_base; + unsigned char *ptr; + unsigned char *pred_ptr = d->predictor; + int_mv mv; - ptr_base = *(d->base_pre); - mv.as_int = d->bmi.as_mv.first.as_int; + ptr_base = *(d->base_pre); + mv.as_int = d->bmi.as_mv.first.as_int; - if (mv.as_mv.row & 7 || mv.as_mv.col & 7) - { - ptr = ptr_base + d->pre + (mv.as_mv.row >> 3) * d->pre_stride + (mv.as_mv.col >> 3); + if (mv.as_mv.row & 7 || mv.as_mv.col & 7) { + ptr = ptr_base + d->pre + (mv.as_mv.row >> 3) * d->pre_stride + (mv.as_mv.col >> 3); #if CONFIG_SIXTEENTH_SUBPEL_UV - sppf(ptr, d->pre_stride, (mv.as_mv.col & 7)<<1, (mv.as_mv.row & 7)<<1, pred_ptr, pitch); + sppf(ptr, d->pre_stride, (mv.as_mv.col & 7) << 1, (mv.as_mv.row & 7) << 1, pred_ptr, pitch); #else - sppf(ptr, d->pre_stride, mv.as_mv.col & 7,mv.as_mv.row & 7, pred_ptr, pitch); + sppf(ptr, d->pre_stride, mv.as_mv.col & 7, mv.as_mv.row & 7, pred_ptr, pitch); #endif - } - else - { - ptr_base += d->pre + (mv.as_mv.row >> 3) * d->pre_stride + (mv.as_mv.col >> 3); - ptr = ptr_base; + } else { + ptr_base += d->pre + (mv.as_mv.row >> 3) * d->pre_stride + (mv.as_mv.col >> 3); + ptr = ptr_base; - for (r = 0; r < 4; r++) - { + for (r = 0; r < 4; r++) { #if !(CONFIG_FAST_UNALIGNED) - pred_ptr[0] = ptr[0]; - pred_ptr[1] = ptr[1]; - pred_ptr[2] = ptr[2]; - pred_ptr[3] = ptr[3]; + pred_ptr[0] = ptr[0]; + pred_ptr[1] = ptr[1]; + pred_ptr[2] = ptr[2]; + pred_ptr[3] = ptr[3]; #else - *(uint32_t *)pred_ptr = *(uint32_t *)ptr ; + *(uint32_t *)pred_ptr = *(uint32_t *)ptr; #endif - pred_ptr += pitch; - ptr += d->pre_stride; - } + pred_ptr += pitch; + ptr += d->pre_stride; } + } } /* @@ -215,66 +198,57 @@ void vp8_build_inter_predictors_b(BLOCKD *d, int pitch, vp8_subpix_fn_t sppf) * come from an earlier call to vp8_build_inter_predictors_b()) with the * predictor of the second reference frame / motion vector. */ -void vp8_build_2nd_inter_predictors_b(BLOCKD *d, int pitch, vp8_subpix_fn_t sppf) -{ - int r; - unsigned char *ptr_base; - unsigned char *ptr; - unsigned char *pred_ptr = d->predictor; - int_mv mv; - - ptr_base = *(d->base_second_pre); - mv.as_int = d->bmi.as_mv.second.as_int; - - if (mv.as_mv.row & 7 || mv.as_mv.col & 7) - { - ptr = ptr_base + d->pre + (mv.as_mv.row >> 3) * d->pre_stride + (mv.as_mv.col >> 3); +void vp8_build_2nd_inter_predictors_b(BLOCKD *d, int pitch, vp8_subpix_fn_t sppf) { + int r; + unsigned char *ptr_base; + unsigned char *ptr; + unsigned char *pred_ptr = d->predictor; + int_mv mv; + + ptr_base = *(d->base_second_pre); + mv.as_int = d->bmi.as_mv.second.as_int; + + if (mv.as_mv.row & 7 || mv.as_mv.col & 7) { + ptr = ptr_base + d->pre + (mv.as_mv.row >> 3) * d->pre_stride + (mv.as_mv.col >> 3); #if CONFIG_SIXTEENTH_SUBPEL_UV - sppf(ptr, d->pre_stride, (mv.as_mv.col & 7)<<1, (mv.as_mv.row & 7)<<1, pred_ptr, pitch); + sppf(ptr, d->pre_stride, (mv.as_mv.col & 7) << 1, (mv.as_mv.row & 7) << 1, pred_ptr, pitch); #else - sppf(ptr, d->pre_stride, mv.as_mv.col & 7,mv.as_mv.row & 7, pred_ptr, pitch); + sppf(ptr, d->pre_stride, mv.as_mv.col & 7, mv.as_mv.row & 7, pred_ptr, pitch); #endif + } else { + ptr_base += d->pre + (mv.as_mv.row >> 3) * d->pre_stride + (mv.as_mv.col >> 3); + ptr = ptr_base; + + for (r = 0; r < 4; r++) { + pred_ptr[0] = (pred_ptr[0] + ptr[0] + 1) >> 1; + pred_ptr[1] = (pred_ptr[1] + ptr[1] + 1) >> 1; + pred_ptr[2] = (pred_ptr[2] + ptr[2] + 1) >> 1; + pred_ptr[3] = (pred_ptr[3] + ptr[3] + 1) >> 1; + pred_ptr += pitch; + ptr += d->pre_stride; } - else - { - ptr_base += d->pre + (mv.as_mv.row >> 3) * d->pre_stride + (mv.as_mv.col >> 3); - ptr = ptr_base; - - for (r = 0; r < 4; r++) - { - pred_ptr[0] = (pred_ptr[0] + ptr[0] + 1) >> 1; - pred_ptr[1] = (pred_ptr[1] + ptr[1] + 1) >> 1; - pred_ptr[2] = (pred_ptr[2] + ptr[2] + 1) >> 1; - pred_ptr[3] = (pred_ptr[3] + ptr[3] + 1) >> 1; - pred_ptr += pitch; - ptr += d->pre_stride; - } - } + } } -static void build_inter_predictors4b(MACROBLOCKD *x, BLOCKD *d, int pitch) -{ - unsigned char *ptr_base; - unsigned char *ptr; - unsigned char *pred_ptr = d->predictor; - int_mv mv; +static void build_inter_predictors4b(MACROBLOCKD *x, BLOCKD *d, int pitch) { + unsigned char *ptr_base; + unsigned char *ptr; + unsigned char *pred_ptr = d->predictor; + int_mv mv; - ptr_base = *(d->base_pre); - mv.as_int = d->bmi.as_mv.first.as_int; - ptr = ptr_base + d->pre + (mv.as_mv.row >> 3) * d->pre_stride + (mv.as_mv.col >> 3); + ptr_base = *(d->base_pre); + mv.as_int = d->bmi.as_mv.first.as_int; + ptr = ptr_base + d->pre + (mv.as_mv.row >> 3) * d->pre_stride + (mv.as_mv.col >> 3); - if (mv.as_mv.row & 7 || mv.as_mv.col & 7) - { + if (mv.as_mv.row & 7 || mv.as_mv.col & 7) { #if CONFIG_SIXTEENTH_SUBPEL_UV - x->subpixel_predict8x8(ptr, d->pre_stride, (mv.as_mv.col & 7)<<1, (mv.as_mv.row & 7)<<1, pred_ptr, pitch); + x->subpixel_predict8x8(ptr, d->pre_stride, (mv.as_mv.col & 7) << 1, (mv.as_mv.row & 7) << 1, pred_ptr, pitch); #else - x->subpixel_predict8x8(ptr, d->pre_stride, mv.as_mv.col & 7, mv.as_mv.row & 7, pred_ptr, pitch); + x->subpixel_predict8x8(ptr, d->pre_stride, mv.as_mv.col & 7, mv.as_mv.row & 7, pred_ptr, pitch); #endif - } - else - { - RECON_INVOKE(&x->rtcd->recon, copy8x8)(ptr, d->pre_stride, pred_ptr, pitch); - } + } else { + RECON_INVOKE(&x->rtcd->recon, copy8x8)(ptr, d->pre_stride, pred_ptr, pitch); + } } /* @@ -283,54 +257,46 @@ static void build_inter_predictors4b(MACROBLOCKD *x, BLOCKD *d, int pitch) * come from an earlier call to build_inter_predictors_4b()) with the * predictor of the second reference frame / motion vector. */ -static void build_2nd_inter_predictors4b(MACROBLOCKD *x, BLOCKD *d, int pitch) -{ - unsigned char *ptr_base; - unsigned char *ptr; - unsigned char *pred_ptr = d->predictor; - int_mv mv; - - ptr_base = *(d->base_second_pre); - mv.as_int = d->bmi.as_mv.second.as_int; - ptr = ptr_base + d->pre + (mv.as_mv.row >> 3) * d->pre_stride + (mv.as_mv.col >> 3); +static void build_2nd_inter_predictors4b(MACROBLOCKD *x, BLOCKD *d, int pitch) { + unsigned char *ptr_base; + unsigned char *ptr; + unsigned char *pred_ptr = d->predictor; + int_mv mv; + + ptr_base = *(d->base_second_pre); + mv.as_int = d->bmi.as_mv.second.as_int; + ptr = ptr_base + d->pre + (mv.as_mv.row >> 3) * d->pre_stride + (mv.as_mv.col >> 3); - if (mv.as_mv.row & 7 || mv.as_mv.col & 7) - { + if (mv.as_mv.row & 7 || mv.as_mv.col & 7) { #if CONFIG_SIXTEENTH_SUBPEL_UV - x->subpixel_predict_avg8x8(ptr, d->pre_stride, (mv.as_mv.col & 7)<<1, (mv.as_mv.row & 7)<<1, pred_ptr, pitch); + x->subpixel_predict_avg8x8(ptr, d->pre_stride, (mv.as_mv.col & 7) << 1, (mv.as_mv.row & 7) << 1, pred_ptr, pitch); #else - x->subpixel_predict_avg8x8(ptr, d->pre_stride, mv.as_mv.col & 7, mv.as_mv.row & 7, pred_ptr, pitch); + x->subpixel_predict_avg8x8(ptr, d->pre_stride, mv.as_mv.col & 7, mv.as_mv.row & 7, pred_ptr, pitch); #endif - } - else - { - RECON_INVOKE(&x->rtcd->recon, avg8x8)(ptr, d->pre_stride, pred_ptr, pitch); - } + } else { + RECON_INVOKE(&x->rtcd->recon, avg8x8)(ptr, d->pre_stride, pred_ptr, pitch); + } } -static void build_inter_predictors2b(MACROBLOCKD *x, BLOCKD *d, int pitch) -{ - unsigned char *ptr_base; - unsigned char *ptr; - unsigned char *pred_ptr = d->predictor; - int_mv mv; +static void build_inter_predictors2b(MACROBLOCKD *x, BLOCKD *d, int pitch) { + unsigned char *ptr_base; + unsigned char *ptr; + unsigned char *pred_ptr = d->predictor; + int_mv mv; - ptr_base = *(d->base_pre); - mv.as_int = d->bmi.as_mv.first.as_int; - ptr = ptr_base + d->pre + (mv.as_mv.row >> 3) * d->pre_stride + (mv.as_mv.col >> 3); + ptr_base = *(d->base_pre); + mv.as_int = d->bmi.as_mv.first.as_int; + ptr = ptr_base + d->pre + (mv.as_mv.row >> 3) * d->pre_stride + (mv.as_mv.col >> 3); - if (mv.as_mv.row & 7 || mv.as_mv.col & 7) - { + if (mv.as_mv.row & 7 || mv.as_mv.col & 7) { #if CONFIG_SIXTEENTH_SUBPEL_UV - x->subpixel_predict8x4(ptr, d->pre_stride, (mv.as_mv.col & 7)<<1, (mv.as_mv.row & 7)<<1, pred_ptr, pitch); + x->subpixel_predict8x4(ptr, d->pre_stride, (mv.as_mv.col & 7) << 1, (mv.as_mv.row & 7) << 1, pred_ptr, pitch); #else - x->subpixel_predict8x4(ptr, d->pre_stride, mv.as_mv.col & 7, mv.as_mv.row & 7, pred_ptr, pitch); + x->subpixel_predict8x4(ptr, d->pre_stride, mv.as_mv.col & 7, mv.as_mv.row & 7, pred_ptr, pitch); #endif - } - else - { - RECON_INVOKE(&x->rtcd->recon, copy8x4)(ptr, d->pre_stride, pred_ptr, pitch); - } + } else { + RECON_INVOKE(&x->rtcd->recon, copy8x4)(ptr, d->pre_stride, pred_ptr, pitch); + } } @@ -349,439 +315,394 @@ static const int pred_filter[PRED_FILT_LEN] = {1, 2, 10, 2, 1}; #if !USE_THRESH_FILTER void filter_mb(unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, - int width, int height) -{ - int i, j, k; - unsigned int Temp[32*32]; - unsigned int *pTmp = Temp; - unsigned char *pSrc = src - (1 + src_stride) * (PRED_FILT_LEN/2); - - // Horizontal - for (i=0; i<height+PRED_FILT_LEN-1; i++) - { - for (j=0; j<width; j++) - { - int sum=0; - for (k=0; k<PRED_FILT_LEN; k++) - sum += pSrc[j+k] * pred_filter[k]; - pTmp[j] = sum; - } - - pSrc += src_stride; - pTmp += width; + int width, int height) { + int i, j, k; + unsigned int Temp[32 * 32]; + unsigned int *pTmp = Temp; + unsigned char *pSrc = src - (1 + src_stride) * (PRED_FILT_LEN / 2); + + // Horizontal + for (i = 0; i < height + PRED_FILT_LEN - 1; i++) { + for (j = 0; j < width; j++) { + int sum = 0; + for (k = 0; k < PRED_FILT_LEN; k++) + sum += pSrc[j + k] * pred_filter[k]; + pTmp[j] = sum; } - // Vertical - pTmp = Temp; - for (i=0; i<width; i++) - { - unsigned char *pDst = dst + i; - for (j=0; j<height; j++) - { - int sum=0; - for (k=0; k<PRED_FILT_LEN; k++) - sum += pTmp[(j+k)*width] * pred_filter[k]; - // Round - sum = (sum + ((1 << (filt_shift<<1))>>1)) >> (filt_shift << 1); - pDst[j*dst_stride] = (sum < 0 ? 0 : sum > 255 ? 255 : sum); - } - ++pTmp; + pSrc += src_stride; + pTmp += width; + } + + // Vertical + pTmp = Temp; + for (i = 0; i < width; i++) { + unsigned char *pDst = dst + i; + for (j = 0; j < height; j++) { + int sum = 0; + for (k = 0; k < PRED_FILT_LEN; k++) + sum += pTmp[(j + k) * width] * pred_filter[k]; + // Round + sum = (sum + ((1 << (filt_shift << 1)) >> 1)) >> (filt_shift << 1); + pDst[j * dst_stride] = (sum < 0 ? 0 : sum > 255 ? 255 : sum); } + ++pTmp; + } } #else // Based on vp8_post_proc_down_and_across_c (postproc.c) void filter_mb(unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, - int width, int height) -{ - unsigned char *pSrc, *pDst; - int row; - int col; - int i; - int v; - unsigned char d[8]; - - /* TODO flimit should be linked to the quantizer value */ - int flimit = 7; - - for (row = 0; row < height; row++) - { - /* post_proc_down for one row */ - pSrc = src; - pDst = dst; - - for (col = 0; col < width; col++) - { - int kernel = (1 << (filt_shift-1)); - int v = pSrc[col]; - - for (i = -2; i <= 2; i++) - { - if (abs(v - pSrc[col+i*src_stride]) > flimit) - goto down_skip_convolve; - - kernel += pred_filter[2+i] * pSrc[col+i*src_stride]; - } - - v = (kernel >> filt_shift); - down_skip_convolve: - pDst[col] = v; - } + int width, int height) { + unsigned char *pSrc, *pDst; + int row; + int col; + int i; + int v; + unsigned char d[8]; + + /* TODO flimit should be linked to the quantizer value */ + int flimit = 7; + + for (row = 0; row < height; row++) { + /* post_proc_down for one row */ + pSrc = src; + pDst = dst; + + for (col = 0; col < width; col++) { + int kernel = (1 << (filt_shift - 1)); + int v = pSrc[col]; + + for (i = -2; i <= 2; i++) { + if (abs(v - pSrc[col + i * src_stride]) > flimit) + goto down_skip_convolve; + + kernel += pred_filter[2 + i] * pSrc[col + i * src_stride]; + } + + v = (kernel >> filt_shift); + down_skip_convolve: + pDst[col] = v; + } - /* now post_proc_across */ - pSrc = dst; - pDst = dst; + /* now post_proc_across */ + pSrc = dst; + pDst = dst; - for (i = 0; i < 8; i++) - d[i] = pSrc[i]; + for (i = 0; i < 8; i++) + d[i] = pSrc[i]; - for (col = 0; col < width; col++) - { - int kernel = (1 << (filt_shift-1)); - v = pSrc[col]; + for (col = 0; col < width; col++) { + int kernel = (1 << (filt_shift - 1)); + v = pSrc[col]; - d[col&7] = v; + d[col & 7] = v; - for (i = -2; i <= 2; i++) - { - if (abs(v - pSrc[col+i]) > flimit) - goto across_skip_convolve; + for (i = -2; i <= 2; i++) { + if (abs(v - pSrc[col + i]) > flimit) + goto across_skip_convolve; - kernel += pred_filter[2+i] * pSrc[col+i]; - } + kernel += pred_filter[2 + i] * pSrc[col + i]; + } - d[col&7] = (kernel >> filt_shift); - across_skip_convolve: + d[col & 7] = (kernel >> filt_shift); + across_skip_convolve: - if (col >= 2) - pDst[col-2] = d[(col-2)&7]; - } + if (col >= 2) + pDst[col - 2] = d[(col - 2) & 7]; + } - /* handle the last two pixels */ - pDst[col-2] = d[(col-2)&7]; - pDst[col-1] = d[(col-1)&7]; + /* handle the last two pixels */ + pDst[col - 2] = d[(col - 2) & 7]; + pDst[col - 1] = d[(col - 1) & 7]; - /* next row */ - src += src_stride; - dst += dst_stride; - } + /* next row */ + src += src_stride; + dst += dst_stride; + } } #endif // !USE_THRESH_FILTER #endif // CONFIG_PRED_FILTER -void vp8_build_inter16x16_predictors_mbuv(MACROBLOCKD *xd) -{ - unsigned char *uptr, *vptr; - unsigned char *upred_ptr = &xd->predictor[256]; - unsigned char *vpred_ptr = &xd->predictor[320]; +void vp8_build_inter16x16_predictors_mbuv(MACROBLOCKD *xd) { + unsigned char *uptr, *vptr; + unsigned char *upred_ptr = &xd->predictor[256]; + unsigned char *vpred_ptr = &xd->predictor[320]; - int omv_row = xd->mode_info_context->mbmi.mv.as_mv.row; - int omv_col = xd->mode_info_context->mbmi.mv.as_mv.col; - int mv_row = omv_row; - int mv_col = omv_col; - int offset; - int pre_stride = xd->block[16].pre_stride; + int omv_row = xd->mode_info_context->mbmi.mv.as_mv.row; + int omv_col = xd->mode_info_context->mbmi.mv.as_mv.col; + int mv_row = omv_row; + int mv_col = omv_col; + int offset; + int pre_stride = xd->block[16].pre_stride; - /* calc uv motion vectors */ - if (mv_row < 0) - mv_row -= 1; - else - mv_row += 1; + /* calc uv motion vectors */ + if (mv_row < 0) + mv_row -= 1; + else + mv_row += 1; - if (mv_col < 0) - mv_col -= 1; - else - mv_col += 1; + if (mv_col < 0) + mv_col -= 1; + else + mv_col += 1; - mv_row /= 2; - mv_col /= 2; + mv_row /= 2; + mv_col /= 2; - mv_row &= xd->fullpixel_mask; - mv_col &= xd->fullpixel_mask; + mv_row &= xd->fullpixel_mask; + mv_col &= xd->fullpixel_mask; - offset = (mv_row >> 3) * pre_stride + (mv_col >> 3); - uptr = xd->pre.u_buffer + offset; - vptr = xd->pre.v_buffer + offset; + offset = (mv_row >> 3) * pre_stride + (mv_col >> 3); + uptr = xd->pre.u_buffer + offset; + vptr = xd->pre.v_buffer + offset; #if CONFIG_PRED_FILTER - if (xd->mode_info_context->mbmi.pred_filter_enabled) - { - int i; + if (xd->mode_info_context->mbmi.pred_filter_enabled) { + int i; #if CONFIG_ENHANCED_INTERP - int Interp_Extend = 4; // 8-tap filter needs 3+4 pels extension + int Interp_Extend = 4; // 8-tap filter needs 3+4 pels extension #else - int Interp_Extend = 3; // 6-tap filter needs 2+3 pels extension + int Interp_Extend = 3; // 6-tap filter needs 2+3 pels extension #endif - int len = 7 + (Interp_Extend << 1); - unsigned char Temp[32*32]; // Input data required by sub-pel filter - unsigned char *pTemp = Temp + (Interp_Extend-1)*(len+1); - unsigned char *pSrc = uptr; - unsigned char *pDst = upred_ptr; - - // U & V - for (i=0; i<2 ; i++) - { + int len = 7 + (Interp_Extend << 1); + unsigned char Temp[32 * 32]; // Input data required by sub-pel filter + unsigned char *pTemp = Temp + (Interp_Extend - 1) * (len + 1); + unsigned char *pSrc = uptr; + unsigned char *pDst = upred_ptr; + + // U & V + for (i = 0; i < 2; i++) { #if CONFIG_SIXTEENTH_SUBPEL_UV - if ((omv_row | omv_col) & 15) - { - // Copy extended MB into Temp array, applying the spatial filter - filter_mb(pSrc-(Interp_Extend-1)*(pre_stride+1), pre_stride, - Temp, len, len, len); - - // Sub-pel interpolation - xd->subpixel_predict8x8(pTemp, len, omv_col & 15, - omv_row & 15, pDst, 8); - } + if ((omv_row | omv_col) & 15) { + // Copy extended MB into Temp array, applying the spatial filter + filter_mb(pSrc - (Interp_Extend - 1) * (pre_stride + 1), pre_stride, + Temp, len, len, len); + + // Sub-pel interpolation + xd->subpixel_predict8x8(pTemp, len, omv_col & 15, + omv_row & 15, pDst, 8); + } #else /* CONFIG_SIXTEENTH_SUBPEL_UV */ - if ((mv_row | mv_col) & 7) - { - // Copy extended MB into Temp array, applying the spatial filter - filter_mb(pSrc-(Interp_Extend-1)*(pre_stride+1), pre_stride, - Temp, len, len, len); - - // Sub-pel interpolation - xd->subpixel_predict8x8(pTemp, len, mv_col & 7, - mv_row & 7, pDst, 8); - } + if ((mv_row | mv_col) & 7) { + // Copy extended MB into Temp array, applying the spatial filter + filter_mb(pSrc - (Interp_Extend - 1) * (pre_stride + 1), pre_stride, + Temp, len, len, len); + + // Sub-pel interpolation + xd->subpixel_predict8x8(pTemp, len, mv_col & 7, + mv_row & 7, pDst, 8); + } #endif /* CONFIG_SIXTEENTH_SUBPEL_UV */ - else - { - // Apply prediction filter as we copy from source to destination - filter_mb(pSrc, pre_stride, pDst, 8, 8, 8); - } - - // V - pSrc = vptr; - pDst = vpred_ptr; - } + else { + // Apply prediction filter as we copy from source to destination + filter_mb(pSrc, pre_stride, pDst, 8, 8, 8); + } + + // V + pSrc = vptr; + pDst = vpred_ptr; } - else + } else #endif #if CONFIG_SIXTEENTH_SUBPEL_UV - if ((omv_row | omv_col) & 15) - { - xd->subpixel_predict8x8(uptr, pre_stride, omv_col & 15, omv_row & 15, upred_ptr, 8); - xd->subpixel_predict8x8(vptr, pre_stride, omv_col & 15, omv_row & 15, vpred_ptr, 8); + if ((omv_row | omv_col) & 15) { + xd->subpixel_predict8x8(uptr, pre_stride, omv_col & 15, omv_row & 15, upred_ptr, 8); + xd->subpixel_predict8x8(vptr, pre_stride, omv_col & 15, omv_row & 15, vpred_ptr, 8); } #else /* CONFIG_SIXTEENTH_SUBPEL_UV */ - if ((mv_row | mv_col) & 7) - { - xd->subpixel_predict8x8(uptr, pre_stride, mv_col & 7, mv_row & 7, upred_ptr, 8); - xd->subpixel_predict8x8(vptr, pre_stride, mv_col & 7, mv_row & 7, vpred_ptr, 8); + if ((mv_row | mv_col) & 7) { + xd->subpixel_predict8x8(uptr, pre_stride, mv_col & 7, mv_row & 7, upred_ptr, 8); + xd->subpixel_predict8x8(vptr, pre_stride, mv_col & 7, mv_row & 7, vpred_ptr, 8); } #endif /* CONFIG_SIXTEENTH_SUBPEL_UV */ - else - { - RECON_INVOKE(&xd->rtcd->recon, copy8x8)(uptr, pre_stride, upred_ptr, 8); - RECON_INVOKE(&xd->rtcd->recon, copy8x8)(vptr, pre_stride, vpred_ptr, 8); + else { + RECON_INVOKE(&xd->rtcd->recon, copy8x8)(uptr, pre_stride, upred_ptr, 8); + RECON_INVOKE(&xd->rtcd->recon, copy8x8)(vptr, pre_stride, vpred_ptr, 8); } } /*encoder only*/ -void vp8_build_inter4x4_predictors_mbuv(MACROBLOCKD *x) -{ - int i, j; - - /* build uv mvs */ - for (i = 0; i < 2; i++) - { - for (j = 0; j < 2; j++) - { - int yoffset = i * 8 + j * 2; - int uoffset = 16 + i * 2 + j; - int voffset = 20 + i * 2 + j; - int temp; - - temp = x->block[yoffset ].bmi.as_mv.first.as_mv.row - + x->block[yoffset+1].bmi.as_mv.first.as_mv.row - + x->block[yoffset+4].bmi.as_mv.first.as_mv.row - + x->block[yoffset+5].bmi.as_mv.first.as_mv.row; - - if (temp < 0) temp -= 4; - else temp += 4; - - x->block[uoffset].bmi.as_mv.first.as_mv.row = (temp / 8) & x->fullpixel_mask; - - temp = x->block[yoffset ].bmi.as_mv.first.as_mv.col - + x->block[yoffset+1].bmi.as_mv.first.as_mv.col - + x->block[yoffset+4].bmi.as_mv.first.as_mv.col - + x->block[yoffset+5].bmi.as_mv.first.as_mv.col; - - if (temp < 0) temp -= 4; - else temp += 4; - - x->block[uoffset].bmi.as_mv.first.as_mv.col = (temp / 8) & x->fullpixel_mask; - - x->block[voffset].bmi.as_mv.first.as_mv.row = - x->block[uoffset].bmi.as_mv.first.as_mv.row ; - x->block[voffset].bmi.as_mv.first.as_mv.col = - x->block[uoffset].bmi.as_mv.first.as_mv.col ; - - if (x->mode_info_context->mbmi.second_ref_frame) - { - temp = x->block[yoffset ].bmi.as_mv.second.as_mv.row - + x->block[yoffset+1].bmi.as_mv.second.as_mv.row - + x->block[yoffset+4].bmi.as_mv.second.as_mv.row - + x->block[yoffset+5].bmi.as_mv.second.as_mv.row; - - if (temp < 0) - { - temp -= 4; - } - else - { - temp += 4; - } - - x->block[uoffset].bmi.as_mv.second.as_mv.row = (temp / 8) & x->fullpixel_mask; - - temp = x->block[yoffset ].bmi.as_mv.second.as_mv.col - + x->block[yoffset+1].bmi.as_mv.second.as_mv.col - + x->block[yoffset+4].bmi.as_mv.second.as_mv.col - + x->block[yoffset+5].bmi.as_mv.second.as_mv.col; - - if (temp < 0) - { - temp -= 4; - } - else - { - temp += 4; - } - - x->block[uoffset].bmi.as_mv.second.as_mv.col = (temp / 8) & x->fullpixel_mask; - - x->block[voffset].bmi.as_mv.second.as_mv.row = - x->block[uoffset].bmi.as_mv.second.as_mv.row ; - x->block[voffset].bmi.as_mv.second.as_mv.col = - x->block[uoffset].bmi.as_mv.second.as_mv.col ; - } +void vp8_build_inter4x4_predictors_mbuv(MACROBLOCKD *x) { + int i, j; + + /* build uv mvs */ + for (i = 0; i < 2; i++) { + for (j = 0; j < 2; j++) { + int yoffset = i * 8 + j * 2; + int uoffset = 16 + i * 2 + j; + int voffset = 20 + i * 2 + j; + int temp; + + temp = x->block[yoffset ].bmi.as_mv.first.as_mv.row + + x->block[yoffset + 1].bmi.as_mv.first.as_mv.row + + x->block[yoffset + 4].bmi.as_mv.first.as_mv.row + + x->block[yoffset + 5].bmi.as_mv.first.as_mv.row; + + if (temp < 0) temp -= 4; + else temp += 4; + + x->block[uoffset].bmi.as_mv.first.as_mv.row = (temp / 8) & x->fullpixel_mask; + + temp = x->block[yoffset ].bmi.as_mv.first.as_mv.col + + x->block[yoffset + 1].bmi.as_mv.first.as_mv.col + + x->block[yoffset + 4].bmi.as_mv.first.as_mv.col + + x->block[yoffset + 5].bmi.as_mv.first.as_mv.col; + + if (temp < 0) temp -= 4; + else temp += 4; + + x->block[uoffset].bmi.as_mv.first.as_mv.col = (temp / 8) & x->fullpixel_mask; + + x->block[voffset].bmi.as_mv.first.as_mv.row = + x->block[uoffset].bmi.as_mv.first.as_mv.row; + x->block[voffset].bmi.as_mv.first.as_mv.col = + x->block[uoffset].bmi.as_mv.first.as_mv.col; + + if (x->mode_info_context->mbmi.second_ref_frame) { + temp = x->block[yoffset ].bmi.as_mv.second.as_mv.row + + x->block[yoffset + 1].bmi.as_mv.second.as_mv.row + + x->block[yoffset + 4].bmi.as_mv.second.as_mv.row + + x->block[yoffset + 5].bmi.as_mv.second.as_mv.row; + + if (temp < 0) { + temp -= 4; + } else { + temp += 4; } - } - for (i = 16; i < 24; i += 2) - { - BLOCKD *d0 = &x->block[i]; - BLOCKD *d1 = &x->block[i+1]; - - if (d0->bmi.as_mv.first.as_int == d1->bmi.as_mv.first.as_int) - build_inter_predictors2b(x, d0, 8); - else - { - vp8_build_inter_predictors_b(d0, 8, x->subpixel_predict); - vp8_build_inter_predictors_b(d1, 8, x->subpixel_predict); - } + x->block[uoffset].bmi.as_mv.second.as_mv.row = (temp / 8) & x->fullpixel_mask; - if (x->mode_info_context->mbmi.second_ref_frame) - { - vp8_build_2nd_inter_predictors_b(d0, 8, x->subpixel_predict_avg); - vp8_build_2nd_inter_predictors_b(d1, 8, x->subpixel_predict_avg); + temp = x->block[yoffset ].bmi.as_mv.second.as_mv.col + + x->block[yoffset + 1].bmi.as_mv.second.as_mv.col + + x->block[yoffset + 4].bmi.as_mv.second.as_mv.col + + x->block[yoffset + 5].bmi.as_mv.second.as_mv.col; + + if (temp < 0) { + temp -= 4; + } else { + temp += 4; } + + x->block[uoffset].bmi.as_mv.second.as_mv.col = (temp / 8) & x->fullpixel_mask; + + x->block[voffset].bmi.as_mv.second.as_mv.row = + x->block[uoffset].bmi.as_mv.second.as_mv.row; + x->block[voffset].bmi.as_mv.second.as_mv.col = + x->block[uoffset].bmi.as_mv.second.as_mv.col; + } } + } + + for (i = 16; i < 24; i += 2) { + BLOCKD *d0 = &x->block[i]; + BLOCKD *d1 = &x->block[i + 1]; + + if (d0->bmi.as_mv.first.as_int == d1->bmi.as_mv.first.as_int) + build_inter_predictors2b(x, d0, 8); + else { + vp8_build_inter_predictors_b(d0, 8, x->subpixel_predict); + vp8_build_inter_predictors_b(d1, 8, x->subpixel_predict); + } + + if (x->mode_info_context->mbmi.second_ref_frame) { + vp8_build_2nd_inter_predictors_b(d0, 8, x->subpixel_predict_avg); + vp8_build_2nd_inter_predictors_b(d1, 8, x->subpixel_predict_avg); + } + } } /*encoder only*/ -void vp8_build_inter16x16_predictors_mby(MACROBLOCKD *xd) -{ - unsigned char *ptr_base; - unsigned char *ptr; - unsigned char *pred_ptr = xd->predictor; - int mv_row = xd->mode_info_context->mbmi.mv.as_mv.row; - int mv_col = xd->mode_info_context->mbmi.mv.as_mv.col; - int pre_stride = xd->block[0].pre_stride; - - ptr_base = xd->pre.y_buffer; - ptr = ptr_base + (mv_row >> 3) * pre_stride + (mv_col >> 3); +void vp8_build_inter16x16_predictors_mby(MACROBLOCKD *xd) { + unsigned char *ptr_base; + unsigned char *ptr; + unsigned char *pred_ptr = xd->predictor; + int mv_row = xd->mode_info_context->mbmi.mv.as_mv.row; + int mv_col = xd->mode_info_context->mbmi.mv.as_mv.col; + int pre_stride = xd->block[0].pre_stride; + + ptr_base = xd->pre.y_buffer; + ptr = ptr_base + (mv_row >> 3) * pre_stride + (mv_col >> 3); #if CONFIG_PRED_FILTER - if (xd->mode_info_context->mbmi.pred_filter_enabled) - { - // Produce predictor from the filtered source - if ((mv_row | mv_col) & 7) - { - // Sub-pel filter needs extended input + if (xd->mode_info_context->mbmi.pred_filter_enabled) { + // Produce predictor from the filtered source + if ((mv_row | mv_col) & 7) { + // Sub-pel filter needs extended input #if CONFIG_ENHANCED_INTERP - int Interp_Extend = 4; // 8-tap filter needs 3+4 pels extension + int Interp_Extend = 4; // 8-tap filter needs 3+4 pels extension #else - int Interp_Extend = 3; // 6-tap filter needs 2+3 pels extension + int Interp_Extend = 3; // 6-tap filter needs 2+3 pels extension #endif - int len = 15 + (Interp_Extend << 1); - unsigned char Temp[32*32]; // Data required by sub-pel filter - unsigned char *pTemp = Temp + (Interp_Extend-1)*(len+1); + int len = 15 + (Interp_Extend << 1); + unsigned char Temp[32 * 32]; // Data required by sub-pel filter + unsigned char *pTemp = Temp + (Interp_Extend - 1) * (len + 1); - // Copy extended MB into Temp array, applying the spatial filter - filter_mb(ptr-(Interp_Extend-1)*(pre_stride+1), pre_stride, - Temp, len, len, len); + // Copy extended MB into Temp array, applying the spatial filter + filter_mb(ptr - (Interp_Extend - 1) * (pre_stride + 1), pre_stride, + Temp, len, len, len); - // Sub-pel interpolation + // Sub-pel interpolation #if CONFIG_SIXTEENTH_SUBPEL_UV - xd->subpixel_predict16x16(pTemp, len, (mv_col & 7)<<1, - (mv_row & 7)<<1, pred_ptr, 16); + xd->subpixel_predict16x16(pTemp, len, (mv_col & 7) << 1, + (mv_row & 7) << 1, pred_ptr, 16); #else - xd->subpixel_predict16x16(pTemp, len, mv_col & 7, - mv_row & 7, pred_ptr, 16); + xd->subpixel_predict16x16(pTemp, len, mv_col & 7, + mv_row & 7, pred_ptr, 16); #endif - } - else - { - // Apply spatial filter to create the prediction directly - filter_mb(ptr, pre_stride, pred_ptr, 16, 16, 16); - } + } else { + // Apply spatial filter to create the prediction directly + filter_mb(ptr, pre_stride, pred_ptr, 16, 16, 16); } - else + } else #endif - if ((mv_row | mv_col) & 7) - { + if ((mv_row | mv_col) & 7) { #if CONFIG_SIXTEENTH_SUBPEL_UV - xd->subpixel_predict16x16(ptr, pre_stride, (mv_col & 7)<<1, - (mv_row & 7)<<1, pred_ptr, 16); + xd->subpixel_predict16x16(ptr, pre_stride, (mv_col & 7) << 1, + (mv_row & 7) << 1, pred_ptr, 16); #else - xd->subpixel_predict16x16(ptr, pre_stride, mv_col & 7, - mv_row & 7, pred_ptr, 16); + xd->subpixel_predict16x16(ptr, pre_stride, mv_col & 7, + mv_row & 7, pred_ptr, 16); #endif - } - else - { - RECON_INVOKE(&xd->rtcd->recon, copy16x16)(ptr, pre_stride, pred_ptr, 16); + } else { + RECON_INVOKE(&xd->rtcd->recon, copy16x16)(ptr, pre_stride, pred_ptr, 16); } } -static void clamp_mv_to_umv_border(MV *mv, const MACROBLOCKD *xd) -{ - /* If the MV points so far into the UMV border that no visible pixels - * are used for reconstruction, the subpel part of the MV can be - * discarded and the MV limited to 16 pixels with equivalent results. - * - * This limit kicks in at 19 pixels for the top and left edges, for - * the 16 pixels plus 3 taps right of the central pixel when subpel - * filtering. The bottom and right edges use 16 pixels plus 2 pixels - * left of the central pixel when filtering. - */ - if (mv->col < (xd->mb_to_left_edge - ((16+INTERP_EXTEND) << 3))) - mv->col = xd->mb_to_left_edge - (16 << 3); - else if (mv->col > xd->mb_to_right_edge + ((15+INTERP_EXTEND) << 3)) - mv->col = xd->mb_to_right_edge + (16 << 3); - - if (mv->row < (xd->mb_to_top_edge - ((16+INTERP_EXTEND) << 3))) - mv->row = xd->mb_to_top_edge - (16 << 3); - else if (mv->row > xd->mb_to_bottom_edge + ((15+INTERP_EXTEND) << 3)) - mv->row = xd->mb_to_bottom_edge + (16 << 3); +static void clamp_mv_to_umv_border(MV *mv, const MACROBLOCKD *xd) { + /* If the MV points so far into the UMV border that no visible pixels + * are used for reconstruction, the subpel part of the MV can be + * discarded and the MV limited to 16 pixels with equivalent results. + * + * This limit kicks in at 19 pixels for the top and left edges, for + * the 16 pixels plus 3 taps right of the central pixel when subpel + * filtering. The bottom and right edges use 16 pixels plus 2 pixels + * left of the central pixel when filtering. + */ + if (mv->col < (xd->mb_to_left_edge - ((16 + INTERP_EXTEND) << 3))) + mv->col = xd->mb_to_left_edge - (16 << 3); + else if (mv->col > xd->mb_to_right_edge + ((15 + INTERP_EXTEND) << 3)) + mv->col = xd->mb_to_right_edge + (16 << 3); + + if (mv->row < (xd->mb_to_top_edge - ((16 + INTERP_EXTEND) << 3))) + mv->row = xd->mb_to_top_edge - (16 << 3); + else if (mv->row > xd->mb_to_bottom_edge + ((15 + INTERP_EXTEND) << 3)) + mv->row = xd->mb_to_bottom_edge + (16 << 3); } /* A version of the above function for chroma block MVs.*/ -static void clamp_uvmv_to_umv_border(MV *mv, const MACROBLOCKD *xd) -{ - mv->col = (2*mv->col < (xd->mb_to_left_edge - ((16+INTERP_EXTEND) << 3))) ? - (xd->mb_to_left_edge - (16 << 3)) >> 1 : mv->col; - mv->col = (2*mv->col > xd->mb_to_right_edge + ((15+INTERP_EXTEND) << 3)) ? - (xd->mb_to_right_edge + (16 << 3)) >> 1 : mv->col; - - mv->row = (2*mv->row < (xd->mb_to_top_edge - ((16+INTERP_EXTEND) << 3))) ? - (xd->mb_to_top_edge - (16 << 3)) >> 1 : mv->row; - mv->row = (2*mv->row > xd->mb_to_bottom_edge + ((15+INTERP_EXTEND) << 3)) ? - (xd->mb_to_bottom_edge + (16 << 3)) >> 1 : mv->row; +static void clamp_uvmv_to_umv_border(MV *mv, const MACROBLOCKD *xd) { + mv->col = (2 * mv->col < (xd->mb_to_left_edge - ((16 + INTERP_EXTEND) << 3))) ? + (xd->mb_to_left_edge - (16 << 3)) >> 1 : mv->col; + mv->col = (2 * mv->col > xd->mb_to_right_edge + ((15 + INTERP_EXTEND) << 3)) ? + (xd->mb_to_right_edge + (16 << 3)) >> 1 : mv->col; + + mv->row = (2 * mv->row < (xd->mb_to_top_edge - ((16 + INTERP_EXTEND) << 3))) ? + (xd->mb_to_top_edge - (16 << 3)) >> 1 : mv->row; + mv->row = (2 * mv->row > xd->mb_to_bottom_edge + ((15 + INTERP_EXTEND) << 3)) ? + (xd->mb_to_bottom_edge + (16 << 3)) >> 1 : mv->row; } @@ -791,182 +712,163 @@ void vp8_build_inter16x16_predictors_mb(MACROBLOCKD *x, unsigned char *dst_u, unsigned char *dst_v, int dst_ystride, - int dst_uvstride) -{ - int offset; - unsigned char *ptr; - unsigned char *uptr, *vptr; + int dst_uvstride) { + int offset; + unsigned char *ptr; + unsigned char *uptr, *vptr; - int_mv _o16x16mv; - int_mv _16x16mv; + int_mv _o16x16mv; + int_mv _16x16mv; - unsigned char *ptr_base = x->pre.y_buffer; - int pre_stride = x->block[0].pre_stride; + unsigned char *ptr_base = x->pre.y_buffer; + int pre_stride = x->block[0].pre_stride; - _16x16mv.as_int = x->mode_info_context->mbmi.mv.as_int; + _16x16mv.as_int = x->mode_info_context->mbmi.mv.as_int; - if (x->mode_info_context->mbmi.need_to_clamp_mvs) - { - clamp_mv_to_umv_border(&_16x16mv.as_mv, x); - } + if (x->mode_info_context->mbmi.need_to_clamp_mvs) { + clamp_mv_to_umv_border(&_16x16mv.as_mv, x); + } - ptr = ptr_base + (_16x16mv.as_mv.row >> 3) * pre_stride + - (_16x16mv.as_mv.col >> 3); + ptr = ptr_base + (_16x16mv.as_mv.row >> 3) * pre_stride + + (_16x16mv.as_mv.col >> 3); #if CONFIG_PRED_FILTER - if (x->mode_info_context->mbmi.pred_filter_enabled) - { - if ( _16x16mv.as_int & 0x00070007) - { - // Sub-pel filter needs extended input + if (x->mode_info_context->mbmi.pred_filter_enabled) { + if (_16x16mv.as_int & 0x00070007) { + // Sub-pel filter needs extended input #if CONFIG_ENHANCED_INTERP - int Interp_Extend = 4; // 8-tap filter needs 3+4 pels extension + int Interp_Extend = 4; // 8-tap filter needs 3+4 pels extension #else - int Interp_Extend = 3; // 6-tap filter needs 2+3 pels extension + int Interp_Extend = 3; // 6-tap filter needs 2+3 pels extension #endif - int len = 15 + (Interp_Extend << 1); - unsigned char Temp[32*32]; // Data required by the sub-pel filter - unsigned char *pTemp = Temp + (Interp_Extend-1)*(len+1); + int len = 15 + (Interp_Extend << 1); + unsigned char Temp[32 * 32]; // Data required by the sub-pel filter + unsigned char *pTemp = Temp + (Interp_Extend - 1) * (len + 1); - // Copy extended MB into Temp array, applying the spatial filter - filter_mb(ptr-(Interp_Extend-1)*(pre_stride+1), pre_stride, - Temp, len, len, len); + // Copy extended MB into Temp array, applying the spatial filter + filter_mb(ptr - (Interp_Extend - 1) * (pre_stride + 1), pre_stride, + Temp, len, len, len); - // Sub-pel filter + // Sub-pel filter #if CONFIG_SIXTEENTH_SUBPEL_UV - x->subpixel_predict16x16(pTemp, len, - (_16x16mv.as_mv.col & 7)<<1, - (_16x16mv.as_mv.row & 7)<<1, - dst_y, dst_ystride); + x->subpixel_predict16x16(pTemp, len, + (_16x16mv.as_mv.col & 7) << 1, + (_16x16mv.as_mv.row & 7) << 1, + dst_y, dst_ystride); #else - x->subpixel_predict16x16(pTemp, len, - _16x16mv.as_mv.col & 7, - _16x16mv.as_mv.row & 7, - dst_y, dst_ystride); + x->subpixel_predict16x16(pTemp, len, + _16x16mv.as_mv.col & 7, + _16x16mv.as_mv.row & 7, + dst_y, dst_ystride); #endif - } - else - { - // Apply spatial filter to create the prediction directly - filter_mb(ptr, pre_stride, dst_y, dst_ystride, 16, 16); - } + } else { + // Apply spatial filter to create the prediction directly + filter_mb(ptr, pre_stride, dst_y, dst_ystride, 16, 16); } - else + } else #endif - if ( _16x16mv.as_int & 0x00070007) - { + if (_16x16mv.as_int & 0x00070007) { #if CONFIG_SIXTEENTH_SUBPEL_UV - x->subpixel_predict16x16(ptr, pre_stride, (_16x16mv.as_mv.col & 7)<<1, - (_16x16mv.as_mv.row & 7)<<1, - dst_y, dst_ystride); + x->subpixel_predict16x16(ptr, pre_stride, (_16x16mv.as_mv.col & 7) << 1, + (_16x16mv.as_mv.row & 7) << 1, + dst_y, dst_ystride); #else - x->subpixel_predict16x16(ptr, pre_stride, _16x16mv.as_mv.col & 7, - _16x16mv.as_mv.row & 7, dst_y, dst_ystride); + x->subpixel_predict16x16(ptr, pre_stride, _16x16mv.as_mv.col & 7, + _16x16mv.as_mv.row & 7, dst_y, dst_ystride); #endif - } - else - { - RECON_INVOKE(&x->rtcd->recon, copy16x16)(ptr, pre_stride, dst_y, - dst_ystride); + } else { + RECON_INVOKE(&x->rtcd->recon, copy16x16)(ptr, pre_stride, dst_y, + dst_ystride); } - _o16x16mv = _16x16mv; - /* calc uv motion vectors */ - if ( _16x16mv.as_mv.row < 0) - _16x16mv.as_mv.row -= 1; - else - _16x16mv.as_mv.row += 1; + _o16x16mv = _16x16mv; + /* calc uv motion vectors */ + if (_16x16mv.as_mv.row < 0) + _16x16mv.as_mv.row -= 1; + else + _16x16mv.as_mv.row += 1; - if (_16x16mv.as_mv.col < 0) - _16x16mv.as_mv.col -= 1; - else - _16x16mv.as_mv.col += 1; + if (_16x16mv.as_mv.col < 0) + _16x16mv.as_mv.col -= 1; + else + _16x16mv.as_mv.col += 1; - _16x16mv.as_mv.row /= 2; - _16x16mv.as_mv.col /= 2; + _16x16mv.as_mv.row /= 2; + _16x16mv.as_mv.col /= 2; - _16x16mv.as_mv.row &= x->fullpixel_mask; - _16x16mv.as_mv.col &= x->fullpixel_mask; + _16x16mv.as_mv.row &= x->fullpixel_mask; + _16x16mv.as_mv.col &= x->fullpixel_mask; - pre_stride >>= 1; - offset = ( _16x16mv.as_mv.row >> 3) * pre_stride + (_16x16mv.as_mv.col >> 3); - uptr = x->pre.u_buffer + offset; - vptr = x->pre.v_buffer + offset; + pre_stride >>= 1; + offset = (_16x16mv.as_mv.row >> 3) * pre_stride + (_16x16mv.as_mv.col >> 3); + uptr = x->pre.u_buffer + offset; + vptr = x->pre.v_buffer + offset; #if CONFIG_PRED_FILTER - if (x->mode_info_context->mbmi.pred_filter_enabled) - { - int i; - unsigned char *pSrc = uptr; - unsigned char *pDst = dst_u; + if (x->mode_info_context->mbmi.pred_filter_enabled) { + int i; + unsigned char *pSrc = uptr; + unsigned char *pDst = dst_u; #if CONFIG_ENHANCED_INTERP - int Interp_Extend = 4; // 8-tap filter needs 3+4 pels extension + int Interp_Extend = 4; // 8-tap filter needs 3+4 pels extension #else - int Interp_Extend = 3; // 6-tap filter needs 2+3 pels extension + int Interp_Extend = 3; // 6-tap filter needs 2+3 pels extension #endif - int len = 7 + (Interp_Extend << 1); - unsigned char Temp[32*32]; // Data required by the sub-pel filter - unsigned char *pTemp = Temp + (Interp_Extend-1)*(len+1); + int len = 7 + (Interp_Extend << 1); + unsigned char Temp[32 * 32]; // Data required by the sub-pel filter + unsigned char *pTemp = Temp + (Interp_Extend - 1) * (len + 1); - // U & V - for (i=0; i<2; i++) - { + // U & V + for (i = 0; i < 2; i++) { #if CONFIG_SIXTEENTH_SUBPEL_UV - if ( _o16x16mv.as_int & 0x000f000f) - { - // Copy extended MB into Temp array, applying the spatial filter - filter_mb(pSrc-(Interp_Extend-1)*(pre_stride+1), pre_stride, - Temp, len, len, len); - - // Sub-pel filter - x->subpixel_predict8x8(pTemp, len, - _o16x16mv.as_mv.col & 15, - _o16x16mv.as_mv.row & 15, - pDst, dst_uvstride); - } + if (_o16x16mv.as_int & 0x000f000f) { + // Copy extended MB into Temp array, applying the spatial filter + filter_mb(pSrc - (Interp_Extend - 1) * (pre_stride + 1), pre_stride, + Temp, len, len, len); + + // Sub-pel filter + x->subpixel_predict8x8(pTemp, len, + _o16x16mv.as_mv.col & 15, + _o16x16mv.as_mv.row & 15, + pDst, dst_uvstride); + } #else /* CONFIG_SIXTEENTH_SUBPEL_UV */ - if ( _16x16mv.as_int & 0x00070007) - { - // Copy extended MB into Temp array, applying the spatial filter - filter_mb(pSrc-(Interp_Extend-1)*(pre_stride+1), pre_stride, - Temp, len, len, len); - - // Sub-pel filter - x->subpixel_predict8x8(pTemp, len, - _16x16mv.as_mv.col & 7, - _16x16mv.as_mv.row & 7, - pDst, dst_uvstride); - } + if (_16x16mv.as_int & 0x00070007) { + // Copy extended MB into Temp array, applying the spatial filter + filter_mb(pSrc - (Interp_Extend - 1) * (pre_stride + 1), pre_stride, + Temp, len, len, len); + + // Sub-pel filter + x->subpixel_predict8x8(pTemp, len, + _16x16mv.as_mv.col & 7, + _16x16mv.as_mv.row & 7, + pDst, dst_uvstride); + } #endif /* CONFIG_SIXTEENTH_SUBPEL_UV */ - else - { - filter_mb(pSrc, pre_stride, pDst, dst_uvstride, 8, 8); - } - - // V - pSrc = vptr; - pDst = dst_v; - } + else { + filter_mb(pSrc, pre_stride, pDst, dst_uvstride, 8, 8); + } + + // V + pSrc = vptr; + pDst = dst_v; } - else + } else #endif #if CONFIG_SIXTEENTH_SUBPEL_UV - if ( _o16x16mv.as_int & 0x000f000f) - { - x->subpixel_predict8x8(uptr, pre_stride, _o16x16mv.as_mv.col & 15, _o16x16mv.as_mv.row & 15, dst_u, dst_uvstride); - x->subpixel_predict8x8(vptr, pre_stride, _o16x16mv.as_mv.col & 15, _o16x16mv.as_mv.row & 15, dst_v, dst_uvstride); + if (_o16x16mv.as_int & 0x000f000f) { + x->subpixel_predict8x8(uptr, pre_stride, _o16x16mv.as_mv.col & 15, _o16x16mv.as_mv.row & 15, dst_u, dst_uvstride); + x->subpixel_predict8x8(vptr, pre_stride, _o16x16mv.as_mv.col & 15, _o16x16mv.as_mv.row & 15, dst_v, dst_uvstride); } #else /* CONFIG_SIXTEENTH_SUBPEL_UV */ - if ( _16x16mv.as_int & 0x00070007) - { - x->subpixel_predict8x8(uptr, pre_stride, _16x16mv.as_mv.col & 7, _16x16mv.as_mv.row & 7, dst_u, dst_uvstride); - x->subpixel_predict8x8(vptr, pre_stride, _16x16mv.as_mv.col & 7, _16x16mv.as_mv.row & 7, dst_v, dst_uvstride); + if (_16x16mv.as_int & 0x00070007) { + x->subpixel_predict8x8(uptr, pre_stride, _16x16mv.as_mv.col & 7, _16x16mv.as_mv.row & 7, dst_u, dst_uvstride); + x->subpixel_predict8x8(vptr, pre_stride, _16x16mv.as_mv.col & 7, _16x16mv.as_mv.row & 7, dst_v, dst_uvstride); } #endif /* CONFIG_SIXTEENTH_SUBPEL_UV */ - else - { - RECON_INVOKE(&x->rtcd->recon, copy8x8)(uptr, pre_stride, dst_u, dst_uvstride); - RECON_INVOKE(&x->rtcd->recon, copy8x8)(vptr, pre_stride, dst_v, dst_uvstride); + else { + RECON_INVOKE(&x->rtcd->recon, copy8x8)(uptr, pre_stride, dst_u, dst_uvstride); + RECON_INVOKE(&x->rtcd->recon, copy8x8)(vptr, pre_stride, dst_v, dst_uvstride); } } @@ -990,392 +892,343 @@ void vp8_build_2nd_inter16x16_predictors_mb(MACROBLOCKD *x, unsigned char *dst_u, unsigned char *dst_v, int dst_ystride, - int dst_uvstride) -{ - int offset; - unsigned char *ptr; - unsigned char *uptr, *vptr; + int dst_uvstride) { + int offset; + unsigned char *ptr; + unsigned char *uptr, *vptr; - int_mv _16x16mv; - int mv_row; - int mv_col; + int_mv _16x16mv; + int mv_row; + int mv_col; - int omv_row, omv_col; + int omv_row, omv_col; - unsigned char *ptr_base = x->second_pre.y_buffer; - int pre_stride = x->block[0].pre_stride; + unsigned char *ptr_base = x->second_pre.y_buffer; + int pre_stride = x->block[0].pre_stride; - _16x16mv.as_int = x->mode_info_context->mbmi.second_mv.as_int; + _16x16mv.as_int = x->mode_info_context->mbmi.second_mv.as_int; - if (x->mode_info_context->mbmi.need_to_clamp_secondmv) - { - clamp_mv_to_umv_border(&_16x16mv.as_mv, x); - } + if (x->mode_info_context->mbmi.need_to_clamp_secondmv) { + clamp_mv_to_umv_border(&_16x16mv.as_mv, x); + } - mv_row = _16x16mv.as_mv.row; - mv_col = _16x16mv.as_mv.col; + mv_row = _16x16mv.as_mv.row; + mv_col = _16x16mv.as_mv.col; - ptr = ptr_base + (mv_row >> 3) * pre_stride + (mv_col >> 3); + ptr = ptr_base + (mv_row >> 3) * pre_stride + (mv_col >> 3); #if CONFIG_PRED_FILTER - if (x->mode_info_context->mbmi.pred_filter_enabled) - { - if ((mv_row | mv_col) & 7) - { - // Sub-pel filter needs extended input + if (x->mode_info_context->mbmi.pred_filter_enabled) { + if ((mv_row | mv_col) & 7) { + // Sub-pel filter needs extended input #if CONFIG_ENHANCED_INTERP - int Interp_Extend = 4; // 8-tap filter needs 3+4 pels extension + int Interp_Extend = 4; // 8-tap filter needs 3+4 pels extension #else - int Interp_Extend = 3; // 6-tap filter needs 2+3 pels extension + int Interp_Extend = 3; // 6-tap filter needs 2+3 pels extension #endif - int len = 15 + (Interp_Extend << 1); - unsigned char Temp[32*32]; // Data required by sub-pel filter - unsigned char *pTemp = Temp + (Interp_Extend-1)*(len+1); + int len = 15 + (Interp_Extend << 1); + unsigned char Temp[32 * 32]; // Data required by sub-pel filter + unsigned char *pTemp = Temp + (Interp_Extend - 1) * (len + 1); - // Copy extended MB into Temp array, applying the spatial filter - filter_mb(ptr-(Interp_Extend-1)*(pre_stride+1), pre_stride, - Temp, len, len, len); + // Copy extended MB into Temp array, applying the spatial filter + filter_mb(ptr - (Interp_Extend - 1) * (pre_stride + 1), pre_stride, + Temp, len, len, len); - // Sub-pel filter + // Sub-pel filter #if CONFIG_SIXTEENTH_SUBPEL_UV - x->subpixel_predict_avg16x16(pTemp, len, (mv_col & 7)<<1, - (mv_row & 7)<<1, dst_y, dst_ystride); + x->subpixel_predict_avg16x16(pTemp, len, (mv_col & 7) << 1, + (mv_row & 7) << 1, dst_y, dst_ystride); #else - x->subpixel_predict_avg16x16(pTemp, len, mv_col & 7, - mv_row & 7, dst_y, dst_ystride); + x->subpixel_predict_avg16x16(pTemp, len, mv_col & 7, + mv_row & 7, dst_y, dst_ystride); #endif - } - else - { - // TODO Needs to AVERAGE with the dst_y - // For now, do not apply the prediction filter in these cases! - RECON_INVOKE(&x->rtcd->recon, avg16x16)(ptr, pre_stride, dst_y, - dst_ystride); - } + } else { + // TODO Needs to AVERAGE with the dst_y + // For now, do not apply the prediction filter in these cases! + RECON_INVOKE(&x->rtcd->recon, avg16x16)(ptr, pre_stride, dst_y, + dst_ystride); } - else + } else #endif // CONFIG_PRED_FILTER - { - if ((mv_row | mv_col) & 7) - { + { + if ((mv_row | mv_col) & 7) { #if CONFIG_SIXTEENTH_SUBPEL_UV - x->subpixel_predict_avg16x16(ptr, pre_stride, (mv_col & 7)<<1, - (mv_row & 7)<<1, dst_y, dst_ystride); + x->subpixel_predict_avg16x16(ptr, pre_stride, (mv_col & 7) << 1, + (mv_row & 7) << 1, dst_y, dst_ystride); #else - x->subpixel_predict_avg16x16(ptr, pre_stride, mv_col & 7, - mv_row & 7, dst_y, dst_ystride); + x->subpixel_predict_avg16x16(ptr, pre_stride, mv_col & 7, + mv_row & 7, dst_y, dst_ystride); #endif - } - else - { - RECON_INVOKE(&x->rtcd->recon, avg16x16)(ptr, pre_stride, dst_y, - dst_ystride); - } + } else { + RECON_INVOKE(&x->rtcd->recon, avg16x16)(ptr, pre_stride, dst_y, + dst_ystride); } + } - /* calc uv motion vectors */ - omv_row = mv_row; - omv_col = mv_col; - mv_row = (mv_row + (mv_row > 0)) >> 1; - mv_col = (mv_col + (mv_col > 0)) >> 1; + /* calc uv motion vectors */ + omv_row = mv_row; + omv_col = mv_col; + mv_row = (mv_row + (mv_row > 0)) >> 1; + mv_col = (mv_col + (mv_col > 0)) >> 1; - mv_row &= x->fullpixel_mask; - mv_col &= x->fullpixel_mask; + mv_row &= x->fullpixel_mask; + mv_col &= x->fullpixel_mask; - pre_stride >>= 1; - offset = (mv_row >> 3) * pre_stride + (mv_col >> 3); - uptr = x->second_pre.u_buffer + offset; - vptr = x->second_pre.v_buffer + offset; + pre_stride >>= 1; + offset = (mv_row >> 3) * pre_stride + (mv_col >> 3); + uptr = x->second_pre.u_buffer + offset; + vptr = x->second_pre.v_buffer + offset; #if CONFIG_PRED_FILTER - if (x->mode_info_context->mbmi.pred_filter_enabled) - { - int i; + if (x->mode_info_context->mbmi.pred_filter_enabled) { + int i; #if CONFIG_ENHANCED_INTERP - int Interp_Extend = 4; // 8-tap filter needs 3+4 pels extension + int Interp_Extend = 4; // 8-tap filter needs 3+4 pels extension #else - int Interp_Extend = 3; // 6-tap filter needs 2+3 pels extension + int Interp_Extend = 3; // 6-tap filter needs 2+3 pels extension #endif - int len = 7 + (Interp_Extend << 1); - unsigned char Temp[32*32]; // Data required by sub-pel filter - unsigned char *pTemp = Temp + (Interp_Extend-1)*(len+1); - unsigned char *pSrc = uptr; - unsigned char *pDst = dst_u; - - // U & V - for (i=0; i<2; i++) - { + int len = 7 + (Interp_Extend << 1); + unsigned char Temp[32 * 32]; // Data required by sub-pel filter + unsigned char *pTemp = Temp + (Interp_Extend - 1) * (len + 1); + unsigned char *pSrc = uptr; + unsigned char *pDst = dst_u; + + // U & V + for (i = 0; i < 2; i++) { #if CONFIG_SIXTEENTH_SUBPEL_UV - if ((omv_row | omv_col) & 15) - { - // Copy extended MB into Temp array, applying the spatial filter - filter_mb(pSrc-(Interp_Extend-1)*(pre_stride+1), pre_stride, - Temp, len, len, len); - - // Sub-pel filter - x->subpixel_predict_avg8x8(pTemp, len, omv_col & 15, - omv_row & 15, pDst, dst_uvstride); - } + if ((omv_row | omv_col) & 15) { + // Copy extended MB into Temp array, applying the spatial filter + filter_mb(pSrc - (Interp_Extend - 1) * (pre_stride + 1), pre_stride, + Temp, len, len, len); + + // Sub-pel filter + x->subpixel_predict_avg8x8(pTemp, len, omv_col & 15, + omv_row & 15, pDst, dst_uvstride); + } #else /* CONFIG_SIXTEENTH_SUBPEL_UV */ - if ((mv_row | mv_col) & 7) - { - // Copy extended MB into Temp array, applying the spatial filter - filter_mb(pSrc-(Interp_Extend-1)*(pre_stride+1), pre_stride, - Temp, len, len, len); - - // Sub-pel filter - x->subpixel_predict_avg8x8(pTemp, len, mv_col & 7, mv_row & 7, - pDst, dst_uvstride); - } + if ((mv_row | mv_col) & 7) { + // Copy extended MB into Temp array, applying the spatial filter + filter_mb(pSrc - (Interp_Extend - 1) * (pre_stride + 1), pre_stride, + Temp, len, len, len); + + // Sub-pel filter + x->subpixel_predict_avg8x8(pTemp, len, mv_col & 7, mv_row & 7, + pDst, dst_uvstride); + } #endif /* CONFIG_SIXTEENTH_SUBPEL_UV */ - else - { - // TODO Needs to AVERAGE with the dst_[u|v] - // For now, do not apply the prediction filter here! - RECON_INVOKE(&x->rtcd->recon, avg8x8)(pSrc, pre_stride, pDst, - dst_uvstride); - } - - // V - pSrc = vptr; - pDst = dst_v; - } + else { + // TODO Needs to AVERAGE with the dst_[u|v] + // For now, do not apply the prediction filter here! + RECON_INVOKE(&x->rtcd->recon, avg8x8)(pSrc, pre_stride, pDst, + dst_uvstride); + } + + // V + pSrc = vptr; + pDst = dst_v; } - else + } else #endif // CONFIG_PRED_FILTER #if CONFIG_SIXTEENTH_SUBPEL_UV - if ((omv_row | omv_col) & 15) - { - x->subpixel_predict_avg8x8(uptr, pre_stride, omv_col & 15, omv_row & 15, dst_u, dst_uvstride); - x->subpixel_predict_avg8x8(vptr, pre_stride, omv_col & 15, omv_row & 15, dst_v, dst_uvstride); + if ((omv_row | omv_col) & 15) { + x->subpixel_predict_avg8x8(uptr, pre_stride, omv_col & 15, omv_row & 15, dst_u, dst_uvstride); + x->subpixel_predict_avg8x8(vptr, pre_stride, omv_col & 15, omv_row & 15, dst_v, dst_uvstride); } #else /* CONFIG_SIXTEENTH_SUBPEL_UV */ - if ((mv_row | mv_col) & 7) - { - x->subpixel_predict_avg8x8(uptr, pre_stride, mv_col & 7, mv_row & 7, dst_u, dst_uvstride); - x->subpixel_predict_avg8x8(vptr, pre_stride, mv_col & 7, mv_row & 7, dst_v, dst_uvstride); + if ((mv_row | mv_col) & 7) { + x->subpixel_predict_avg8x8(uptr, pre_stride, mv_col & 7, mv_row & 7, dst_u, dst_uvstride); + x->subpixel_predict_avg8x8(vptr, pre_stride, mv_col & 7, mv_row & 7, dst_v, dst_uvstride); } #endif /* CONFIG_SIXTEENTH_SUBPEL_UV */ - else - { - RECON_INVOKE(&x->rtcd->recon, avg8x8)(uptr, pre_stride, dst_u, dst_uvstride); - RECON_INVOKE(&x->rtcd->recon, avg8x8)(vptr, pre_stride, dst_v, dst_uvstride); + else { + RECON_INVOKE(&x->rtcd->recon, avg8x8)(uptr, pre_stride, dst_u, dst_uvstride); + RECON_INVOKE(&x->rtcd->recon, avg8x8)(vptr, pre_stride, dst_v, dst_uvstride); } } -static void build_inter4x4_predictors_mb(MACROBLOCKD *x) -{ - int i; - - if (x->mode_info_context->mbmi.partitioning < 3) - { - x->block[ 0].bmi = x->mode_info_context->bmi[ 0]; - x->block[ 2].bmi = x->mode_info_context->bmi[ 2]; - x->block[ 8].bmi = x->mode_info_context->bmi[ 8]; - x->block[10].bmi = x->mode_info_context->bmi[10]; - - if (x->mode_info_context->mbmi.need_to_clamp_mvs) - { - clamp_mv_to_umv_border(&x->block[ 0].bmi.as_mv.first.as_mv, x); - clamp_mv_to_umv_border(&x->block[ 2].bmi.as_mv.first.as_mv, x); - clamp_mv_to_umv_border(&x->block[ 8].bmi.as_mv.first.as_mv, x); - clamp_mv_to_umv_border(&x->block[10].bmi.as_mv.first.as_mv, x); - if (x->mode_info_context->mbmi.second_ref_frame) - { - clamp_mv_to_umv_border(&x->block[ 0].bmi.as_mv.second.as_mv, x); - clamp_mv_to_umv_border(&x->block[ 2].bmi.as_mv.second.as_mv, x); - clamp_mv_to_umv_border(&x->block[ 8].bmi.as_mv.second.as_mv, x); - clamp_mv_to_umv_border(&x->block[10].bmi.as_mv.second.as_mv, x); - } - } +static void build_inter4x4_predictors_mb(MACROBLOCKD *x) { + int i; + + if (x->mode_info_context->mbmi.partitioning < 3) { + x->block[ 0].bmi = x->mode_info_context->bmi[ 0]; + x->block[ 2].bmi = x->mode_info_context->bmi[ 2]; + x->block[ 8].bmi = x->mode_info_context->bmi[ 8]; + x->block[10].bmi = x->mode_info_context->bmi[10]; + + if (x->mode_info_context->mbmi.need_to_clamp_mvs) { + clamp_mv_to_umv_border(&x->block[ 0].bmi.as_mv.first.as_mv, x); + clamp_mv_to_umv_border(&x->block[ 2].bmi.as_mv.first.as_mv, x); + clamp_mv_to_umv_border(&x->block[ 8].bmi.as_mv.first.as_mv, x); + clamp_mv_to_umv_border(&x->block[10].bmi.as_mv.first.as_mv, x); + if (x->mode_info_context->mbmi.second_ref_frame) { + clamp_mv_to_umv_border(&x->block[ 0].bmi.as_mv.second.as_mv, x); + clamp_mv_to_umv_border(&x->block[ 2].bmi.as_mv.second.as_mv, x); + clamp_mv_to_umv_border(&x->block[ 8].bmi.as_mv.second.as_mv, x); + clamp_mv_to_umv_border(&x->block[10].bmi.as_mv.second.as_mv, x); + } + } - build_inter_predictors4b(x, &x->block[ 0], 16); - build_inter_predictors4b(x, &x->block[ 2], 16); - build_inter_predictors4b(x, &x->block[ 8], 16); - build_inter_predictors4b(x, &x->block[10], 16); + build_inter_predictors4b(x, &x->block[ 0], 16); + build_inter_predictors4b(x, &x->block[ 2], 16); + build_inter_predictors4b(x, &x->block[ 8], 16); + build_inter_predictors4b(x, &x->block[10], 16); - if (x->mode_info_context->mbmi.second_ref_frame) - { - build_2nd_inter_predictors4b(x, &x->block[ 0], 16); - build_2nd_inter_predictors4b(x, &x->block[ 2], 16); - build_2nd_inter_predictors4b(x, &x->block[ 8], 16); - build_2nd_inter_predictors4b(x, &x->block[10], 16); - } + if (x->mode_info_context->mbmi.second_ref_frame) { + build_2nd_inter_predictors4b(x, &x->block[ 0], 16); + build_2nd_inter_predictors4b(x, &x->block[ 2], 16); + build_2nd_inter_predictors4b(x, &x->block[ 8], 16); + build_2nd_inter_predictors4b(x, &x->block[10], 16); } - else - { - for (i = 0; i < 16; i += 2) - { - BLOCKD *d0 = &x->block[i]; - BLOCKD *d1 = &x->block[i+1]; - - x->block[i+0].bmi = x->mode_info_context->bmi[i+0]; - x->block[i+1].bmi = x->mode_info_context->bmi[i+1]; - - if (x->mode_info_context->mbmi.need_to_clamp_mvs) - { - clamp_mv_to_umv_border(&x->block[i+0].bmi.as_mv.first.as_mv, x); - clamp_mv_to_umv_border(&x->block[i+1].bmi.as_mv.first.as_mv, x); - if (x->mode_info_context->mbmi.second_ref_frame) - { - clamp_mv_to_umv_border(&x->block[i+0].bmi.as_mv.second.as_mv, x); - clamp_mv_to_umv_border(&x->block[i+1].bmi.as_mv.second.as_mv, x); - } - } - - if (d0->bmi.as_mv.first.as_int == d1->bmi.as_mv.first.as_int) - build_inter_predictors2b(x, d0, 16); - else - { - vp8_build_inter_predictors_b(d0, 16, x->subpixel_predict); - vp8_build_inter_predictors_b(d1, 16, x->subpixel_predict); - } - - if (x->mode_info_context->mbmi.second_ref_frame) - { - vp8_build_2nd_inter_predictors_b(d0, 16, x->subpixel_predict_avg); - vp8_build_2nd_inter_predictors_b(d1, 16, x->subpixel_predict_avg); - } + } else { + for (i = 0; i < 16; i += 2) { + BLOCKD *d0 = &x->block[i]; + BLOCKD *d1 = &x->block[i + 1]; + + x->block[i + 0].bmi = x->mode_info_context->bmi[i + 0]; + x->block[i + 1].bmi = x->mode_info_context->bmi[i + 1]; + + if (x->mode_info_context->mbmi.need_to_clamp_mvs) { + clamp_mv_to_umv_border(&x->block[i + 0].bmi.as_mv.first.as_mv, x); + clamp_mv_to_umv_border(&x->block[i + 1].bmi.as_mv.first.as_mv, x); + if (x->mode_info_context->mbmi.second_ref_frame) { + clamp_mv_to_umv_border(&x->block[i + 0].bmi.as_mv.second.as_mv, x); + clamp_mv_to_umv_border(&x->block[i + 1].bmi.as_mv.second.as_mv, x); } + } + + if (d0->bmi.as_mv.first.as_int == d1->bmi.as_mv.first.as_int) + build_inter_predictors2b(x, d0, 16); + else { + vp8_build_inter_predictors_b(d0, 16, x->subpixel_predict); + vp8_build_inter_predictors_b(d1, 16, x->subpixel_predict); + } + + if (x->mode_info_context->mbmi.second_ref_frame) { + vp8_build_2nd_inter_predictors_b(d0, 16, x->subpixel_predict_avg); + vp8_build_2nd_inter_predictors_b(d1, 16, x->subpixel_predict_avg); + } } + } - for (i = 16; i < 24; i += 2) - { - BLOCKD *d0 = &x->block[i]; - BLOCKD *d1 = &x->block[i+1]; - - if (d0->bmi.as_mv.first.as_int == d1->bmi.as_mv.first.as_int) - build_inter_predictors2b(x, d0, 8); - else - { - vp8_build_inter_predictors_b(d0, 8, x->subpixel_predict); - vp8_build_inter_predictors_b(d1, 8, x->subpixel_predict); - } + for (i = 16; i < 24; i += 2) { + BLOCKD *d0 = &x->block[i]; + BLOCKD *d1 = &x->block[i + 1]; - if (x->mode_info_context->mbmi.second_ref_frame) - { - vp8_build_2nd_inter_predictors_b(d0, 8, x->subpixel_predict_avg); - vp8_build_2nd_inter_predictors_b(d1, 8, x->subpixel_predict_avg); - } + if (d0->bmi.as_mv.first.as_int == d1->bmi.as_mv.first.as_int) + build_inter_predictors2b(x, d0, 8); + else { + vp8_build_inter_predictors_b(d0, 8, x->subpixel_predict); + vp8_build_inter_predictors_b(d1, 8, x->subpixel_predict); } + + if (x->mode_info_context->mbmi.second_ref_frame) { + vp8_build_2nd_inter_predictors_b(d0, 8, x->subpixel_predict_avg); + vp8_build_2nd_inter_predictors_b(d1, 8, x->subpixel_predict_avg); + } + } } static -void build_4x4uvmvs(MACROBLOCKD *x) -{ - int i, j; - - for (i = 0; i < 2; i++) - { - for (j = 0; j < 2; j++) - { - int yoffset = i * 8 + j * 2; - int uoffset = 16 + i * 2 + j; - int voffset = 20 + i * 2 + j; - - int temp; - - temp = x->mode_info_context->bmi[yoffset + 0].as_mv.first.as_mv.row - + x->mode_info_context->bmi[yoffset + 1].as_mv.first.as_mv.row - + x->mode_info_context->bmi[yoffset + 4].as_mv.first.as_mv.row - + x->mode_info_context->bmi[yoffset + 5].as_mv.first.as_mv.row; - - if (temp < 0) temp -= 4; - else temp += 4; - - x->block[uoffset].bmi.as_mv.first.as_mv.row = (temp / 8) & x->fullpixel_mask; - - temp = x->mode_info_context->bmi[yoffset + 0].as_mv.first.as_mv.col - + x->mode_info_context->bmi[yoffset + 1].as_mv.first.as_mv.col - + x->mode_info_context->bmi[yoffset + 4].as_mv.first.as_mv.col - + x->mode_info_context->bmi[yoffset + 5].as_mv.first.as_mv.col; - - if (temp < 0) temp -= 4; - else temp += 4; - - x->block[uoffset].bmi.as_mv.first.as_mv.col = (temp / 8) & x->fullpixel_mask; - - //if (x->mode_info_context->mbmi.need_to_clamp_mvs) - clamp_uvmv_to_umv_border(&x->block[uoffset].bmi.as_mv.first.as_mv, x); - - //if (x->mode_info_context->mbmi.need_to_clamp_mvs) - clamp_uvmv_to_umv_border(&x->block[uoffset].bmi.as_mv.first.as_mv, x); - - x->block[voffset].bmi.as_mv.first.as_mv.row = - x->block[uoffset].bmi.as_mv.first.as_mv.row ; - x->block[voffset].bmi.as_mv.first.as_mv.col = - x->block[uoffset].bmi.as_mv.first.as_mv.col ; - - if (x->mode_info_context->mbmi.second_ref_frame) - { - temp = x->mode_info_context->bmi[yoffset + 0].as_mv.second.as_mv.row - + x->mode_info_context->bmi[yoffset + 1].as_mv.second.as_mv.row - + x->mode_info_context->bmi[yoffset + 4].as_mv.second.as_mv.row - + x->mode_info_context->bmi[yoffset + 5].as_mv.second.as_mv.row; - - if (temp < 0) - { - temp -= 4; - } - else - { - temp += 4; - } - - x->block[uoffset].bmi.as_mv.second.as_mv.row = (temp / 8) & x->fullpixel_mask; - - temp = x->mode_info_context->bmi[yoffset + 0].as_mv.second.as_mv.col - + x->mode_info_context->bmi[yoffset + 1].as_mv.second.as_mv.col - + x->mode_info_context->bmi[yoffset + 4].as_mv.second.as_mv.col - + x->mode_info_context->bmi[yoffset + 5].as_mv.second.as_mv.col; - - if (temp < 0) - { - temp -= 4; - } - else - { - temp += 4; - } - - x->block[uoffset].bmi.as_mv.second.as_mv.col = (temp / 8) & x->fullpixel_mask; - - //if (x->mode_info_context->mbmi.need_to_clamp_mvs) - clamp_uvmv_to_umv_border(&x->block[uoffset].bmi.as_mv.second.as_mv, x); - - //if (x->mode_info_context->mbmi.need_to_clamp_mvs) - clamp_uvmv_to_umv_border(&x->block[uoffset].bmi.as_mv.second.as_mv, x); - - x->block[voffset].bmi.as_mv.second.as_mv.row = - x->block[uoffset].bmi.as_mv.second.as_mv.row ; - x->block[voffset].bmi.as_mv.second.as_mv.col = - x->block[uoffset].bmi.as_mv.second.as_mv.col ; - } +void build_4x4uvmvs(MACROBLOCKD *x) { + int i, j; + + for (i = 0; i < 2; i++) { + for (j = 0; j < 2; j++) { + int yoffset = i * 8 + j * 2; + int uoffset = 16 + i * 2 + j; + int voffset = 20 + i * 2 + j; + + int temp; + + temp = x->mode_info_context->bmi[yoffset + 0].as_mv.first.as_mv.row + + x->mode_info_context->bmi[yoffset + 1].as_mv.first.as_mv.row + + x->mode_info_context->bmi[yoffset + 4].as_mv.first.as_mv.row + + x->mode_info_context->bmi[yoffset + 5].as_mv.first.as_mv.row; + + if (temp < 0) temp -= 4; + else temp += 4; + + x->block[uoffset].bmi.as_mv.first.as_mv.row = (temp / 8) & x->fullpixel_mask; + + temp = x->mode_info_context->bmi[yoffset + 0].as_mv.first.as_mv.col + + x->mode_info_context->bmi[yoffset + 1].as_mv.first.as_mv.col + + x->mode_info_context->bmi[yoffset + 4].as_mv.first.as_mv.col + + x->mode_info_context->bmi[yoffset + 5].as_mv.first.as_mv.col; + + if (temp < 0) temp -= 4; + else temp += 4; + + x->block[uoffset].bmi.as_mv.first.as_mv.col = (temp / 8) & x->fullpixel_mask; + + // if (x->mode_info_context->mbmi.need_to_clamp_mvs) + clamp_uvmv_to_umv_border(&x->block[uoffset].bmi.as_mv.first.as_mv, x); + + // if (x->mode_info_context->mbmi.need_to_clamp_mvs) + clamp_uvmv_to_umv_border(&x->block[uoffset].bmi.as_mv.first.as_mv, x); + + x->block[voffset].bmi.as_mv.first.as_mv.row = + x->block[uoffset].bmi.as_mv.first.as_mv.row; + x->block[voffset].bmi.as_mv.first.as_mv.col = + x->block[uoffset].bmi.as_mv.first.as_mv.col; + + if (x->mode_info_context->mbmi.second_ref_frame) { + temp = x->mode_info_context->bmi[yoffset + 0].as_mv.second.as_mv.row + + x->mode_info_context->bmi[yoffset + 1].as_mv.second.as_mv.row + + x->mode_info_context->bmi[yoffset + 4].as_mv.second.as_mv.row + + x->mode_info_context->bmi[yoffset + 5].as_mv.second.as_mv.row; + + if (temp < 0) { + temp -= 4; + } else { + temp += 4; } - } -} -void vp8_build_inter_predictors_mb(MACROBLOCKD *x) -{ - if (x->mode_info_context->mbmi.mode != SPLITMV) - { - vp8_build_inter16x16_predictors_mb(x, x->predictor, &x->predictor[256], - &x->predictor[320], 16, 8); - - if (x->mode_info_context->mbmi.second_ref_frame) - { - /* 256 = offset of U plane in Y+U+V buffer; - * 320 = offset of V plane in Y+U+V buffer. - * (256=16x16, 320=16x16+8x8). */ - vp8_build_2nd_inter16x16_predictors_mb(x, x->predictor, - &x->predictor[256], - &x->predictor[320], 16, 8); + x->block[uoffset].bmi.as_mv.second.as_mv.row = (temp / 8) & x->fullpixel_mask; + + temp = x->mode_info_context->bmi[yoffset + 0].as_mv.second.as_mv.col + + x->mode_info_context->bmi[yoffset + 1].as_mv.second.as_mv.col + + x->mode_info_context->bmi[yoffset + 4].as_mv.second.as_mv.col + + x->mode_info_context->bmi[yoffset + 5].as_mv.second.as_mv.col; + + if (temp < 0) { + temp -= 4; + } else { + temp += 4; } + + x->block[uoffset].bmi.as_mv.second.as_mv.col = (temp / 8) & x->fullpixel_mask; + + // if (x->mode_info_context->mbmi.need_to_clamp_mvs) + clamp_uvmv_to_umv_border(&x->block[uoffset].bmi.as_mv.second.as_mv, x); + + // if (x->mode_info_context->mbmi.need_to_clamp_mvs) + clamp_uvmv_to_umv_border(&x->block[uoffset].bmi.as_mv.second.as_mv, x); + + x->block[voffset].bmi.as_mv.second.as_mv.row = + x->block[uoffset].bmi.as_mv.second.as_mv.row; + x->block[voffset].bmi.as_mv.second.as_mv.col = + x->block[uoffset].bmi.as_mv.second.as_mv.col; + } } - else - { - build_4x4uvmvs(x); - build_inter4x4_predictors_mb(x); + } +} + +void vp8_build_inter_predictors_mb(MACROBLOCKD *x) { + if (x->mode_info_context->mbmi.mode != SPLITMV) { + vp8_build_inter16x16_predictors_mb(x, x->predictor, &x->predictor[256], + &x->predictor[320], 16, 8); + + if (x->mode_info_context->mbmi.second_ref_frame) { + /* 256 = offset of U plane in Y+U+V buffer; + * 320 = offset of V plane in Y+U+V buffer. + * (256=16x16, 320=16x16+8x8). */ + vp8_build_2nd_inter16x16_predictors_mb(x, x->predictor, + &x->predictor[256], + &x->predictor[320], 16, 8); } + } else { + build_4x4uvmvs(x); + build_inter4x4_predictors_mb(x); + } } diff --git a/vp8/common/reconintra.c b/vp8/common/reconintra.c index 27b47926e..e06d914ba 100644 --- a/vp8/common/reconintra.c +++ b/vp8/common/reconintra.c @@ -20,359 +20,302 @@ #if CONFIG_NEWINTRAMODES void d27_predictor(unsigned char *ypred_ptr, int y_stride, int n, - unsigned char *yabove_row, unsigned char *yleft_col) -{ - int r, c, h, w, v; - int a, b; - r = 0; - for (c = 0; c < n-2; c++) - { - if (c&1) - a = yleft_col[r + 1]; - else - a = (yleft_col[r] + yleft_col[r + 1] + 1) >> 1; - b = yabove_row[c + 2]; - ypred_ptr[c] = (2 * a + (c + 1) * b + (c + 3)/2) / (c + 3); - } - for (r = 1; r < n/2 - 1; r++) - { - for (c = 0; c < n - 2 - 2 * r; c++) - { - if (c&1) - a = yleft_col[r + 1]; - else - a = (yleft_col[r] + yleft_col[r + 1] + 1) >> 1; - b = ypred_ptr[(r - 1) * y_stride + c + 2]; - ypred_ptr[r * y_stride + c] = (2 * a + (c + 1) * b + (c + 3)/2) / (c + 3); - } - } - for (; r < n - 1; ++r) - { - for (c = 0; c < n; c++) - { - v = (c & 1 ? yleft_col[r + 1] : (yleft_col[r] + yleft_col[r + 1] + 1) >> 1); - h = r - c/2; - ypred_ptr[h * y_stride + c] = v; - } - } - c = 0; - r = n - 1; - ypred_ptr[r * y_stride] = (ypred_ptr[(r - 1) * y_stride] + - yleft_col[r] + 1) >> 1; - for (r = n - 2; r >= n/2; --r) - { - w = c + (n - 1 - r) * 2; - ypred_ptr[r * y_stride + w] = (ypred_ptr[(r - 1) * y_stride + w] + - ypred_ptr[r * y_stride + w - 1] + 1) >> 1; - } - for (c = 1; c < n; c++) - { - for (r = n - 1; r >= n/2 + c/2; --r) - { - w = c + (n - 1 - r) * 2; - ypred_ptr[r * y_stride + w] = (ypred_ptr[(r - 1) * y_stride + w] + - ypred_ptr[r * y_stride + w - 1] + 1) >> 1; - } - } + unsigned char *yabove_row, unsigned char *yleft_col) { + int r, c, h, w, v; + int a, b; + r = 0; + for (c = 0; c < n - 2; c++) { + if (c & 1) + a = yleft_col[r + 1]; + else + a = (yleft_col[r] + yleft_col[r + 1] + 1) >> 1; + b = yabove_row[c + 2]; + ypred_ptr[c] = (2 * a + (c + 1) * b + (c + 3) / 2) / (c + 3); + } + for (r = 1; r < n / 2 - 1; r++) { + for (c = 0; c < n - 2 - 2 * r; c++) { + if (c & 1) + a = yleft_col[r + 1]; + else + a = (yleft_col[r] + yleft_col[r + 1] + 1) >> 1; + b = ypred_ptr[(r - 1) * y_stride + c + 2]; + ypred_ptr[r * y_stride + c] = (2 * a + (c + 1) * b + (c + 3) / 2) / (c + 3); + } + } + for (; r < n - 1; ++r) { + for (c = 0; c < n; c++) { + v = (c & 1 ? yleft_col[r + 1] : (yleft_col[r] + yleft_col[r + 1] + 1) >> 1); + h = r - c / 2; + ypred_ptr[h * y_stride + c] = v; + } + } + c = 0; + r = n - 1; + ypred_ptr[r * y_stride] = (ypred_ptr[(r - 1) * y_stride] + + yleft_col[r] + 1) >> 1; + for (r = n - 2; r >= n / 2; --r) { + w = c + (n - 1 - r) * 2; + ypred_ptr[r * y_stride + w] = (ypred_ptr[(r - 1) * y_stride + w] + + ypred_ptr[r * y_stride + w - 1] + 1) >> 1; + } + for (c = 1; c < n; c++) { + for (r = n - 1; r >= n / 2 + c / 2; --r) { + w = c + (n - 1 - r) * 2; + ypred_ptr[r * y_stride + w] = (ypred_ptr[(r - 1) * y_stride + w] + + ypred_ptr[r * y_stride + w - 1] + 1) >> 1; + } + } } void d63_predictor(unsigned char *ypred_ptr, int y_stride, int n, - unsigned char *yabove_row, unsigned char *yleft_col) -{ - int r, c, h, w, v; - int a, b; - c = 0; - for (r = 0; r < n-2; r++) - { - if (r&1) - a = yabove_row[c + 1]; - else - a = (yabove_row[c] + yabove_row[c + 1] + 1) >> 1; - b = yleft_col[r + 2]; - ypred_ptr[r * y_stride] = (2 * a + (r + 1) * b + (r + 3)/2) / (r + 3); - } - for (c = 1; c < n/2 - 1; c++) - { - for (r = 0; r < n - 2 - 2 * c; r++) - { - if (r&1) - a = yabove_row[c + 1]; - else - a = (yabove_row[c] + yabove_row[c + 1] + 1) >> 1; - b = ypred_ptr[(r + 2) * y_stride + c - 1]; - ypred_ptr[r * y_stride + c] = (2 * a + (c + 1) * b + (c + 3)/2) / (c + 3); - } - } - for (; c < n - 1; ++c) - { - for (r = 0; r < n; r++) - { - v = (r & 1 ? yabove_row[c + 1] : (yabove_row[c] + yabove_row[c + 1] + 1) >> 1); - w = c - r/2; - ypred_ptr[r * y_stride + w] = v; - } - } - r = 0; - c = n - 1; - ypred_ptr[c] = (ypred_ptr[(c - 1)] + yabove_row[c] + 1) >> 1; - for (c = n - 2; c >= n/2; --c) - { - h = r + (n - 1 - c) * 2; - ypred_ptr[h * y_stride + c] = (ypred_ptr[h * y_stride + c - 1] + - ypred_ptr[(h - 1) * y_stride + c] + 1) >> 1; - } - for (r = 1; r < n; r++) - { - for (c = n - 1; c >= n/2 + r/2; --c) - { - h = r + (n - 1 - c) * 2; - ypred_ptr[h * y_stride + c] = (ypred_ptr[h * y_stride + c - 1] + - ypred_ptr[(h - 1) * y_stride + c] + 1) >> 1; - } - } + unsigned char *yabove_row, unsigned char *yleft_col) { + int r, c, h, w, v; + int a, b; + c = 0; + for (r = 0; r < n - 2; r++) { + if (r & 1) + a = yabove_row[c + 1]; + else + a = (yabove_row[c] + yabove_row[c + 1] + 1) >> 1; + b = yleft_col[r + 2]; + ypred_ptr[r * y_stride] = (2 * a + (r + 1) * b + (r + 3) / 2) / (r + 3); + } + for (c = 1; c < n / 2 - 1; c++) { + for (r = 0; r < n - 2 - 2 * c; r++) { + if (r & 1) + a = yabove_row[c + 1]; + else + a = (yabove_row[c] + yabove_row[c + 1] + 1) >> 1; + b = ypred_ptr[(r + 2) * y_stride + c - 1]; + ypred_ptr[r * y_stride + c] = (2 * a + (c + 1) * b + (c + 3) / 2) / (c + 3); + } + } + for (; c < n - 1; ++c) { + for (r = 0; r < n; r++) { + v = (r & 1 ? yabove_row[c + 1] : (yabove_row[c] + yabove_row[c + 1] + 1) >> 1); + w = c - r / 2; + ypred_ptr[r * y_stride + w] = v; + } + } + r = 0; + c = n - 1; + ypred_ptr[c] = (ypred_ptr[(c - 1)] + yabove_row[c] + 1) >> 1; + for (c = n - 2; c >= n / 2; --c) { + h = r + (n - 1 - c) * 2; + ypred_ptr[h * y_stride + c] = (ypred_ptr[h * y_stride + c - 1] + + ypred_ptr[(h - 1) * y_stride + c] + 1) >> 1; + } + for (r = 1; r < n; r++) { + for (c = n - 1; c >= n / 2 + r / 2; --c) { + h = r + (n - 1 - c) * 2; + ypred_ptr[h * y_stride + c] = (ypred_ptr[h * y_stride + c - 1] + + ypred_ptr[(h - 1) * y_stride + c] + 1) >> 1; + } + } } void d45_predictor(unsigned char *ypred_ptr, int y_stride, int n, - unsigned char *yabove_row, unsigned char *yleft_col) -{ - int r, c; - for (r = 0; r < n - 1; ++r) - { - for (c = 0; c <= r; ++c) - { - ypred_ptr[(r - c) * y_stride + c] = - (yabove_row[r+1] * (c + 1) + - yleft_col[r+1] * (r - c + 1) + r/2 + 1) / (r + 2); - } - } - for (c = 0; c <= r; ++c) - { - int yabove_ext = yabove_row[r]; //2*yabove_row[r] - yabove_row[r-1]; - int yleft_ext = yleft_col[r]; //2*yleft_col[r] - yleft_col[r-1]; - yabove_ext = (yabove_ext > 255 ? 255 : (yabove_ext < 0 ? 0 : yabove_ext)); - yleft_ext = (yleft_ext > 255 ? 255 : (yleft_ext < 0 ? 0 : yleft_ext)); - ypred_ptr[(r - c) * y_stride + c] = - (yabove_ext * (c + 1) + - yleft_ext * (r - c + 1) + r/2 + 1) / (r + 2); - } - for (r = 1; r < n; ++r) - { - for (c = n - r; c < n; ++c) - ypred_ptr[r * y_stride + c] = (ypred_ptr[(r - 1) * y_stride + c] + - ypred_ptr[r * y_stride + c - 1] + 1) >> 1; - } + unsigned char *yabove_row, unsigned char *yleft_col) { + int r, c; + for (r = 0; r < n - 1; ++r) { + for (c = 0; c <= r; ++c) { + ypred_ptr[(r - c) * y_stride + c] = + (yabove_row[r + 1] * (c + 1) + + yleft_col[r + 1] * (r - c + 1) + r / 2 + 1) / (r + 2); + } + } + for (c = 0; c <= r; ++c) { + int yabove_ext = yabove_row[r]; // 2*yabove_row[r] - yabove_row[r-1]; + int yleft_ext = yleft_col[r]; // 2*yleft_col[r] - yleft_col[r-1]; + yabove_ext = (yabove_ext > 255 ? 255 : (yabove_ext < 0 ? 0 : yabove_ext)); + yleft_ext = (yleft_ext > 255 ? 255 : (yleft_ext < 0 ? 0 : yleft_ext)); + ypred_ptr[(r - c) * y_stride + c] = + (yabove_ext * (c + 1) + + yleft_ext * (r - c + 1) + r / 2 + 1) / (r + 2); + } + for (r = 1; r < n; ++r) { + for (c = n - r; c < n; ++c) + ypred_ptr[r * y_stride + c] = (ypred_ptr[(r - 1) * y_stride + c] + + ypred_ptr[r * y_stride + c - 1] + 1) >> 1; + } } void d117_predictor(unsigned char *ypred_ptr, int y_stride, int n, - unsigned char *yabove_row, unsigned char *yleft_col) -{ - int r, c; - for (c = 0; c < n; c++) - ypred_ptr[c] = (yabove_row[c-1] + yabove_row[c] + 1) >> 1; - ypred_ptr += y_stride; - for (c = 0; c < n; c++) - ypred_ptr[c] = yabove_row[c-1]; + unsigned char *yabove_row, unsigned char *yleft_col) { + int r, c; + for (c = 0; c < n; c++) + ypred_ptr[c] = (yabove_row[c - 1] + yabove_row[c] + 1) >> 1; + ypred_ptr += y_stride; + for (c = 0; c < n; c++) + ypred_ptr[c] = yabove_row[c - 1]; + ypred_ptr += y_stride; + for (r = 2; r < n; ++r) { + ypred_ptr[0] = yleft_col[r - 2]; + for (c = 1; c < n; c++) + ypred_ptr[c] = ypred_ptr[-2 * y_stride + c - 1]; ypred_ptr += y_stride; - for (r = 2; r < n; ++r) - { - ypred_ptr[0] = yleft_col[r - 2]; - for (c = 1; c < n; c++) - ypred_ptr[c] = ypred_ptr[-2*y_stride+c-1]; - ypred_ptr += y_stride; - } + } } void d135_predictor(unsigned char *ypred_ptr, int y_stride, int n, - unsigned char *yabove_row, unsigned char *yleft_col) -{ - int r, c; - ypred_ptr[0] = yabove_row[-1]; - for (c = 1; c < n; c++) - ypred_ptr[c] = yabove_row[c - 1]; - for (r = 1; r < n; ++r) - ypred_ptr[r * y_stride] = yleft_col[r - 1]; - - ypred_ptr += y_stride; - for (r = 1; r < n; ++r) - { - for (c = 1; c < n; c++) - { - ypred_ptr[c] = ypred_ptr[-y_stride + c - 1]; - } - ypred_ptr += y_stride; + unsigned char *yabove_row, unsigned char *yleft_col) { + int r, c; + ypred_ptr[0] = yabove_row[-1]; + for (c = 1; c < n; c++) + ypred_ptr[c] = yabove_row[c - 1]; + for (r = 1; r < n; ++r) + ypred_ptr[r * y_stride] = yleft_col[r - 1]; + + ypred_ptr += y_stride; + for (r = 1; r < n; ++r) { + for (c = 1; c < n; c++) { + ypred_ptr[c] = ypred_ptr[-y_stride + c - 1]; } + ypred_ptr += y_stride; + } } void d153_predictor(unsigned char *ypred_ptr, int y_stride, int n, - unsigned char *yabove_row, unsigned char *yleft_col) -{ - int r, c; - ypred_ptr[0] = (yabove_row[-1] + yleft_col[0] + 1) >> 1; - for (r = 1; r < n; r++) - ypred_ptr[r * y_stride] = (yleft_col[r-1] + yleft_col[r] + 1) >> 1; - ypred_ptr++; - ypred_ptr[0] = yabove_row[-1]; - for (r = 1; r < n; r++) - ypred_ptr[r * y_stride] = yleft_col[r-1]; - ypred_ptr++; - + unsigned char *yabove_row, unsigned char *yleft_col) { + int r, c; + ypred_ptr[0] = (yabove_row[-1] + yleft_col[0] + 1) >> 1; + for (r = 1; r < n; r++) + ypred_ptr[r * y_stride] = (yleft_col[r - 1] + yleft_col[r] + 1) >> 1; + ypred_ptr++; + ypred_ptr[0] = yabove_row[-1]; + for (r = 1; r < n; r++) + ypred_ptr[r * y_stride] = yleft_col[r - 1]; + ypred_ptr++; + + for (c = 0; c < n - 2; c++) + ypred_ptr[c] = yabove_row[c]; + ypred_ptr += y_stride; + for (r = 1; r < n; ++r) { for (c = 0; c < n - 2; c++) - ypred_ptr[c] = yabove_row[c]; + ypred_ptr[c] = ypred_ptr[-y_stride + c - 2]; ypred_ptr += y_stride; - for (r = 1; r < n; ++r) - { - for (c = 0; c < n - 2; c++) - ypred_ptr[c] = ypred_ptr[-y_stride+c-2]; - ypred_ptr += y_stride; - } + } } #endif /* CONFIG_NEWINTRAMODES */ -void vp8_recon_intra_mbuv(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x) -{ - int i; +void vp8_recon_intra_mbuv(const vp8_recon_rtcd_vtable_t *rtcd, MACROBLOCKD *x) { + int i; - for (i = 16; i < 24; i += 2) - { - BLOCKD *b = &x->block[i]; - RECON_INVOKE(rtcd, recon2)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); - } + for (i = 16; i < 24; i += 2) { + BLOCKD *b = &x->block[i]; + RECON_INVOKE(rtcd, recon2)(b->predictor, b->diff, *(b->base_dst) + b->dst, b->dst_stride); + } } -void vp8_build_intra_predictors_mby_internal(MACROBLOCKD *x, unsigned char *ypred_ptr, int y_stride, int mode) -{ - - unsigned char *yabove_row = x->dst.y_buffer - x->dst.y_stride; - unsigned char yleft_col[16]; - unsigned char ytop_left = yabove_row[-1]; - int r, c, i; - - for (i = 0; i < 16; i++) - { - yleft_col[i] = x->dst.y_buffer [i* x->dst.y_stride -1]; - } - - /* for Y */ - switch (mode) - { - case DC_PRED: - { - int expected_dc; - int i; - int shift; - int average = 0; - - - if (x->up_available || x->left_available) - { - if (x->up_available) - { - for (i = 0; i < 16; i++) - { - average += yabove_row[i]; - } - } - - if (x->left_available) - { - for (i = 0; i < 16; i++) - { - average += yleft_col[i]; - } - } - shift = 3 + x->up_available + x->left_available; - expected_dc = (average + (1 << (shift - 1))) >> shift; - } - else - { - expected_dc = 128; +void vp8_build_intra_predictors_mby_internal(MACROBLOCKD *x, unsigned char *ypred_ptr, int y_stride, int mode) { + + unsigned char *yabove_row = x->dst.y_buffer - x->dst.y_stride; + unsigned char yleft_col[16]; + unsigned char ytop_left = yabove_row[-1]; + int r, c, i; + + for (i = 0; i < 16; i++) { + yleft_col[i] = x->dst.y_buffer [i * x->dst.y_stride - 1]; + } + + /* for Y */ + switch (mode) { + case DC_PRED: { + int expected_dc; + int i; + int shift; + int average = 0; + + + if (x->up_available || x->left_available) { + if (x->up_available) { + for (i = 0; i < 16; i++) { + average += yabove_row[i]; + } } - for (r = 0; r < 16; r++) - { - vpx_memset(ypred_ptr, expected_dc, 16); - ypred_ptr += y_stride; /*16;*/ + if (x->left_available) { + for (i = 0; i < 16; i++) { + average += yleft_col[i]; + } } + shift = 3 + x->up_available + x->left_available; + expected_dc = (average + (1 << (shift - 1))) >> shift; + } else { + expected_dc = 128; + } + + for (r = 0; r < 16; r++) { + vpx_memset(ypred_ptr, expected_dc, 16); + ypred_ptr += y_stride; /*16;*/ + } } break; - case V_PRED: - { + case V_PRED: { - for (r = 0; r < 16; r++) - { + for (r = 0; r < 16; r++) { - ((int *)ypred_ptr)[0] = ((int *)yabove_row)[0]; - ((int *)ypred_ptr)[1] = ((int *)yabove_row)[1]; - ((int *)ypred_ptr)[2] = ((int *)yabove_row)[2]; - ((int *)ypred_ptr)[3] = ((int *)yabove_row)[3]; - ypred_ptr += y_stride; - } + ((int *)ypred_ptr)[0] = ((int *)yabove_row)[0]; + ((int *)ypred_ptr)[1] = ((int *)yabove_row)[1]; + ((int *)ypred_ptr)[2] = ((int *)yabove_row)[2]; + ((int *)ypred_ptr)[3] = ((int *)yabove_row)[3]; + ypred_ptr += y_stride; + } } break; - case H_PRED: - { + case H_PRED: { - for (r = 0; r < 16; r++) - { + for (r = 0; r < 16; r++) { - vpx_memset(ypred_ptr, yleft_col[r], 16); - ypred_ptr += y_stride; - } + vpx_memset(ypred_ptr, yleft_col[r], 16); + ypred_ptr += y_stride; + } } break; - case TM_PRED: - { - - for (r = 0; r < 16; r++) - { - for (c = 0; c < 16; c++) - { - int pred = yleft_col[r] + yabove_row[ c] - ytop_left; + case TM_PRED: { - if (pred < 0) - pred = 0; + for (r = 0; r < 16; r++) { + for (c = 0; c < 16; c++) { + int pred = yleft_col[r] + yabove_row[ c] - ytop_left; - if (pred > 255) - pred = 255; + if (pred < 0) + pred = 0; - ypred_ptr[c] = pred; - } + if (pred > 255) + pred = 255; - ypred_ptr += y_stride; + ypred_ptr[c] = pred; } + ypred_ptr += y_stride; + } + } break; #if CONFIG_NEWINTRAMODES - case D45_PRED: - { - d45_predictor(ypred_ptr, y_stride, 16, yabove_row, yleft_col); + case D45_PRED: { + d45_predictor(ypred_ptr, y_stride, 16, yabove_row, yleft_col); } break; - case D135_PRED: - { - d135_predictor(ypred_ptr, y_stride, 16, yabove_row, yleft_col); + case D135_PRED: { + d135_predictor(ypred_ptr, y_stride, 16, yabove_row, yleft_col); } break; - case D117_PRED: - { - d117_predictor(ypred_ptr, y_stride, 16, yabove_row, yleft_col); + case D117_PRED: { + d117_predictor(ypred_ptr, y_stride, 16, yabove_row, yleft_col); } break; - case D153_PRED: - { - d153_predictor(ypred_ptr, y_stride, 16, yabove_row, yleft_col); + case D153_PRED: { + d153_predictor(ypred_ptr, y_stride, 16, yabove_row, yleft_col); } break; - case D27_PRED: - { - d27_predictor(ypred_ptr, y_stride, 16, yabove_row, yleft_col); + case D27_PRED: { + d27_predictor(ypred_ptr, y_stride, 16, yabove_row, yleft_col); } break; - case D63_PRED: - { - d63_predictor(ypred_ptr, y_stride, 16, yabove_row, yleft_col); + case D63_PRED: { + d63_predictor(ypred_ptr, y_stride, 16, yabove_row, yleft_col); } break; #endif @@ -386,37 +329,33 @@ void vp8_build_intra_predictors_mby_internal(MACROBLOCKD *x, unsigned char *ypre case NEWMV: case SPLITMV: case MB_MODE_COUNT: - break; - } + break; + } } -void vp8_build_intra_predictors_mby(MACROBLOCKD *x) -{ - vp8_build_intra_predictors_mby_internal(x, x->predictor, 16, - x->mode_info_context->mbmi.mode); +void vp8_build_intra_predictors_mby(MACROBLOCKD *x) { + vp8_build_intra_predictors_mby_internal(x, x->predictor, 16, + x->mode_info_context->mbmi.mode); } -void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x) -{ - vp8_build_intra_predictors_mby_internal(x, x->dst.y_buffer, x->dst.y_stride, - x->mode_info_context->mbmi.mode); +void vp8_build_intra_predictors_mby_s(MACROBLOCKD *x) { + vp8_build_intra_predictors_mby_internal(x, x->dst.y_buffer, x->dst.y_stride, + x->mode_info_context->mbmi.mode); } #if CONFIG_COMP_INTRA_PRED -void vp8_build_comp_intra_predictors_mby(MACROBLOCKD *x) -{ - unsigned char predictor[2][256]; - int i; - - vp8_build_intra_predictors_mby_internal(x, predictor[0], 16, - x->mode_info_context->mbmi.mode); - vp8_build_intra_predictors_mby_internal(x, predictor[1], 16, - x->mode_info_context->mbmi.second_mode); - - for (i = 0; i < 256; i++) - { - x->predictor[i] = (predictor[0][i] + predictor[1][i] + 1) >> 1; - } +void vp8_build_comp_intra_predictors_mby(MACROBLOCKD *x) { + unsigned char predictor[2][256]; + int i; + + vp8_build_intra_predictors_mby_internal(x, predictor[0], 16, + x->mode_info_context->mbmi.mode); + vp8_build_intra_predictors_mby_internal(x, predictor[1], 16, + x->mode_info_context->mbmi.second_mode); + + for (i = 0; i < 256; i++) { + x->predictor[i] = (predictor[0][i] + predictor[1][i] + 1) >> 1; + } } #endif @@ -424,172 +363,147 @@ void vp8_build_intra_predictors_mbuv_internal(MACROBLOCKD *x, unsigned char *upred_ptr, unsigned char *vpred_ptr, int uv_stride, - int mode) -{ - unsigned char *uabove_row = x->dst.u_buffer - x->dst.uv_stride; - unsigned char uleft_col[16]; - unsigned char utop_left = uabove_row[-1]; - unsigned char *vabove_row = x->dst.v_buffer - x->dst.uv_stride; - unsigned char vleft_col[20]; - unsigned char vtop_left = vabove_row[-1]; - - int i, j; - - for (i = 0; i < 8; i++) - { - uleft_col[i] = x->dst.u_buffer [i* x->dst.uv_stride -1]; - vleft_col[i] = x->dst.v_buffer [i* x->dst.uv_stride -1]; - } - - switch (mode) - { - case DC_PRED: - { - int expected_udc; - int expected_vdc; - int i; - int shift; - int Uaverage = 0; - int Vaverage = 0; - - if (x->up_available) - { - for (i = 0; i < 8; i++) - { - Uaverage += uabove_row[i]; - Vaverage += vabove_row[i]; - } - } - - if (x->left_available) - { - for (i = 0; i < 8; i++) - { - Uaverage += uleft_col[i]; - Vaverage += vleft_col[i]; - } - } - - if (!x->up_available && !x->left_available) - { - expected_udc = 128; - expected_vdc = 128; - } - else - { - shift = 2 + x->up_available + x->left_available; - expected_udc = (Uaverage + (1 << (shift - 1))) >> shift; - expected_vdc = (Vaverage + (1 << (shift - 1))) >> shift; - } - - - /*vpx_memset(upred_ptr,expected_udc,64);*/ - /*vpx_memset(vpred_ptr,expected_vdc,64);*/ - for (i = 0; i < 8; i++) - { - vpx_memset(upred_ptr, expected_udc, 8); - vpx_memset(vpred_ptr, expected_vdc, 8); - upred_ptr += uv_stride; /*8;*/ - vpred_ptr += uv_stride; /*8;*/ - } + int mode) { + unsigned char *uabove_row = x->dst.u_buffer - x->dst.uv_stride; + unsigned char uleft_col[16]; + unsigned char utop_left = uabove_row[-1]; + unsigned char *vabove_row = x->dst.v_buffer - x->dst.uv_stride; + unsigned char vleft_col[20]; + unsigned char vtop_left = vabove_row[-1]; + + int i, j; + + for (i = 0; i < 8; i++) { + uleft_col[i] = x->dst.u_buffer [i * x->dst.uv_stride - 1]; + vleft_col[i] = x->dst.v_buffer [i * x->dst.uv_stride - 1]; + } + + switch (mode) { + case DC_PRED: { + int expected_udc; + int expected_vdc; + int i; + int shift; + int Uaverage = 0; + int Vaverage = 0; + + if (x->up_available) { + for (i = 0; i < 8; i++) { + Uaverage += uabove_row[i]; + Vaverage += vabove_row[i]; + } + } + + if (x->left_available) { + for (i = 0; i < 8; i++) { + Uaverage += uleft_col[i]; + Vaverage += vleft_col[i]; + } + } + + if (!x->up_available && !x->left_available) { + expected_udc = 128; + expected_vdc = 128; + } else { + shift = 2 + x->up_available + x->left_available; + expected_udc = (Uaverage + (1 << (shift - 1))) >> shift; + expected_vdc = (Vaverage + (1 << (shift - 1))) >> shift; + } + + + /*vpx_memset(upred_ptr,expected_udc,64);*/ + /*vpx_memset(vpred_ptr,expected_vdc,64);*/ + for (i = 0; i < 8; i++) { + vpx_memset(upred_ptr, expected_udc, 8); + vpx_memset(vpred_ptr, expected_vdc, 8); + upred_ptr += uv_stride; /*8;*/ + vpred_ptr += uv_stride; /*8;*/ + } } break; - case V_PRED: - { - int i; + case V_PRED: { + int i; - for (i = 0; i < 8; i++) - { - vpx_memcpy(upred_ptr, uabove_row, 8); - vpx_memcpy(vpred_ptr, vabove_row, 8); - upred_ptr += uv_stride; /*8;*/ - vpred_ptr += uv_stride; /*8;*/ - } + for (i = 0; i < 8; i++) { + vpx_memcpy(upred_ptr, uabove_row, 8); + vpx_memcpy(vpred_ptr, vabove_row, 8); + upred_ptr += uv_stride; /*8;*/ + vpred_ptr += uv_stride; /*8;*/ + } } break; - case H_PRED: - { - int i; + case H_PRED: { + int i; - for (i = 0; i < 8; i++) - { - vpx_memset(upred_ptr, uleft_col[i], 8); - vpx_memset(vpred_ptr, vleft_col[i], 8); - upred_ptr += uv_stride; /*8;*/ - vpred_ptr += uv_stride; /*8;*/ - } + for (i = 0; i < 8; i++) { + vpx_memset(upred_ptr, uleft_col[i], 8); + vpx_memset(vpred_ptr, vleft_col[i], 8); + upred_ptr += uv_stride; /*8;*/ + vpred_ptr += uv_stride; /*8;*/ + } } break; - case TM_PRED: - { - int i; - - for (i = 0; i < 8; i++) - { - for (j = 0; j < 8; j++) - { - int predu = uleft_col[i] + uabove_row[j] - utop_left; - int predv = vleft_col[i] + vabove_row[j] - vtop_left; + case TM_PRED: { + int i; - if (predu < 0) - predu = 0; + for (i = 0; i < 8; i++) { + for (j = 0; j < 8; j++) { + int predu = uleft_col[i] + uabove_row[j] - utop_left; + int predv = vleft_col[i] + vabove_row[j] - vtop_left; - if (predu > 255) - predu = 255; + if (predu < 0) + predu = 0; - if (predv < 0) - predv = 0; + if (predu > 255) + predu = 255; - if (predv > 255) - predv = 255; + if (predv < 0) + predv = 0; - upred_ptr[j] = predu; - vpred_ptr[j] = predv; - } + if (predv > 255) + predv = 255; - upred_ptr += uv_stride; /*8;*/ - vpred_ptr += uv_stride; /*8;*/ + upred_ptr[j] = predu; + vpred_ptr[j] = predv; } + upred_ptr += uv_stride; /*8;*/ + vpred_ptr += uv_stride; /*8;*/ + } + } break; #if CONFIG_NEWINTRAMODES - case D45_PRED: - { - d45_predictor(upred_ptr, uv_stride, 8, uabove_row, uleft_col); - d45_predictor(vpred_ptr, uv_stride, 8, vabove_row, vleft_col); + case D45_PRED: { + d45_predictor(upred_ptr, uv_stride, 8, uabove_row, uleft_col); + d45_predictor(vpred_ptr, uv_stride, 8, vabove_row, vleft_col); } break; - case D135_PRED: - { - d135_predictor(upred_ptr, uv_stride, 8, uabove_row, uleft_col); - d135_predictor(vpred_ptr, uv_stride, 8, vabove_row, vleft_col); + case D135_PRED: { + d135_predictor(upred_ptr, uv_stride, 8, uabove_row, uleft_col); + d135_predictor(vpred_ptr, uv_stride, 8, vabove_row, vleft_col); } break; - case D117_PRED: - { - d117_predictor(upred_ptr, uv_stride, 8, uabove_row, uleft_col); - d117_predictor(vpred_ptr, uv_stride, 8, vabove_row, vleft_col); + case D117_PRED: { + d117_predictor(upred_ptr, uv_stride, 8, uabove_row, uleft_col); + d117_predictor(vpred_ptr, uv_stride, 8, vabove_row, vleft_col); } break; - case D153_PRED: - { - d153_predictor(upred_ptr, uv_stride, 8, uabove_row, uleft_col); - d153_predictor(vpred_ptr, uv_stride, 8, vabove_row, vleft_col); + case D153_PRED: { + d153_predictor(upred_ptr, uv_stride, 8, uabove_row, uleft_col); + d153_predictor(vpred_ptr, uv_stride, 8, vabove_row, vleft_col); } break; - case D27_PRED: - { - d27_predictor(upred_ptr, uv_stride, 8, uabove_row, uleft_col); - d27_predictor(vpred_ptr, uv_stride, 8, vabove_row, vleft_col); + case D27_PRED: { + d27_predictor(upred_ptr, uv_stride, 8, uabove_row, uleft_col); + d27_predictor(vpred_ptr, uv_stride, 8, vabove_row, vleft_col); } break; - case D63_PRED: - { - d63_predictor(upred_ptr, uv_stride, 8, uabove_row, uleft_col); - d63_predictor(vpred_ptr, uv_stride, 8, vabove_row, vleft_col); + case D63_PRED: { + d63_predictor(upred_ptr, uv_stride, 8, uabove_row, uleft_col); + d63_predictor(vpred_ptr, uv_stride, 8, vabove_row, vleft_col); } break; #endif @@ -600,322 +514,268 @@ void vp8_build_intra_predictors_mbuv_internal(MACROBLOCKD *x, case NEWMV: case SPLITMV: case MB_MODE_COUNT: - break; - } + break; + } } -void vp8_build_intra_predictors_mbuv(MACROBLOCKD *x) -{ - vp8_build_intra_predictors_mbuv_internal(x, - &x->predictor[256], - &x->predictor[320], - 8, - x->mode_info_context->mbmi.uv_mode); +void vp8_build_intra_predictors_mbuv(MACROBLOCKD *x) { + vp8_build_intra_predictors_mbuv_internal(x, + &x->predictor[256], + &x->predictor[320], + 8, + x->mode_info_context->mbmi.uv_mode); } -void vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x) -{ - vp8_build_intra_predictors_mbuv_internal(x, - x->dst.u_buffer, - x->dst.v_buffer, - x->dst.uv_stride, - x->mode_info_context->mbmi.uv_mode); +void vp8_build_intra_predictors_mbuv_s(MACROBLOCKD *x) { + vp8_build_intra_predictors_mbuv_internal(x, + x->dst.u_buffer, + x->dst.v_buffer, + x->dst.uv_stride, + x->mode_info_context->mbmi.uv_mode); } #if CONFIG_COMP_INTRA_PRED -void vp8_build_comp_intra_predictors_mbuv(MACROBLOCKD *x) -{ - unsigned char predictor[2][2][64]; - int i; - - vp8_build_intra_predictors_mbuv_internal(x, predictor[0][0], predictor[1][0], 8, - x->mode_info_context->mbmi.uv_mode); - vp8_build_intra_predictors_mbuv_internal(x, predictor[0][1], predictor[1][1], 8, - x->mode_info_context->mbmi.second_uv_mode); - for (i = 0; i < 64; i++) - { - x->predictor[256 + i] = (predictor[0][0][i] + predictor[0][1][i] + 1) >> 1; - x->predictor[256 + 64 + i] = (predictor[1][0][i] + predictor[1][1][i] + 1) >> 1; - } +void vp8_build_comp_intra_predictors_mbuv(MACROBLOCKD *x) { + unsigned char predictor[2][2][64]; + int i; + + vp8_build_intra_predictors_mbuv_internal(x, predictor[0][0], predictor[1][0], 8, + x->mode_info_context->mbmi.uv_mode); + vp8_build_intra_predictors_mbuv_internal(x, predictor[0][1], predictor[1][1], 8, + x->mode_info_context->mbmi.second_uv_mode); + for (i = 0; i < 64; i++) { + x->predictor[256 + i] = (predictor[0][0][i] + predictor[0][1][i] + 1) >> 1; + x->predictor[256 + 64 + i] = (predictor[1][0][i] + predictor[1][1][i] + 1) >> 1; + } } #endif void vp8_intra8x8_predict(BLOCKD *x, int mode, - unsigned char *predictor) -{ - - unsigned char *yabove_row = *(x->base_dst) + x->dst - x->dst_stride; - unsigned char yleft_col[8]; - unsigned char ytop_left = yabove_row[-1]; - int r, c, i; - - for (i = 0; i < 8; i++) - { - yleft_col[i] = (*(x->base_dst))[x->dst - 1 + i * x->dst_stride]; - } - switch (mode) - { - case DC_PRED: - { - int expected_dc = 0; - - for (i = 0; i < 8; i++) - { - expected_dc += yabove_row[i]; - expected_dc += yleft_col[i]; - } - expected_dc = (expected_dc + 8) >> 4; - - for (r = 0; r < 8; r++) - { - for (c = 0; c < 8; c++) - { - predictor[c] = expected_dc; - } - predictor += 16; - } - } - break; - case V_PRED: - { - for (r = 0; r < 8; r++) - { - for (c = 0; c < 8; c++) - { - predictor[c] = yabove_row[c]; - } - predictor += 16; - } + unsigned char *predictor) { + unsigned char *yabove_row = *(x->base_dst) + x->dst - x->dst_stride; + unsigned char yleft_col[8]; + unsigned char ytop_left = yabove_row[-1]; + int r, c, i; + + for (i = 0; i < 8; i++) { + yleft_col[i] = (*(x->base_dst))[x->dst - 1 + i * x->dst_stride]; + } + switch (mode) { + case DC_PRED: { + int expected_dc = 0; + + for (i = 0; i < 8; i++) { + expected_dc += yabove_row[i]; + expected_dc += yleft_col[i]; + } + expected_dc = (expected_dc + 8) >> 4; + + for (r = 0; r < 8; r++) { + for (c = 0; c < 8; c++) { + predictor[c] = expected_dc; } - break; - case H_PRED: - { - - for (r = 0; r < 8; r++) - { - for (c = 0; c < 8; c++) - { - predictor[c] = yleft_col[r]; - } - predictor += 16; - } - } - break; - case TM_PRED: - { - /* prediction similar to true_motion prediction */ - for (r = 0; r < 8; r++) - { - for (c = 0; c < 8; c++) - { - int pred = yabove_row[c] - ytop_left + yleft_col[r]; - if (pred < 0) - pred = 0; - - if (pred > 255) - pred = 255; - predictor[c] = pred; - } - - predictor += 16; - } - } - break; -#if CONFIG_NEWINTRAMODES - case D45_PRED: - { - d45_predictor(predictor, 16, 8, yabove_row, yleft_col); - } - break; - case D135_PRED: - { - d135_predictor(predictor, 16, 8, yabove_row, yleft_col); - } - break; - case D117_PRED: - { - d117_predictor(predictor, 16, 8, yabove_row, yleft_col); - } - break; - case D153_PRED: - { - d153_predictor(predictor, 16, 8, yabove_row, yleft_col); + predictor += 16; + } + } + break; + case V_PRED: { + for (r = 0; r < 8; r++) { + for (c = 0; c < 8; c++) { + predictor[c] = yabove_row[c]; } - break; - case D27_PRED: - { - d27_predictor(predictor, 16, 8, yabove_row, yleft_col); + predictor += 16; + } + + } + break; + case H_PRED: { + + for (r = 0; r < 8; r++) { + for (c = 0; c < 8; c++) { + predictor[c] = yleft_col[r]; } - break; - case D63_PRED: - { - d63_predictor(predictor, 16, 8, yabove_row, yleft_col); + predictor += 16; + } + } + break; + case TM_PRED: { + /* prediction similar to true_motion prediction */ + for (r = 0; r < 8; r++) { + for (c = 0; c < 8; c++) { + int pred = yabove_row[c] - ytop_left + yleft_col[r]; + if (pred < 0) + pred = 0; + + if (pred > 255) + pred = 255; + predictor[c] = pred; } - break; -#endif + + predictor += 16; + } } + break; +#if CONFIG_NEWINTRAMODES + case D45_PRED: { + d45_predictor(predictor, 16, 8, yabove_row, yleft_col); + } + break; + case D135_PRED: { + d135_predictor(predictor, 16, 8, yabove_row, yleft_col); + } + break; + case D117_PRED: { + d117_predictor(predictor, 16, 8, yabove_row, yleft_col); + } + break; + case D153_PRED: { + d153_predictor(predictor, 16, 8, yabove_row, yleft_col); + } + break; + case D27_PRED: { + d27_predictor(predictor, 16, 8, yabove_row, yleft_col); + } + break; + case D63_PRED: { + d63_predictor(predictor, 16, 8, yabove_row, yleft_col); + } + break; +#endif + } } #if CONFIG_COMP_INTRA_PRED void vp8_comp_intra8x8_predict(BLOCKD *x, int mode, int second_mode, - unsigned char *out_predictor) -{ - unsigned char predictor[2][8*16]; - int i, j; - - vp8_intra8x8_predict(x, mode, predictor[0]); - vp8_intra8x8_predict(x, second_mode, predictor[1]); - - for (i = 0; i < 8*16; i += 16) - { - for (j = i; j < i + 8; j++) - { - out_predictor[j] = (predictor[0][j] + predictor[1][j] + 1) >> 1; - } + unsigned char *out_predictor) { + unsigned char predictor[2][8 * 16]; + int i, j; + + vp8_intra8x8_predict(x, mode, predictor[0]); + vp8_intra8x8_predict(x, second_mode, predictor[1]); + + for (i = 0; i < 8 * 16; i += 16) { + for (j = i; j < i + 8; j++) { + out_predictor[j] = (predictor[0][j] + predictor[1][j] + 1) >> 1; } + } } #endif void vp8_intra_uv4x4_predict(BLOCKD *x, int mode, - unsigned char *predictor) -{ - - unsigned char *above_row = *(x->base_dst) + x->dst - x->dst_stride; - unsigned char left_col[4]; - unsigned char top_left = above_row[-1]; - int r, c, i; - - for (i = 0; i < 4; i++) - { - left_col[i] = (*(x->base_dst))[x->dst - 1 + i * x->dst_stride]; - } - switch (mode) - { - case DC_PRED: - { - int expected_dc = 0; - - for (i = 0; i < 4; i++) - { - expected_dc += above_row[i]; - expected_dc += left_col[i]; - } - expected_dc = (expected_dc + 4) >> 3; - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - predictor[c] = expected_dc; - } - predictor += 8; - } + unsigned char *predictor) { + + unsigned char *above_row = *(x->base_dst) + x->dst - x->dst_stride; + unsigned char left_col[4]; + unsigned char top_left = above_row[-1]; + int r, c, i; + + for (i = 0; i < 4; i++) { + left_col[i] = (*(x->base_dst))[x->dst - 1 + i * x->dst_stride]; + } + switch (mode) { + case DC_PRED: { + int expected_dc = 0; + + for (i = 0; i < 4; i++) { + expected_dc += above_row[i]; + expected_dc += left_col[i]; + } + expected_dc = (expected_dc + 4) >> 3; + + for (r = 0; r < 4; r++) { + for (c = 0; c < 4; c++) { + predictor[c] = expected_dc; } - break; - case V_PRED: - { - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - - predictor[c] = above_row[c]; - } - predictor += 8; - } + predictor += 8; + } + } + break; + case V_PRED: { + for (r = 0; r < 4; r++) { + for (c = 0; c < 4; c++) { + predictor[c] = above_row[c]; } - break; - case H_PRED: - { - - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - predictor[c] = left_col[r]; - } - predictor += 8; - } + predictor += 8; + } + + } + break; + case H_PRED: { + + for (r = 0; r < 4; r++) { + for (c = 0; c < 4; c++) { + predictor[c] = left_col[r]; } - break; - case TM_PRED: - { - /* prediction similar to true_motion prediction */ - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - int pred = above_row[c] - top_left + left_col[r]; - if (pred < 0) - pred = 0; - - if (pred > 255) - pred = 255; - predictor[c] = pred; - } - - predictor += 8; - } + predictor += 8; + } + } + break; + case TM_PRED: { + /* prediction similar to true_motion prediction */ + for (r = 0; r < 4; r++) { + for (c = 0; c < 4; c++) { + int pred = above_row[c] - top_left + left_col[r]; + if (pred < 0) + pred = 0; + + if (pred > 255) + pred = 255; + predictor[c] = pred; } - break; + + predictor += 8; + } + } + break; #if CONFIG_NEWINTRAMODES - case D45_PRED: - { - d45_predictor(predictor, 8, 4, above_row, left_col); - } - break; - case D135_PRED: - { - d135_predictor(predictor, 8, 4, above_row, left_col); - } - break; - case D117_PRED: - { - d117_predictor(predictor, 8, 4, above_row, left_col); - } - break; - case D153_PRED: - { - d153_predictor(predictor, 8, 4, above_row, left_col); - } - break; - case D27_PRED: - { - d27_predictor(predictor, 8, 4, above_row, left_col); - } - break; - case D63_PRED: - { - d63_predictor(predictor, 8, 4, above_row, left_col); - } - break; -#endif + case D45_PRED: { + d45_predictor(predictor, 8, 4, above_row, left_col); } + break; + case D135_PRED: { + d135_predictor(predictor, 8, 4, above_row, left_col); + } + break; + case D117_PRED: { + d117_predictor(predictor, 8, 4, above_row, left_col); + } + break; + case D153_PRED: { + d153_predictor(predictor, 8, 4, above_row, left_col); + } + break; + case D27_PRED: { + d27_predictor(predictor, 8, 4, above_row, left_col); + } + break; + case D63_PRED: { + d63_predictor(predictor, 8, 4, above_row, left_col); + } + break; +#endif + } } #if CONFIG_COMP_INTRA_PRED void vp8_comp_intra_uv4x4_predict(BLOCKD *x, int mode, int mode2, - unsigned char *out_predictor) -{ - unsigned char predictor[2][8*4]; - int i, j; - - vp8_intra_uv4x4_predict(x, mode, predictor[0]); - vp8_intra_uv4x4_predict(x, mode2, predictor[1]); - - for (i = 0; i < 4*8; i += 8) - { - for (j = i; j < i + 4; j++) - { - out_predictor[j] = (predictor[0][j] + predictor[1][j] + 1) >> 1; - } + unsigned char *out_predictor) { + unsigned char predictor[2][8 * 4]; + int i, j; + + vp8_intra_uv4x4_predict(x, mode, predictor[0]); + vp8_intra_uv4x4_predict(x, mode2, predictor[1]); + + for (i = 0; i < 4 * 8; i += 8) { + for (j = i; j < i + 4; j++) { + out_predictor[j] = (predictor[0][j] + predictor[1][j] + 1) >> 1; } + } } #endif diff --git a/vp8/common/reconintra4x4.c b/vp8/common/reconintra4x4.c index ab8be4815..c7da1c558 100644 --- a/vp8/common/reconintra4x4.c +++ b/vp8/common/reconintra4x4.c @@ -16,322 +16,297 @@ void vp8_intra4x4_predict(BLOCKD *x, int b_mode, - unsigned char *predictor) -{ - int i, r, c; - - unsigned char *Above = *(x->base_dst) + x->dst - x->dst_stride; - unsigned char Left[4]; - unsigned char top_left = Above[-1]; - - Left[0] = (*(x->base_dst))[x->dst - 1]; - Left[1] = (*(x->base_dst))[x->dst - 1 + x->dst_stride]; - Left[2] = (*(x->base_dst))[x->dst - 1 + 2 * x->dst_stride]; - Left[3] = (*(x->base_dst))[x->dst - 1 + 3 * x->dst_stride]; - - switch (b_mode) - { - case B_DC_PRED: - { - int expected_dc = 0; - - for (i = 0; i < 4; i++) - { - expected_dc += Above[i]; - expected_dc += Left[i]; - } + unsigned char *predictor) { + int i, r, c; + + unsigned char *Above = *(x->base_dst) + x->dst - x->dst_stride; + unsigned char Left[4]; + unsigned char top_left = Above[-1]; + + Left[0] = (*(x->base_dst))[x->dst - 1]; + Left[1] = (*(x->base_dst))[x->dst - 1 + x->dst_stride]; + Left[2] = (*(x->base_dst))[x->dst - 1 + 2 * x->dst_stride]; + Left[3] = (*(x->base_dst))[x->dst - 1 + 3 * x->dst_stride]; - expected_dc = (expected_dc + 4) >> 3; + switch (b_mode) { + case B_DC_PRED: { + int expected_dc = 0; - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - predictor[c] = expected_dc; - } + for (i = 0; i < 4; i++) { + expected_dc += Above[i]; + expected_dc += Left[i]; + } - predictor += 16; + expected_dc = (expected_dc + 4) >> 3; + + for (r = 0; r < 4; r++) { + for (c = 0; c < 4; c++) { + predictor[c] = expected_dc; } + + predictor += 16; + } } break; - case B_TM_PRED: - { - /* prediction similar to true_motion prediction */ - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - int pred = Above[c] - top_left + Left[r]; - - if (pred < 0) - pred = 0; + case B_TM_PRED: { + /* prediction similar to true_motion prediction */ + for (r = 0; r < 4; r++) { + for (c = 0; c < 4; c++) { + int pred = Above[c] - top_left + Left[r]; - if (pred > 255) - pred = 255; + if (pred < 0) + pred = 0; - predictor[c] = pred; - } + if (pred > 255) + pred = 255; - predictor += 16; + predictor[c] = pred; } + + predictor += 16; + } } break; - case B_VE_PRED: - { - - unsigned int ap[4]; - ap[0] = Above[0]; - ap[1] = Above[1]; - ap[2] = Above[2]; - ap[3] = Above[3]; + case B_VE_PRED: { - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { + unsigned int ap[4]; + ap[0] = Above[0]; + ap[1] = Above[1]; + ap[2] = Above[2]; + ap[3] = Above[3]; - predictor[c] = ap[c]; - } + for (r = 0; r < 4; r++) { + for (c = 0; c < 4; c++) { - predictor += 16; + predictor[c] = ap[c]; } + predictor += 16; + } + } break; - case B_HE_PRED: - { + case B_HE_PRED: { - unsigned int lp[4]; - lp[0] = Left[0]; - lp[1] = Left[1]; - lp[2] = Left[2]; - lp[3] = Left[3]; + unsigned int lp[4]; + lp[0] = Left[0]; + lp[1] = Left[1]; + lp[2] = Left[2]; + lp[3] = Left[3]; - for (r = 0; r < 4; r++) - { - for (c = 0; c < 4; c++) - { - predictor[c] = lp[r]; - } - - predictor += 16; + for (r = 0; r < 4; r++) { + for (c = 0; c < 4; c++) { + predictor[c] = lp[r]; } - } - break; - case B_LD_PRED: - { - unsigned char *ptr = Above; - predictor[0 * 16 + 0] = (ptr[0] + ptr[1] * 2 + ptr[2] + 2) >> 2; - predictor[0 * 16 + 1] = - predictor[1 * 16 + 0] = (ptr[1] + ptr[2] * 2 + ptr[3] + 2) >> 2; - predictor[0 * 16 + 2] = - predictor[1 * 16 + 1] = - predictor[2 * 16 + 0] = (ptr[2] + ptr[3] * 2 + ptr[4] + 2) >> 2; - predictor[0 * 16 + 3] = - predictor[1 * 16 + 2] = - predictor[2 * 16 + 1] = - predictor[3 * 16 + 0] = (ptr[3] + ptr[4] * 2 + ptr[5] + 2) >> 2; - predictor[1 * 16 + 3] = - predictor[2 * 16 + 2] = - predictor[3 * 16 + 1] = (ptr[4] + ptr[5] * 2 + ptr[6] + 2) >> 2; - predictor[2 * 16 + 3] = - predictor[3 * 16 + 2] = (ptr[5] + ptr[6] * 2 + ptr[7] + 2) >> 2; - predictor[3 * 16 + 3] = (ptr[6] + ptr[7] * 2 + ptr[7] + 2) >> 2; + predictor += 16; + } } break; - case B_RD_PRED: - { - - unsigned char pp[9]; - - pp[0] = Left[3]; - pp[1] = Left[2]; - pp[2] = Left[1]; - pp[3] = Left[0]; - pp[4] = top_left; - pp[5] = Above[0]; - pp[6] = Above[1]; - pp[7] = Above[2]; - pp[8] = Above[3]; - - predictor[3 * 16 + 0] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2; - predictor[3 * 16 + 1] = - predictor[2 * 16 + 0] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2; - predictor[3 * 16 + 2] = - predictor[2 * 16 + 1] = - predictor[1 * 16 + 0] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2; - predictor[3 * 16 + 3] = - predictor[2 * 16 + 2] = - predictor[1 * 16 + 1] = - predictor[0 * 16 + 0] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2; - predictor[2 * 16 + 3] = - predictor[1 * 16 + 2] = - predictor[0 * 16 + 1] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2; - predictor[1 * 16 + 3] = - predictor[0 * 16 + 2] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2; - predictor[0 * 16 + 3] = (pp[6] + pp[7] * 2 + pp[8] + 2) >> 2; + case B_LD_PRED: { + unsigned char *ptr = Above; + predictor[0 * 16 + 0] = (ptr[0] + ptr[1] * 2 + ptr[2] + 2) >> 2; + predictor[0 * 16 + 1] = + predictor[1 * 16 + 0] = (ptr[1] + ptr[2] * 2 + ptr[3] + 2) >> 2; + predictor[0 * 16 + 2] = + predictor[1 * 16 + 1] = + predictor[2 * 16 + 0] = (ptr[2] + ptr[3] * 2 + ptr[4] + 2) >> 2; + predictor[0 * 16 + 3] = + predictor[1 * 16 + 2] = + predictor[2 * 16 + 1] = + predictor[3 * 16 + 0] = (ptr[3] + ptr[4] * 2 + ptr[5] + 2) >> 2; + predictor[1 * 16 + 3] = + predictor[2 * 16 + 2] = + predictor[3 * 16 + 1] = (ptr[4] + ptr[5] * 2 + ptr[6] + 2) >> 2; + predictor[2 * 16 + 3] = + predictor[3 * 16 + 2] = (ptr[5] + ptr[6] * 2 + ptr[7] + 2) >> 2; + predictor[3 * 16 + 3] = (ptr[6] + ptr[7] * 2 + ptr[7] + 2) >> 2; } break; - case B_VR_PRED: - { - - unsigned char pp[9]; - - pp[0] = Left[3]; - pp[1] = Left[2]; - pp[2] = Left[1]; - pp[3] = Left[0]; - pp[4] = top_left; - pp[5] = Above[0]; - pp[6] = Above[1]; - pp[7] = Above[2]; - pp[8] = Above[3]; - - - predictor[3 * 16 + 0] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2; - predictor[2 * 16 + 0] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2; - predictor[3 * 16 + 1] = - predictor[1 * 16 + 0] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2; + case B_RD_PRED: { + + unsigned char pp[9]; + + pp[0] = Left[3]; + pp[1] = Left[2]; + pp[2] = Left[1]; + pp[3] = Left[0]; + pp[4] = top_left; + pp[5] = Above[0]; + pp[6] = Above[1]; + pp[7] = Above[2]; + pp[8] = Above[3]; + + predictor[3 * 16 + 0] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2; + predictor[3 * 16 + 1] = + predictor[2 * 16 + 0] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2; + predictor[3 * 16 + 2] = predictor[2 * 16 + 1] = - predictor[0 * 16 + 0] = (pp[4] + pp[5] + 1) >> 1; - predictor[3 * 16 + 2] = - predictor[1 * 16 + 1] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2; + predictor[1 * 16 + 0] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2; + predictor[3 * 16 + 3] = predictor[2 * 16 + 2] = - predictor[0 * 16 + 1] = (pp[5] + pp[6] + 1) >> 1; - predictor[3 * 16 + 3] = - predictor[1 * 16 + 2] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2; - predictor[2 * 16 + 3] = - predictor[0 * 16 + 2] = (pp[6] + pp[7] + 1) >> 1; - predictor[1 * 16 + 3] = (pp[6] + pp[7] * 2 + pp[8] + 2) >> 2; - predictor[0 * 16 + 3] = (pp[7] + pp[8] + 1) >> 1; + predictor[1 * 16 + 1] = + predictor[0 * 16 + 0] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2; + predictor[2 * 16 + 3] = + predictor[1 * 16 + 2] = + predictor[0 * 16 + 1] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2; + predictor[1 * 16 + 3] = + predictor[0 * 16 + 2] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2; + predictor[0 * 16 + 3] = (pp[6] + pp[7] * 2 + pp[8] + 2) >> 2; } break; - case B_VL_PRED: - { + case B_VR_PRED: { + + unsigned char pp[9]; + + pp[0] = Left[3]; + pp[1] = Left[2]; + pp[2] = Left[1]; + pp[3] = Left[0]; + pp[4] = top_left; + pp[5] = Above[0]; + pp[6] = Above[1]; + pp[7] = Above[2]; + pp[8] = Above[3]; + + + predictor[3 * 16 + 0] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2; + predictor[2 * 16 + 0] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2; + predictor[3 * 16 + 1] = + predictor[1 * 16 + 0] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2; + predictor[2 * 16 + 1] = + predictor[0 * 16 + 0] = (pp[4] + pp[5] + 1) >> 1; + predictor[3 * 16 + 2] = + predictor[1 * 16 + 1] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2; + predictor[2 * 16 + 2] = + predictor[0 * 16 + 1] = (pp[5] + pp[6] + 1) >> 1; + predictor[3 * 16 + 3] = + predictor[1 * 16 + 2] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2; + predictor[2 * 16 + 3] = + predictor[0 * 16 + 2] = (pp[6] + pp[7] + 1) >> 1; + predictor[1 * 16 + 3] = (pp[6] + pp[7] * 2 + pp[8] + 2) >> 2; + predictor[0 * 16 + 3] = (pp[7] + pp[8] + 1) >> 1; - unsigned char *pp = Above; + } + break; + case B_VL_PRED: { - predictor[0 * 16 + 0] = (pp[0] + pp[1] + 1) >> 1; - predictor[1 * 16 + 0] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2; - predictor[2 * 16 + 0] = - predictor[0 * 16 + 1] = (pp[1] + pp[2] + 1) >> 1; - predictor[1 * 16 + 1] = - predictor[3 * 16 + 0] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2; - predictor[2 * 16 + 1] = - predictor[0 * 16 + 2] = (pp[2] + pp[3] + 1) >> 1; - predictor[3 * 16 + 1] = - predictor[1 * 16 + 2] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2; - predictor[0 * 16 + 3] = - predictor[2 * 16 + 2] = (pp[3] + pp[4] + 1) >> 1; - predictor[1 * 16 + 3] = - predictor[3 * 16 + 2] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2; - predictor[2 * 16 + 3] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2; - predictor[3 * 16 + 3] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2; + unsigned char *pp = Above; + + predictor[0 * 16 + 0] = (pp[0] + pp[1] + 1) >> 1; + predictor[1 * 16 + 0] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2; + predictor[2 * 16 + 0] = + predictor[0 * 16 + 1] = (pp[1] + pp[2] + 1) >> 1; + predictor[1 * 16 + 1] = + predictor[3 * 16 + 0] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2; + predictor[2 * 16 + 1] = + predictor[0 * 16 + 2] = (pp[2] + pp[3] + 1) >> 1; + predictor[3 * 16 + 1] = + predictor[1 * 16 + 2] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2; + predictor[0 * 16 + 3] = + predictor[2 * 16 + 2] = (pp[3] + pp[4] + 1) >> 1; + predictor[1 * 16 + 3] = + predictor[3 * 16 + 2] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2; + predictor[2 * 16 + 3] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2; + predictor[3 * 16 + 3] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2; } break; - case B_HD_PRED: - { - unsigned char pp[9]; - pp[0] = Left[3]; - pp[1] = Left[2]; - pp[2] = Left[1]; - pp[3] = Left[0]; - pp[4] = top_left; - pp[5] = Above[0]; - pp[6] = Above[1]; - pp[7] = Above[2]; - pp[8] = Above[3]; - - - predictor[3 * 16 + 0] = (pp[0] + pp[1] + 1) >> 1; - predictor[3 * 16 + 1] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2; - predictor[2 * 16 + 0] = - predictor[3 * 16 + 2] = (pp[1] + pp[2] + 1) >> 1; - predictor[2 * 16 + 1] = - predictor[3 * 16 + 3] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2; - predictor[2 * 16 + 2] = - predictor[1 * 16 + 0] = (pp[2] + pp[3] + 1) >> 1; - predictor[2 * 16 + 3] = - predictor[1 * 16 + 1] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2; - predictor[1 * 16 + 2] = - predictor[0 * 16 + 0] = (pp[3] + pp[4] + 1) >> 1; - predictor[1 * 16 + 3] = - predictor[0 * 16 + 1] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2; - predictor[0 * 16 + 2] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2; - predictor[0 * 16 + 3] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2; + case B_HD_PRED: { + unsigned char pp[9]; + pp[0] = Left[3]; + pp[1] = Left[2]; + pp[2] = Left[1]; + pp[3] = Left[0]; + pp[4] = top_left; + pp[5] = Above[0]; + pp[6] = Above[1]; + pp[7] = Above[2]; + pp[8] = Above[3]; + + + predictor[3 * 16 + 0] = (pp[0] + pp[1] + 1) >> 1; + predictor[3 * 16 + 1] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2; + predictor[2 * 16 + 0] = + predictor[3 * 16 + 2] = (pp[1] + pp[2] + 1) >> 1; + predictor[2 * 16 + 1] = + predictor[3 * 16 + 3] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2; + predictor[2 * 16 + 2] = + predictor[1 * 16 + 0] = (pp[2] + pp[3] + 1) >> 1; + predictor[2 * 16 + 3] = + predictor[1 * 16 + 1] = (pp[2] + pp[3] * 2 + pp[4] + 2) >> 2; + predictor[1 * 16 + 2] = + predictor[0 * 16 + 0] = (pp[3] + pp[4] + 1) >> 1; + predictor[1 * 16 + 3] = + predictor[0 * 16 + 1] = (pp[3] + pp[4] * 2 + pp[5] + 2) >> 2; + predictor[0 * 16 + 2] = (pp[4] + pp[5] * 2 + pp[6] + 2) >> 2; + predictor[0 * 16 + 3] = (pp[5] + pp[6] * 2 + pp[7] + 2) >> 2; } break; - case B_HU_PRED: - { - unsigned char *pp = Left; - predictor[0 * 16 + 0] = (pp[0] + pp[1] + 1) >> 1; - predictor[0 * 16 + 1] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2; - predictor[0 * 16 + 2] = - predictor[1 * 16 + 0] = (pp[1] + pp[2] + 1) >> 1; - predictor[0 * 16 + 3] = - predictor[1 * 16 + 1] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2; - predictor[1 * 16 + 2] = - predictor[2 * 16 + 0] = (pp[2] + pp[3] + 1) >> 1; - predictor[1 * 16 + 3] = - predictor[2 * 16 + 1] = (pp[2] + pp[3] * 2 + pp[3] + 2) >> 2; - predictor[2 * 16 + 2] = - predictor[2 * 16 + 3] = - predictor[3 * 16 + 0] = - predictor[3 * 16 + 1] = - predictor[3 * 16 + 2] = - predictor[3 * 16 + 3] = pp[3]; + case B_HU_PRED: { + unsigned char *pp = Left; + predictor[0 * 16 + 0] = (pp[0] + pp[1] + 1) >> 1; + predictor[0 * 16 + 1] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2; + predictor[0 * 16 + 2] = + predictor[1 * 16 + 0] = (pp[1] + pp[2] + 1) >> 1; + predictor[0 * 16 + 3] = + predictor[1 * 16 + 1] = (pp[1] + pp[2] * 2 + pp[3] + 2) >> 2; + predictor[1 * 16 + 2] = + predictor[2 * 16 + 0] = (pp[2] + pp[3] + 1) >> 1; + predictor[1 * 16 + 3] = + predictor[2 * 16 + 1] = (pp[2] + pp[3] * 2 + pp[3] + 2) >> 2; + predictor[2 * 16 + 2] = + predictor[2 * 16 + 3] = + predictor[3 * 16 + 0] = + predictor[3 * 16 + 1] = + predictor[3 * 16 + 2] = + predictor[3 * 16 + 3] = pp[3]; } break; - } + } } #if CONFIG_COMP_INTRA_PRED void vp8_comp_intra4x4_predict(BLOCKD *x, int b_mode, int b_mode2, - unsigned char *out_predictor) -{ - unsigned char predictor[2][4*16]; - int i, j; - - vp8_intra4x4_predict(x, b_mode, predictor[0]); - vp8_intra4x4_predict(x, b_mode2, predictor[1]); - - for (i = 0; i < 16*4; i += 16) - { - for (j = i; j < i + 4; j++) - { - out_predictor[j] = (predictor[0][j] + predictor[1][j] + 1) >> 1; - } + unsigned char *out_predictor) { + unsigned char predictor[2][4 * 16]; + int i, j; + + vp8_intra4x4_predict(x, b_mode, predictor[0]); + vp8_intra4x4_predict(x, b_mode2, predictor[1]); + + for (i = 0; i < 16 * 4; i += 16) { + for (j = i; j < i + 4; j++) { + out_predictor[j] = (predictor[0][j] + predictor[1][j] + 1) >> 1; } + } } #endif /* copy 4 bytes from the above right down so that the 4x4 prediction modes using pixels above and * to the right prediction have filled in pixels to use. */ -void vp8_intra_prediction_down_copy(MACROBLOCKD *x) -{ - unsigned char *above_right = *(x->block[0].base_dst) + x->block[0].dst - x->block[0].dst_stride + 16; - - unsigned int *src_ptr = (unsigned int *)above_right; - unsigned int *dst_ptr0 = (unsigned int *)(above_right + 4 * x->block[0].dst_stride); - unsigned int *dst_ptr1 = (unsigned int *)(above_right + 8 * x->block[0].dst_stride); - unsigned int *dst_ptr2 = (unsigned int *)(above_right + 12 * x->block[0].dst_stride); - - *dst_ptr0 = *src_ptr; - *dst_ptr1 = *src_ptr; - *dst_ptr2 = *src_ptr; +void vp8_intra_prediction_down_copy(MACROBLOCKD *x) { + unsigned char *above_right = *(x->block[0].base_dst) + x->block[0].dst - x->block[0].dst_stride + 16; + + unsigned int *src_ptr = (unsigned int *)above_right; + unsigned int *dst_ptr0 = (unsigned int *)(above_right + 4 * x->block[0].dst_stride); + unsigned int *dst_ptr1 = (unsigned int *)(above_right + 8 * x->block[0].dst_stride); + unsigned int *dst_ptr2 = (unsigned int *)(above_right + 12 * x->block[0].dst_stride); + + *dst_ptr0 = *src_ptr; + *dst_ptr1 = *src_ptr; + *dst_ptr2 = *src_ptr; } diff --git a/vp8/common/rotate.h b/vp8/common/rotate.h index 580f55279..50080c0ac 100644 --- a/vp8/common/rotate.h +++ b/vp8/common/rotate.h @@ -1,2827 +1,2827 @@ - // angle of -2.5 degrees - -1, 0, 14696, -1, 1, 11702, 0, 0, 24063, 0, 1, 15075, // 0, 0 - -1, 1, 13787, -1, 2, 11164, 0, 1, 25366, 0, 2, 15219, // 0, 1 - -1, 2, 12938, -1, 3, 10637, 0, 2, 26660, 0, 3, 15301, // 0, 2 - -1, 3, 12159, -1, 4, 10135, 0, 3, 27912, 0, 4, 15330, // 0, 3 - -1, 4, 11461, -1, 5, 9673, 0, 4, 29078, 0, 5, 15324, // 0, 4 - -1, 5, 10855, -1, 6, 9265, 0, 5, 30105, 0, 6, 15311, // 0, 5 - -1, 6, 10351, -1, 7, 8927, 0, 6, 30939, 0, 7, 15319, // 0, 6 - -1, 7, 9959, -1, 8, 8669, 0, 7, 31532, 0, 8, 15376, // 0, 7 - 0, 8, 31444, 0, 9, 15301, 1, 8, 10065, 1, 9, 8726, // 0, 8 - 0, 9, 30876, 0, 10, 15193, 1, 9, 10482, 1, 10, 8985, // 0, 9 - 0, 10, 30064, 0, 11, 15135, 1, 10, 11013, 1, 11, 9324, // 0,10 - 0, 11, 29055, 0, 12, 15100, 1, 11, 11652, 1, 12, 9729, // 0,11 - 0, 12, 27903, 0, 13, 15060, 1, 12, 12388, 1, 13, 10185, // 0,12 - 0, 13, 26660, 0, 14, 14990, 1, 13, 13211, 1, 14, 10675, // 0,13 - 0, 14, 25368, 0, 15, 14872, 1, 14, 14109, 1, 15, 11187, // 0,14 - 0, 15, 24063, 0, 16, 14696, 1, 15, 15076, 1, 16, 11701, // 0,15 - 0, 0, 14872, 0, 1, 11187, 1, 0, 25368, 1, 1, 14109, // 1, 0 - 0, 1, 13853, 0, 2, 10644, 1, 1, 26893, 1, 2, 14146, // 1, 1 - 0, 2, 12897, 0, 3, 10102, 1, 2, 28430, 1, 3, 14107, // 1, 2 - 0, 3, 12014, 0, 4, 9575, 1, 3, 29938, 1, 4, 14009, // 1, 3 - 0, 4, 11218, 0, 5, 9082, 1, 4, 31361, 1, 5, 13875, // 1, 4 - 0, 5, 10528, 0, 6, 8645, 1, 5, 32624, 1, 6, 13739, // 1, 5 - 0, 6, 9961, 0, 7, 8286, 1, 6, 33642, 1, 7, 13647, // 1, 6 - 0, 7, 9534, 0, 8, 8024, 1, 7, 34340, 1, 8, 13638, // 1, 7 - 1, 8, 34261, 1, 9, 13582, 2, 8, 9626, 2, 9, 8067, // 1, 8 - 1, 9, 33585, 1, 10, 13548, 2, 9, 10074, 2, 10, 8329, // 1, 9 - 1, 10, 32586, 1, 11, 13600, 2, 10, 10665, 2, 11, 8685, // 1,10 - 1, 11, 31339, 1, 12, 13694, 2, 11, 11385, 2, 12, 9118, // 1,11 - 1, 12, 29928, 1, 13, 13789, 2, 12, 12216, 2, 13, 9603, // 1,12 - 1, 13, 28427, 1, 14, 13850, 2, 13, 13141, 2, 14, 10118, // 1,13 - 1, 14, 26893, 1, 15, 13853, 2, 14, 14145, 2, 15, 10645, // 1,14 - 1, 15, 25366, 1, 16, 13787, 2, 15, 15220, 2, 16, 11163, // 1,15 - 1, 0, 14990, 1, 1, 10676, 2, 0, 26660, 2, 1, 13210, // 2, 0 - 1, 1, 13850, 1, 2, 10119, 2, 1, 28427, 2, 2, 13140, // 2, 1 - 1, 2, 12769, 1, 3, 9546, 2, 2, 30239, 2, 3, 12982, // 2, 2 - 1, 3, 11760, 1, 4, 8976, 2, 3, 32052, 2, 4, 12748, // 2, 3 - 1, 4, 10842, 1, 5, 8432, 2, 4, 33795, 2, 5, 12467, // 2, 4 - 1, 5, 10041, 1, 6, 7943, 2, 5, 35364, 2, 6, 12188, // 2, 5 - 1, 6, 9390, 1, 7, 7543, 2, 6, 36631, 2, 7, 11972, // 2, 6 - 1, 7, 8918, 1, 8, 7266, 2, 7, 37470, 2, 8, 11882, // 2, 7 - 2, 8, 37402, 2, 9, 11842, 3, 8, 8994, 3, 9, 7298, // 2, 8 - 2, 9, 36582, 2, 10, 11897, 3, 9, 9484, 3, 10, 7573, // 2, 9 - 2, 10, 35332, 2, 11, 12079, 3, 10, 10156, 3, 11, 7969, // 2,10 - 2, 11, 33777, 2, 12, 12323, 3, 11, 10983, 3, 12, 8453, // 2,11 - 2, 12, 32045, 2, 13, 12569, 3, 12, 11934, 3, 13, 8988, // 2,12 - 2, 13, 30239, 2, 14, 12769, 3, 13, 12982, 3, 14, 9546, // 2,13 - 2, 14, 28430, 2, 15, 12897, 3, 14, 14107, 3, 15, 10102, // 2,14 - 2, 15, 26660, 2, 16, 12938, 3, 15, 15301, 3, 16, 10637, // 2,15 - 2, 0, 15060, 2, 1, 10185, 3, 0, 27903, 3, 1, 12388, // 3, 0 - 2, 1, 13789, 2, 2, 9603, 3, 1, 29928, 3, 2, 12216, // 3, 1 - 2, 2, 12569, 2, 3, 8988, 3, 2, 32045, 3, 3, 11934, // 3, 2 - 2, 3, 11411, 2, 4, 8358, 3, 3, 34213, 3, 4, 11554, // 3, 3 - 2, 4, 10337, 2, 5, 7737, 3, 4, 36354, 3, 5, 11108, // 3, 4 - 2, 5, 9388, 2, 6, 7165, 3, 5, 38330, 3, 6, 10653, // 3, 5 - 2, 6, 8617, 2, 7, 6695, 3, 6, 39949, 3, 7, 10275, // 3, 6 - 2, 7, 8082, 2, 8, 6381, 3, 7, 40994, 3, 8, 10079, // 3, 7 - 3, 8, 40940, 3, 9, 10051, 4, 8, 8141, 4, 9, 6404, // 3, 8 - 3, 9, 39912, 3, 10, 10221, 4, 9, 8690, 4, 10, 6713, // 3, 9 - 3, 10, 38307, 3, 11, 10569, 4, 10, 9479, 4, 11, 7181, // 3,10 - 3, 11, 36343, 3, 12, 10995, 4, 11, 10452, 4, 12, 7746, // 3,11 - 3, 12, 34213, 3, 13, 11411, 4, 12, 11554, 4, 13, 8358, // 3,12 - 3, 13, 32052, 3, 14, 11760, 4, 13, 12747, 4, 14, 8977, // 3,13 - 3, 14, 29938, 3, 15, 12014, 4, 14, 14009, 4, 15, 9575, // 3,14 - 3, 15, 27912, 3, 16, 12159, 4, 15, 15330, 4, 16, 10135, // 3,15 - 3, 0, 15100, 3, 1, 9728, 4, 0, 29055, 4, 1, 11653, // 4, 0 - 3, 1, 13694, 3, 2, 9118, 4, 1, 31339, 4, 2, 11385, // 4, 1 - 3, 2, 12323, 3, 3, 8452, 4, 2, 33777, 4, 3, 10984, // 4, 2 - 3, 3, 10995, 3, 4, 7746, 4, 3, 36343, 4, 4, 10452, // 4, 3 - 3, 4, 9730, 3, 5, 7022, 4, 4, 38966, 4, 5, 9818, // 4, 4 - 3, 5, 8578, 3, 6, 6328, 4, 5, 41487, 4, 6, 9143, // 4, 5 - 3, 6, 7626, 3, 7, 5739, 4, 6, 43626, 4, 7, 8545, // 4, 6 - 3, 7, 6987, 3, 8, 5354, 4, 7, 44999, 4, 8, 8196, // 4, 7 - 4, 8, 44962, 4, 9, 8177, 5, 8, 7029, 5, 9, 5368, // 4, 8 - 4, 9, 43602, 4, 10, 8507, 5, 9, 7678, 5, 10, 5749, // 4, 9 - 4, 10, 41475, 4, 11, 9081, 5, 10, 8646, 5, 11, 6334, // 4,10 - 4, 11, 38966, 4, 12, 9730, 5, 11, 9818, 5, 12, 7022, // 4,11 - 4, 12, 36354, 4, 13, 10337, 5, 12, 11108, 5, 13, 7737, // 4,12 - 4, 13, 33795, 4, 14, 10842, 5, 13, 12467, 5, 14, 8432, // 4,13 - 4, 14, 31361, 4, 15, 11218, 5, 14, 13875, 5, 15, 9082, // 4,14 - 4, 15, 29078, 4, 16, 11461, 5, 15, 15325, 5, 16, 9672, // 4,15 - 4, 0, 15135, 4, 1, 9323, 5, 0, 30064, 5, 1, 11014, // 5, 0 - 4, 1, 13600, 4, 2, 8685, 5, 1, 32586, 5, 2, 10665, // 5, 1 - 4, 2, 12079, 4, 3, 7969, 5, 2, 35332, 5, 3, 10156, // 5, 2 - 4, 3, 10569, 4, 4, 7180, 5, 3, 38307, 5, 4, 9480, // 5, 3 - 4, 4, 9081, 4, 5, 6334, 5, 4, 41475, 5, 5, 8646, // 5, 4 - 4, 5, 7659, 4, 6, 5472, 5, 5, 44700, 5, 6, 7705, // 5, 5 - 4, 6, 6422, 4, 7, 4690, 5, 6, 47630, 5, 7, 6794, // 5, 6 - 4, 7, 5590, 4, 8, 4164, 5, 7, 49588, 5, 8, 6194, // 5, 7 - 5, 8, 49566, 5, 9, 6183, 6, 8, 5615, 6, 9, 4172, // 5, 8 - 5, 9, 47619, 5, 10, 6768, 6, 9, 6455, 6, 10, 4694, // 5, 9 - 5, 10, 44700, 5, 11, 7659, 6, 10, 7705, 6, 11, 5472, // 5,10 - 5, 11, 41487, 5, 12, 8578, 6, 11, 9143, 6, 12, 6328, // 5,11 - 5, 12, 38330, 5, 13, 9388, 6, 12, 10653, 6, 13, 7165, // 5,12 - 5, 13, 35364, 5, 14, 10041, 6, 13, 12188, 6, 14, 7943, // 5,13 - 5, 14, 32624, 5, 15, 10528, 6, 14, 13740, 6, 15, 8644, // 5,14 - 5, 15, 30105, 5, 16, 10855, 6, 15, 15311, 6, 16, 9265, // 5,15 - 5, 0, 15193, 5, 1, 8986, 6, 0, 30876, 6, 1, 10481, // 6, 0 - 5, 1, 13548, 5, 2, 8329, 6, 1, 33585, 6, 2, 10074, // 6, 1 - 5, 2, 11897, 5, 3, 7573, 6, 2, 36582, 6, 3, 9484, // 6, 2 - 5, 3, 10221, 5, 4, 6714, 6, 3, 39912, 6, 4, 8689, // 6, 3 - 5, 4, 8507, 5, 5, 5749, 6, 4, 43602, 6, 5, 7678, // 6, 4 - 5, 5, 6768, 5, 6, 4694, 6, 5, 47619, 6, 6, 6455, // 6, 5 - 5, 6, 5099, 5, 7, 3620, 6, 6, 51701, 6, 7, 5116, // 6, 6 - 5, 7, 3853, 5, 8, 2795, 6, 7, 54839, 6, 8, 4049, // 6, 7 - 6, 8, 54831, 6, 9, 4044, 7, 8, 3864, 7, 9, 2797, // 6, 8 - 6, 9, 51701, 6, 10, 5099, 7, 9, 5116, 7, 10, 3620, // 6, 9 - 6, 10, 47630, 6, 11, 6422, 7, 10, 6794, 7, 11, 4690, // 6,10 - 6, 11, 43626, 6, 12, 7626, 7, 11, 8545, 7, 12, 5739, // 6,11 - 6, 12, 39949, 6, 13, 8617, 7, 12, 10275, 7, 13, 6695, // 6,12 - 6, 13, 36631, 6, 14, 9390, 7, 13, 11972, 7, 14, 7543, // 6,13 - 6, 14, 33642, 6, 15, 9961, 7, 14, 13647, 7, 15, 8286, // 6,14 - 6, 15, 30939, 6, 16, 10351, 7, 15, 15319, 7, 16, 8927, // 6,15 - 6, 0, 15301, 6, 1, 8727, 7, 0, 31444, 7, 1, 10064, // 7, 0 - 6, 1, 13582, 6, 2, 8068, 7, 1, 34261, 7, 2, 9625, // 7, 1 - 6, 2, 11842, 6, 3, 7298, 7, 2, 37402, 7, 3, 8994, // 7, 2 - 6, 3, 10051, 6, 4, 6403, 7, 3, 40940, 7, 4, 8142, // 7, 3 - 6, 4, 8177, 6, 5, 5368, 7, 4, 44962, 7, 5, 7029, // 7, 4 - 6, 5, 6183, 6, 6, 4172, 7, 5, 49566, 7, 6, 5615, // 7, 5 - 6, 6, 4044, 6, 7, 2797, 7, 6, 54831, 7, 7, 3864, // 7, 6 - 6, 7, 1903, 6, 8, 1347, 7, 7, 60382, 7, 8, 1904, // 7, 7 - 7, 8, 60382, 7, 9, 1903, 8, 8, 1905, 8, 9, 1346, // 7, 8 - 7, 9, 54839, 7, 10, 3853, 8, 9, 4049, 8, 10, 2795, // 7, 9 - 7, 10, 49588, 7, 11, 5590, 8, 10, 6193, 8, 11, 4165, // 7,10 - 7, 11, 44999, 7, 12, 6987, 8, 11, 8195, 8, 12, 5355, // 7,11 - 7, 12, 40994, 7, 13, 8082, 8, 12, 10079, 8, 13, 6381, // 7,12 - 7, 13, 37470, 7, 14, 8918, 8, 13, 11883, 8, 14, 7265, // 7,13 - 7, 14, 34340, 7, 15, 9534, 8, 14, 13638, 8, 15, 8024, // 7,14 - 7, 15, 31532, 7, 16, 9959, 8, 15, 15376, 8, 16, 8669, // 7,15 - 7, -1, 8669, 7, 0, 15376, 8, -1, 9959, 8, 0, 31532, // 8, 0 - 7, 0, 8024, 7, 1, 13638, 8, 0, 9534, 8, 1, 34340, // 8, 1 - 7, 1, 7266, 7, 2, 11883, 8, 1, 8918, 8, 2, 37469, // 8, 2 - 7, 2, 6381, 7, 3, 10079, 8, 2, 8082, 8, 3, 40994, // 8, 3 - 7, 3, 5354, 7, 4, 8195, 8, 3, 6987, 8, 4, 45000, // 8, 4 - 7, 4, 4164, 7, 5, 6193, 8, 4, 5590, 8, 5, 49589, // 8, 5 - 7, 5, 2795, 7, 6, 4049, 8, 5, 3853, 8, 6, 54839, // 8, 6 - 7, 6, 1347, 7, 7, 1905, 8, 6, 1903, 8, 7, 60381, // 8, 7 - 8, 7, 1905, 8, 8, 60382, 9, 7, 1347, 9, 8, 1902, // 8, 8 - 8, 8, 3864, 8, 9, 54831, 9, 8, 2797, 9, 9, 4044, // 8, 9 - 8, 9, 5615, 8, 10, 49566, 9, 9, 4172, 9, 10, 6183, // 8,10 - 8, 10, 7029, 8, 11, 44962, 9, 10, 5368, 9, 11, 8177, // 8,11 - 8, 11, 8141, 8, 12, 40940, 9, 11, 6403, 9, 12, 10052, // 8,12 - 8, 12, 8994, 8, 13, 37402, 9, 12, 7298, 9, 13, 11842, // 8,13 - 8, 13, 9626, 8, 14, 34261, 9, 13, 8068, 9, 14, 13581, // 8,14 - 8, 14, 10065, 8, 15, 31444, 9, 14, 8727, 9, 15, 15300, // 8,15 - 8, -1, 8927, 8, 0, 15319, 9, -1, 10351, 9, 0, 30939, // 9, 0 - 8, 0, 8286, 8, 1, 13647, 9, 0, 9961, 9, 1, 33642, // 9, 1 - 8, 1, 7543, 8, 2, 11972, 9, 1, 9390, 9, 2, 36631, // 9, 2 - 8, 2, 6695, 8, 3, 10275, 9, 2, 8617, 9, 3, 39949, // 9, 3 - 8, 3, 5739, 8, 4, 8545, 9, 3, 7626, 9, 4, 43626, // 9, 4 - 8, 4, 4690, 8, 5, 6794, 9, 4, 6422, 9, 5, 47630, // 9, 5 - 8, 5, 3620, 8, 6, 5116, 9, 5, 5099, 9, 6, 51701, // 9, 6 - 8, 6, 2797, 8, 7, 3864, 9, 6, 4044, 9, 7, 54831, // 9, 7 - 9, 7, 4049, 9, 8, 54839, 10, 7, 2795, 10, 8, 3853, // 9, 8 - 9, 8, 5116, 9, 9, 51701, 10, 8, 3620, 10, 9, 5099, // 9, 9 - 9, 9, 6455, 9, 10, 47619, 10, 9, 4694, 10, 10, 6768, // 9,10 - 9, 10, 7678, 9, 11, 43602, 10, 10, 5749, 10, 11, 8507, // 9,11 - 9, 11, 8690, 9, 12, 39912, 10, 11, 6714, 10, 12, 10220, // 9,12 - 9, 12, 9484, 9, 13, 36582, 10, 12, 7573, 10, 13, 11897, // 9,13 - 9, 13, 10074, 9, 14, 33585, 10, 13, 8329, 10, 14, 13548, // 9,14 - 9, 14, 10482, 9, 15, 30876, 10, 14, 8986, 10, 15, 15192, // 9,15 - 9, -1, 9265, 9, 0, 15311, 10, -1, 10855, 10, 0, 30105, // 10, 0 - 9, 0, 8645, 9, 1, 13740, 10, 0, 10528, 10, 1, 32623, // 10, 1 - 9, 1, 7943, 9, 2, 12188, 10, 1, 10041, 10, 2, 35364, // 10, 2 - 9, 2, 7165, 9, 3, 10653, 10, 2, 9388, 10, 3, 38330, // 10, 3 - 9, 3, 6328, 9, 4, 9143, 10, 3, 8578, 10, 4, 41487, // 10, 4 - 9, 4, 5472, 9, 5, 7705, 10, 4, 7659, 10, 5, 44700, // 10, 5 - 9, 5, 4694, 9, 6, 6455, 10, 5, 6768, 10, 6, 47619, // 10, 6 - 9, 6, 4172, 9, 7, 5615, 10, 6, 6183, 10, 7, 49566, // 10, 7 - 10, 7, 6193, 10, 8, 49588, 11, 7, 4164, 11, 8, 5591, // 10, 8 - 10, 8, 6794, 10, 9, 47630, 11, 8, 4690, 11, 9, 6422, // 10, 9 - 10, 9, 7705, 10, 10, 44700, 11, 9, 5472, 11, 10, 7659, // 10,10 - 10, 10, 8646, 10, 11, 41475, 11, 10, 6334, 11, 11, 9081, // 10,11 - 10, 11, 9479, 10, 12, 38307, 11, 11, 7180, 11, 12, 10570, // 10,12 - 10, 12, 10156, 10, 13, 35332, 11, 12, 7969, 11, 13, 12079, // 10,13 - 10, 13, 10665, 10, 14, 32586, 11, 13, 8685, 11, 14, 13600, // 10,14 - 10, 14, 11013, 10, 15, 30064, 11, 14, 9323, 11, 15, 15136, // 10,15 - 10, -1, 9673, 10, 0, 15325, 11, -1, 11461, 11, 0, 29077, // 11, 0 - 10, 0, 9082, 10, 1, 13875, 11, 0, 11218, 11, 1, 31361, // 11, 1 - 10, 1, 8432, 10, 2, 12467, 11, 1, 10842, 11, 2, 33795, // 11, 2 - 10, 2, 7737, 10, 3, 11108, 11, 2, 10337, 11, 3, 36354, // 11, 3 - 10, 3, 7022, 10, 4, 9818, 11, 3, 9730, 11, 4, 38966, // 11, 4 - 10, 4, 6334, 10, 5, 8646, 11, 4, 9081, 11, 5, 41475, // 11, 5 - 10, 5, 5749, 10, 6, 7678, 11, 5, 8507, 11, 6, 43602, // 11, 6 - 10, 6, 5368, 10, 7, 7029, 11, 6, 8177, 11, 7, 44962, // 11, 7 - 11, 7, 8195, 11, 8, 44999, 12, 7, 5354, 12, 8, 6988, // 11, 8 - 11, 8, 8545, 11, 9, 43626, 12, 8, 5739, 12, 9, 7626, // 11, 9 - 11, 9, 9143, 11, 10, 41487, 12, 9, 6328, 12, 10, 8578, // 11,10 - 11, 10, 9818, 11, 11, 38966, 12, 10, 7022, 12, 11, 9730, // 11,11 - 11, 11, 10452, 11, 12, 36343, 12, 11, 7746, 12, 12, 10995, // 11,12 - 11, 12, 10983, 11, 13, 33777, 12, 12, 8452, 12, 13, 12324, // 11,13 - 11, 13, 11385, 11, 14, 31339, 12, 13, 9118, 12, 14, 13694, // 11,14 - 11, 14, 11652, 11, 15, 29055, 12, 14, 9728, 12, 15, 15101, // 11,15 - 11, -1, 10135, 11, 0, 15330, 12, -1, 12159, 12, 0, 27912, // 12, 0 - 11, 0, 9575, 11, 1, 14009, 12, 0, 12014, 12, 1, 29938, // 12, 1 - 11, 1, 8976, 11, 2, 12747, 12, 1, 11760, 12, 2, 32053, // 12, 2 - 11, 2, 8358, 11, 3, 11554, 12, 2, 11411, 12, 3, 34213, // 12, 3 - 11, 3, 7746, 11, 4, 10452, 12, 3, 10995, 12, 4, 36343, // 12, 4 - 11, 4, 7180, 11, 5, 9479, 12, 4, 10569, 12, 5, 38308, // 12, 5 - 11, 5, 6714, 11, 6, 8690, 12, 5, 10221, 12, 6, 39911, // 12, 6 - 11, 6, 6403, 11, 7, 8141, 12, 6, 10051, 12, 7, 40941, // 12, 7 - 12, 7, 10079, 12, 8, 40994, 13, 7, 6381, 13, 8, 8082, // 12, 8 - 12, 8, 10275, 12, 9, 39949, 13, 8, 6695, 13, 9, 8617, // 12, 9 - 12, 9, 10653, 12, 10, 38330, 13, 9, 7165, 13, 10, 9388, // 12,10 - 12, 10, 11108, 12, 11, 36354, 13, 10, 7737, 13, 11, 10337, // 12,11 - 12, 11, 11554, 12, 12, 34213, 13, 11, 8358, 13, 12, 11411, // 12,12 - 12, 12, 11934, 12, 13, 32045, 13, 12, 8988, 13, 13, 12569, // 12,13 - 12, 13, 12216, 12, 14, 29928, 13, 13, 9603, 13, 14, 13789, // 12,14 - 12, 14, 12388, 12, 15, 27903, 13, 14, 10185, 13, 15, 15060, // 12,15 - 12, -1, 10637, 12, 0, 15301, 13, -1, 12938, 13, 0, 26660, // 13, 0 - 12, 0, 10102, 12, 1, 14107, 13, 0, 12897, 13, 1, 28430, // 13, 1 - 12, 1, 9546, 12, 2, 12982, 13, 1, 12769, 13, 2, 30239, // 13, 2 - 12, 2, 8988, 12, 3, 11934, 13, 2, 12569, 13, 3, 32045, // 13, 3 - 12, 3, 8452, 12, 4, 10983, 13, 3, 12323, 13, 4, 33778, // 13, 4 - 12, 4, 7969, 12, 5, 10156, 13, 4, 12079, 13, 5, 35332, // 13, 5 - 12, 5, 7573, 12, 6, 9484, 13, 5, 11897, 13, 6, 36582, // 13, 6 - 12, 6, 7298, 12, 7, 8994, 13, 6, 11842, 13, 7, 37402, // 13, 7 - 13, 7, 11883, 13, 8, 37470, 14, 7, 7266, 14, 8, 8917, // 13, 8 - 13, 8, 11972, 13, 9, 36631, 14, 8, 7543, 14, 9, 9390, // 13, 9 - 13, 9, 12188, 13, 10, 35364, 14, 9, 7943, 14, 10, 10041, // 13,10 - 13, 10, 12467, 13, 11, 33795, 14, 10, 8432, 14, 11, 10842, // 13,11 - 13, 11, 12747, 13, 12, 32052, 14, 11, 8976, 14, 12, 11761, // 13,12 - 13, 12, 12982, 13, 13, 30239, 14, 12, 9546, 14, 13, 12769, // 13,13 - 13, 13, 13141, 13, 14, 28427, 14, 13, 10119, 14, 14, 13849, // 13,14 - 13, 14, 13211, 13, 15, 26660, 14, 14, 10676, 14, 15, 14989, // 13,15 - 13, -1, 11164, 13, 0, 15220, 14, -1, 13787, 14, 0, 25365, // 14, 0 - 13, 0, 10644, 13, 1, 14145, 14, 0, 13853, 14, 1, 26894, // 14, 1 - 13, 1, 10119, 13, 2, 13141, 14, 1, 13850, 14, 2, 28426, // 14, 2 - 13, 2, 9603, 13, 3, 12216, 14, 2, 13789, 14, 3, 29928, // 14, 3 - 13, 3, 9118, 13, 4, 11385, 14, 3, 13694, 14, 4, 31339, // 14, 4 - 13, 4, 8685, 13, 5, 10665, 14, 4, 13600, 14, 5, 32586, // 14, 5 - 13, 5, 8329, 13, 6, 10074, 14, 5, 13548, 14, 6, 33585, // 14, 6 - 13, 6, 8068, 13, 7, 9626, 14, 6, 13582, 14, 7, 34260, // 14, 7 - 14, 7, 13638, 14, 8, 34340, 15, 7, 8024, 15, 8, 9534, // 14, 8 - 14, 8, 13647, 14, 9, 33642, 15, 8, 8286, 15, 9, 9961, // 14, 9 - 14, 9, 13740, 14, 10, 32624, 15, 9, 8645, 15, 10, 10527, // 14,10 - 14, 10, 13875, 14, 11, 31361, 15, 10, 9082, 15, 11, 11218, // 14,11 - 14, 11, 14009, 14, 12, 29938, 15, 11, 9575, 15, 12, 12014, // 14,12 - 14, 12, 14107, 14, 13, 28430, 15, 12, 10102, 15, 13, 12897, // 14,13 - 14, 13, 14145, 14, 14, 26893, 15, 13, 10644, 15, 14, 13854, // 14,14 - 14, 14, 14109, 14, 15, 25368, 15, 14, 11187, 15, 15, 14872, // 14,15 - 14, -1, 11702, 14, 0, 15076, 15, -1, 14696, 15, 0, 24062, // 15, 0 - 14, 0, 11187, 14, 1, 14109, 15, 0, 14872, 15, 1, 25368, // 15, 1 - 14, 1, 10676, 14, 2, 13211, 15, 1, 14990, 15, 2, 26659, // 15, 2 - 14, 2, 10185, 14, 3, 12388, 15, 2, 15060, 15, 3, 27903, // 15, 3 - 14, 3, 9728, 14, 4, 11652, 15, 3, 15100, 15, 4, 29056, // 15, 4 - 14, 4, 9323, 14, 5, 11013, 15, 4, 15135, 15, 5, 30065, // 15, 5 - 14, 5, 8986, 14, 6, 10482, 15, 5, 15193, 15, 6, 30875, // 15, 6 - 14, 6, 8727, 14, 7, 10065, 15, 6, 15301, 15, 7, 31443, // 15, 7 - 15, 7, 15376, 15, 8, 31532, 16, 7, 8669, 16, 8, 9959, // 15, 8 - 15, 8, 15319, 15, 9, 30939, 16, 8, 8927, 16, 9, 10351, // 15, 9 - 15, 9, 15311, 15, 10, 30105, 16, 9, 9265, 16, 10, 10855, // 15,10 - 15, 10, 15325, 15, 11, 29078, 16, 10, 9673, 16, 11, 11460, // 15,11 - 15, 11, 15330, 15, 12, 27912, 16, 11, 10135, 16, 12, 12159, // 15,12 - 15, 12, 15301, 15, 13, 26660, 16, 12, 10637, 16, 13, 12938, // 15,13 - 15, 13, 15220, 15, 14, 25366, 16, 13, 11164, 16, 14, 13786, // 15,14 - 15, 14, 15076, 15, 15, 24063, 16, 14, 11702, 16, 15, 14695, // 15,15 - // angle of -2.0 degrees - -1, 0, 13368, -1, 1, 10104, 0, 0, 28495, 0, 1, 13569, // 0, 0 - -1, 1, 12574, -1, 2, 9662, 0, 1, 29831, 0, 2, 13469, // 0, 1 - -1, 2, 11829, -1, 3, 9229, 0, 2, 31146, 0, 3, 13332, // 0, 2 - -1, 3, 11143, -1, 4, 8816, 0, 3, 32406, 0, 4, 13171, // 0, 3 - -1, 4, 10528, -1, 5, 8438, 0, 4, 33564, 0, 5, 13006, // 0, 4 - -1, 5, 9995, -1, 6, 8107, 0, 5, 34567, 0, 6, 12867, // 0, 5 - -1, 6, 9558, -1, 7, 7839, 0, 6, 35362, 0, 7, 12777, // 0, 6 - -1, 7, 9224, -1, 8, 7643, 0, 7, 35905, 0, 8, 12764, // 0, 7 - 0, 8, 35844, 0, 9, 12728, 1, 8, 9290, 1, 9, 7674, // 0, 8 - 0, 9, 35315, 0, 10, 12717, 1, 9, 9635, 1, 10, 7869, // 0, 9 - 0, 10, 34532, 0, 11, 12783, 1, 10, 10086, 1, 11, 8135, // 0,10 - 0, 11, 33539, 0, 12, 12899, 1, 11, 10635, 1, 12, 8463, // 0,11 - 0, 12, 32391, 0, 13, 13038, 1, 12, 11269, 1, 13, 8838, // 0,12 - 0, 13, 31138, 0, 14, 13176, 1, 13, 11977, 1, 14, 9245, // 0,13 - 0, 14, 29828, 0, 15, 13291, 1, 14, 12746, 1, 15, 9671, // 0,14 - 0, 15, 28495, 0, 16, 13368, 1, 15, 13569, 1, 16, 10104, // 0,15 - 0, 0, 13291, 0, 1, 9671, 1, 0, 29828, 1, 1, 12746, // 1, 0 - 0, 1, 12412, 0, 2, 9202, 1, 1, 31358, 1, 2, 12564, // 1, 1 - 0, 2, 11580, 0, 3, 8735, 1, 2, 32886, 1, 3, 12335, // 1, 2 - 0, 3, 10808, 0, 4, 8284, 1, 3, 34369, 1, 4, 12075, // 1, 3 - 0, 4, 10111, 0, 5, 7865, 1, 4, 35750, 1, 5, 11810, // 1, 4 - 0, 5, 9509, 0, 6, 7497, 1, 5, 36955, 1, 6, 11575, // 1, 5 - 0, 6, 9020, 0, 7, 7202, 1, 6, 37906, 1, 7, 11408, // 1, 6 - 0, 7, 8662, 0, 8, 6997, 1, 7, 38534, 1, 8, 11343, // 1, 7 - 1, 8, 38481, 1, 9, 11317, 2, 8, 8718, 2, 9, 7020, // 1, 8 - 1, 9, 37866, 1, 10, 11360, 2, 9, 9086, 2, 10, 7224, // 1, 9 - 1, 10, 36926, 1, 11, 11507, 2, 10, 9587, 2, 11, 7516, // 1,10 - 1, 11, 35730, 1, 12, 11721, 2, 11, 10204, 2, 12, 7881, // 1,11 - 1, 12, 34358, 1, 13, 11964, 2, 12, 10918, 2, 13, 8296, // 1,12 - 1, 13, 32881, 1, 14, 12203, 2, 13, 11709, 2, 14, 8743, // 1,13 - 1, 14, 31358, 1, 15, 12412, 2, 14, 12564, 2, 15, 9202, // 1,14 - 1, 15, 29831, 1, 16, 12574, 2, 15, 13470, 2, 16, 9661, // 1,15 - 1, 0, 13176, 1, 1, 9245, 2, 0, 31138, 2, 1, 11977, // 2, 0 - 1, 1, 12203, 1, 2, 8742, 2, 1, 32881, 2, 2, 11710, // 2, 1 - 1, 2, 11272, 1, 3, 8232, 2, 2, 34650, 2, 3, 11382, // 2, 2 - 1, 3, 10397, 1, 4, 7728, 2, 3, 36399, 2, 4, 11012, // 2, 3 - 1, 4, 9597, 1, 5, 7252, 2, 4, 38057, 2, 5, 10630, // 2, 4 - 1, 5, 8902, 1, 6, 6829, 2, 5, 39526, 2, 6, 10279, // 2, 5 - 1, 6, 8344, 1, 7, 6491, 2, 6, 40688, 2, 7, 10013, // 2, 6 - 1, 7, 7951, 1, 8, 6266, 2, 7, 41432, 2, 8, 9887, // 2, 7 - 2, 8, 41389, 2, 9, 9867, 3, 8, 7996, 3, 9, 6284, // 2, 8 - 2, 9, 40656, 2, 10, 9977, 3, 9, 8397, 3, 10, 6506, // 2, 9 - 2, 10, 39503, 2, 11, 10226, 3, 10, 8966, 3, 11, 6841, // 2,10 - 2, 11, 38042, 2, 12, 10559, 3, 11, 9674, 3, 12, 7261, // 2,11 - 2, 12, 36392, 2, 13, 10922, 3, 12, 10488, 3, 13, 7734, // 2,12 - 2, 13, 34650, 2, 14, 11272, 3, 13, 11382, 3, 14, 8232, // 2,13 - 2, 14, 32886, 2, 15, 11580, 3, 14, 12334, 3, 15, 8736, // 2,14 - 2, 15, 31146, 2, 16, 11829, 3, 15, 13332, 3, 16, 9229, // 2,15 - 2, 0, 13038, 2, 1, 8838, 3, 0, 32391, 3, 1, 11269, // 3, 0 - 2, 1, 11964, 2, 2, 8296, 3, 1, 34358, 3, 2, 10918, // 3, 1 - 2, 2, 10922, 2, 3, 7734, 3, 2, 36392, 3, 3, 10488, // 3, 2 - 2, 3, 9924, 2, 4, 7164, 3, 3, 38450, 3, 4, 9998, // 3, 3 - 2, 4, 8995, 2, 5, 6611, 3, 4, 40452, 3, 5, 9478, // 3, 4 - 2, 5, 8175, 2, 6, 6108, 3, 5, 42271, 3, 6, 8982, // 3, 5 - 2, 6, 7516, 2, 7, 5703, 3, 6, 43733, 3, 7, 8584, // 3, 6 - 2, 7, 7072, 2, 8, 5443, 3, 7, 44649, 3, 8, 8372, // 3, 7 - 3, 8, 44616, 3, 9, 8359, 4, 8, 7106, 4, 9, 5455, // 3, 8 - 3, 9, 43710, 3, 10, 8558, 4, 9, 7556, 4, 10, 5712, // 3, 9 - 3, 10, 42256, 3, 11, 8940, 4, 10, 8224, 4, 11, 6116, // 3,10 - 3, 11, 40444, 3, 12, 9421, 4, 11, 9056, 4, 12, 6615, // 3,11 - 3, 12, 38450, 3, 13, 9924, 4, 12, 9998, 4, 13, 7164, // 3,12 - 3, 13, 36399, 3, 14, 10397, 4, 13, 11012, 4, 14, 7728, // 3,13 - 3, 14, 34369, 3, 15, 10808, 4, 14, 12074, 4, 15, 8285, // 3,14 - 3, 15, 32406, 3, 16, 11143, 4, 15, 13171, 4, 16, 8816, // 3,15 - 3, 0, 12899, 3, 1, 8463, 4, 0, 33539, 4, 1, 10635, // 4, 0 - 3, 1, 11721, 3, 2, 7881, 4, 1, 35730, 4, 2, 10204, // 4, 1 - 3, 2, 10559, 3, 3, 7261, 4, 2, 38042, 4, 3, 9674, // 4, 2 - 3, 3, 9421, 3, 4, 6615, 4, 3, 40444, 4, 4, 9056, // 4, 3 - 3, 4, 8332, 3, 5, 5965, 4, 4, 42861, 4, 5, 8378, // 4, 4 - 3, 5, 7342, 3, 6, 5350, 4, 5, 45146, 4, 6, 7698, // 4, 5 - 3, 6, 6530, 3, 7, 4838, 4, 6, 47049, 4, 7, 7119, // 4, 6 - 3, 7, 6000, 3, 8, 4513, 4, 7, 48240, 4, 8, 6783, // 4, 7 - 4, 8, 48218, 4, 9, 6774, 5, 8, 6023, 5, 9, 4521, // 4, 8 - 4, 9, 47035, 4, 10, 7100, 5, 9, 6558, 5, 10, 4843, // 4, 9 - 4, 10, 45139, 4, 11, 7667, 5, 10, 7377, 5, 11, 5353, // 4,10 - 4, 11, 42861, 4, 12, 8332, 5, 11, 8378, 5, 12, 5965, // 4,11 - 4, 12, 40452, 4, 13, 8995, 5, 12, 9478, 5, 13, 6611, // 4,12 - 4, 13, 38057, 4, 14, 9597, 5, 13, 10630, 5, 14, 7252, // 4,13 - 4, 14, 35750, 4, 15, 10111, 5, 14, 11810, 5, 15, 7865, // 4,14 - 4, 15, 33564, 4, 16, 10528, 5, 15, 13007, 5, 16, 8437, // 4,15 - 4, 0, 12783, 4, 1, 8135, 5, 0, 34532, 5, 1, 10086, // 5, 0 - 4, 1, 11507, 4, 2, 7517, 5, 1, 36926, 5, 2, 9586, // 5, 1 - 4, 2, 10226, 4, 3, 6842, 5, 2, 39503, 5, 3, 8965, // 5, 2 - 4, 3, 8940, 4, 4, 6116, 5, 3, 42256, 5, 4, 8224, // 5, 3 - 4, 4, 7667, 4, 5, 5353, 5, 4, 45139, 5, 5, 7377, // 5, 4 - 4, 5, 6451, 4, 6, 4591, 5, 5, 48019, 5, 6, 6475, // 5, 5 - 4, 6, 5400, 4, 7, 3911, 5, 6, 50587, 5, 7, 5638, // 5, 6 - 4, 7, 4708, 4, 8, 3466, 5, 7, 52266, 5, 8, 5096, // 5, 7 - 5, 8, 52253, 5, 9, 5092, 6, 8, 4721, 6, 9, 3470, // 5, 8 - 5, 9, 50581, 5, 10, 5624, 6, 9, 5418, 6, 10, 3913, // 5, 9 - 5, 10, 48019, 5, 11, 6451, 6, 10, 6475, 6, 11, 4591, // 5,10 - 5, 11, 45146, 5, 12, 7342, 6, 11, 7698, 6, 12, 5350, // 5,11 - 5, 12, 42271, 5, 13, 8175, 6, 12, 8982, 6, 13, 6108, // 5,12 - 5, 13, 39526, 5, 14, 8902, 6, 13, 10279, 6, 14, 6829, // 5,13 - 5, 14, 36955, 5, 15, 9509, 6, 14, 11575, 6, 15, 7497, // 5,14 - 5, 15, 34567, 5, 16, 9995, 6, 15, 12867, 6, 16, 8107, // 5,15 - 5, 0, 12717, 5, 1, 7868, 6, 0, 35315, 6, 1, 9636, // 6, 0 - 5, 1, 11360, 5, 2, 7224, 6, 1, 37866, 6, 2, 9086, // 6, 1 - 5, 2, 9977, 5, 3, 6506, 6, 2, 40656, 6, 3, 8397, // 6, 2 - 5, 3, 8558, 5, 4, 5712, 6, 3, 43710, 6, 4, 7556, // 6, 3 - 5, 4, 7100, 5, 5, 4843, 6, 4, 47035, 6, 5, 6558, // 6, 4 - 5, 5, 5624, 5, 6, 3913, 6, 5, 50581, 6, 6, 5418, // 6, 5 - 5, 6, 4217, 5, 7, 2989, 6, 6, 54105, 6, 7, 4225, // 6, 6 - 5, 7, 3180, 5, 8, 2294, 6, 7, 56756, 6, 8, 3306, // 6, 7 - 6, 8, 56751, 6, 9, 3303, 7, 8, 3186, 7, 9, 2296, // 6, 8 - 6, 9, 54105, 6, 10, 4217, 7, 9, 4225, 7, 10, 2989, // 6, 9 - 6, 10, 50587, 6, 11, 5400, 7, 10, 5637, 7, 11, 3912, // 6,10 - 6, 11, 47049, 6, 12, 6530, 7, 11, 7119, 7, 12, 4838, // 6,11 - 6, 12, 43733, 6, 13, 7516, 7, 12, 8584, 7, 13, 5703, // 6,12 - 6, 13, 40688, 6, 14, 8344, 7, 13, 10013, 7, 14, 6491, // 6,13 - 6, 14, 37906, 6, 15, 9020, 7, 14, 11407, 7, 15, 7203, // 6,14 - 6, 15, 35362, 6, 16, 9558, 7, 15, 12777, 7, 16, 7839, // 6,15 - 6, 0, 12728, 6, 1, 7674, 7, 0, 35844, 7, 1, 9290, // 7, 0 - 6, 1, 11317, 6, 2, 7020, 7, 1, 38481, 7, 2, 8718, // 7, 1 - 6, 2, 9867, 6, 3, 6284, 7, 2, 41389, 7, 3, 7996, // 7, 2 - 6, 3, 8359, 6, 4, 5454, 7, 3, 44616, 7, 4, 7107, // 7, 3 - 6, 4, 6774, 6, 5, 4521, 7, 4, 48218, 7, 5, 6023, // 7, 4 - 6, 5, 5092, 6, 6, 3470, 7, 5, 52253, 7, 6, 4721, // 7, 5 - 6, 6, 3303, 6, 7, 2295, 7, 6, 56751, 7, 7, 3187, // 7, 6 - 6, 7, 1541, 6, 8, 1090, 7, 7, 61364, 7, 8, 1541, // 7, 7 - 7, 8, 61364, 7, 9, 1541, 8, 8, 1542, 8, 9, 1089, // 7, 8 - 7, 9, 56756, 7, 10, 3180, 8, 9, 3306, 8, 10, 2294, // 7, 9 - 7, 10, 52266, 7, 11, 4708, 8, 10, 5097, 8, 11, 3465, // 7,10 - 7, 11, 48240, 7, 12, 6000, 8, 11, 6783, 8, 12, 4513, // 7,11 - 7, 12, 44649, 7, 13, 7072, 8, 12, 8373, 8, 13, 5442, // 7,12 - 7, 13, 41432, 7, 14, 7951, 8, 13, 9886, 8, 14, 6267, // 7,13 - 7, 14, 38534, 7, 15, 8662, 8, 14, 11344, 8, 15, 6996, // 7,14 - 7, 15, 35905, 7, 16, 9224, 8, 15, 12764, 8, 16, 7643, // 7,15 - 7, -1, 7643, 7, 0, 12764, 8, -1, 9224, 8, 0, 35905, // 8, 0 - 7, 0, 6997, 7, 1, 11344, 8, 0, 8662, 8, 1, 38533, // 8, 1 - 7, 1, 6266, 7, 2, 9886, 8, 1, 7951, 8, 2, 41433, // 8, 2 - 7, 2, 5443, 7, 3, 8373, 8, 2, 7072, 8, 3, 44648, // 8, 3 - 7, 3, 4513, 7, 4, 6783, 8, 3, 6000, 8, 4, 48240, // 8, 4 - 7, 4, 3466, 7, 5, 5097, 8, 4, 4708, 8, 5, 52265, // 8, 5 - 7, 5, 2294, 7, 6, 3306, 8, 5, 3180, 8, 6, 56756, // 8, 6 - 7, 6, 1090, 7, 7, 1542, 8, 6, 1541, 8, 7, 61363, // 8, 7 - 8, 7, 1542, 8, 8, 61364, 9, 7, 1090, 9, 8, 1540, // 8, 8 - 8, 8, 3186, 8, 9, 56751, 9, 8, 2295, 9, 9, 3304, // 8, 9 - 8, 9, 4721, 8, 10, 52253, 9, 9, 3470, 9, 10, 5092, // 8,10 - 8, 10, 6023, 8, 11, 48218, 9, 10, 4521, 9, 11, 6774, // 8,11 - 8, 11, 7106, 8, 12, 44616, 9, 11, 5454, 9, 12, 8360, // 8,12 - 8, 12, 7996, 8, 13, 41389, 9, 12, 6284, 9, 13, 9867, // 8,13 - 8, 13, 8718, 8, 14, 38481, 9, 13, 7020, 9, 14, 11317, // 8,14 - 8, 14, 9290, 8, 15, 35844, 9, 14, 7674, 9, 15, 12728, // 8,15 - 8, -1, 7839, 8, 0, 12777, 9, -1, 9558, 9, 0, 35362, // 9, 0 - 8, 0, 7202, 8, 1, 11407, 9, 0, 9020, 9, 1, 37907, // 9, 1 - 8, 1, 6491, 8, 2, 10013, 9, 1, 8344, 9, 2, 40688, // 9, 2 - 8, 2, 5703, 8, 3, 8584, 9, 2, 7516, 9, 3, 43733, // 9, 3 - 8, 3, 4838, 8, 4, 7119, 9, 3, 6530, 9, 4, 47049, // 9, 4 - 8, 4, 3911, 8, 5, 5637, 9, 4, 5400, 9, 5, 50588, // 9, 5 - 8, 5, 2989, 8, 6, 4225, 9, 5, 4217, 9, 6, 54105, // 9, 6 - 8, 6, 2295, 8, 7, 3186, 9, 6, 3303, 9, 7, 56752, // 9, 7 - 9, 7, 3306, 9, 8, 56756, 10, 7, 2294, 10, 8, 3180, // 9, 8 - 9, 8, 4225, 9, 9, 54105, 10, 8, 2989, 10, 9, 4217, // 9, 9 - 9, 9, 5418, 9, 10, 50581, 10, 9, 3913, 10, 10, 5624, // 9,10 - 9, 10, 6558, 9, 11, 47035, 10, 10, 4843, 10, 11, 7100, // 9,11 - 9, 11, 7556, 9, 12, 43710, 10, 11, 5712, 10, 12, 8558, // 9,12 - 9, 12, 8397, 9, 13, 40656, 10, 12, 6506, 10, 13, 9977, // 9,13 - 9, 13, 9086, 9, 14, 37866, 10, 13, 7224, 10, 14, 11360, // 9,14 - 9, 14, 9635, 9, 15, 35315, 10, 14, 7868, 10, 15, 12718, // 9,15 - 9, -1, 8107, 9, 0, 12867, 10, -1, 9995, 10, 0, 34567, // 10, 0 - 9, 0, 7497, 9, 1, 11575, 10, 0, 9509, 10, 1, 36955, // 10, 1 - 9, 1, 6829, 9, 2, 10279, 10, 1, 8902, 10, 2, 39526, // 10, 2 - 9, 2, 6108, 9, 3, 8982, 10, 2, 8175, 10, 3, 42271, // 10, 3 - 9, 3, 5350, 9, 4, 7698, 10, 3, 7342, 10, 4, 45146, // 10, 4 - 9, 4, 4591, 9, 5, 6475, 10, 4, 6451, 10, 5, 48019, // 10, 5 - 9, 5, 3913, 9, 6, 5418, 10, 5, 5624, 10, 6, 50581, // 10, 6 - 9, 6, 3470, 9, 7, 4721, 10, 6, 5092, 10, 7, 52253, // 10, 7 - 10, 7, 5097, 10, 8, 52266, 11, 7, 3466, 11, 8, 4707, // 10, 8 - 10, 8, 5637, 10, 9, 50587, 11, 8, 3911, 11, 9, 5401, // 10, 9 - 10, 9, 6475, 10, 10, 48019, 11, 9, 4591, 11, 10, 6451, // 10,10 - 10, 10, 7377, 10, 11, 45139, 11, 10, 5353, 11, 11, 7667, // 10,11 - 10, 11, 8224, 10, 12, 42256, 11, 11, 6116, 11, 12, 8940, // 10,12 - 10, 12, 8966, 10, 13, 39503, 11, 12, 6842, 11, 13, 10225, // 10,13 - 10, 13, 9587, 10, 14, 36926, 11, 13, 7517, 11, 14, 11506, // 10,14 - 10, 14, 10086, 10, 15, 34532, 11, 14, 8135, 11, 15, 12783, // 10,15 - 10, -1, 8438, 10, 0, 13007, 11, -1, 10528, 11, 0, 33563, // 11, 0 - 10, 0, 7865, 10, 1, 11810, 11, 0, 10111, 11, 1, 35750, // 11, 1 - 10, 1, 7252, 10, 2, 10630, 11, 1, 9597, 11, 2, 38057, // 11, 2 - 10, 2, 6611, 10, 3, 9478, 11, 2, 8995, 11, 3, 40452, // 11, 3 - 10, 3, 5965, 10, 4, 8378, 11, 3, 8332, 11, 4, 42861, // 11, 4 - 10, 4, 5353, 10, 5, 7377, 11, 4, 7667, 11, 5, 45139, // 11, 5 - 10, 5, 4843, 10, 6, 6558, 11, 5, 7100, 11, 6, 47035, // 11, 6 - 10, 6, 4521, 10, 7, 6023, 11, 6, 6774, 11, 7, 48218, // 11, 7 - 11, 7, 6783, 11, 8, 48240, 12, 7, 4513, 12, 8, 6000, // 11, 8 - 11, 8, 7119, 11, 9, 47049, 12, 8, 4838, 12, 9, 6530, // 11, 9 - 11, 9, 7698, 11, 10, 45146, 12, 9, 5350, 12, 10, 7342, // 11,10 - 11, 10, 8378, 11, 11, 42861, 12, 10, 5965, 12, 11, 8332, // 11,11 - 11, 11, 9056, 11, 12, 40444, 12, 11, 6615, 12, 12, 9421, // 11,12 - 11, 12, 9674, 11, 13, 38042, 12, 12, 7261, 12, 13, 10559, // 11,13 - 11, 13, 10204, 11, 14, 35730, 12, 13, 7881, 12, 14, 11721, // 11,14 - 11, 14, 10635, 11, 15, 33539, 12, 14, 8463, 12, 15, 12899, // 11,15 - 11, -1, 8816, 11, 0, 13171, 12, -1, 11143, 12, 0, 32406, // 12, 0 - 11, 0, 8284, 11, 1, 12074, 12, 0, 10808, 12, 1, 34370, // 12, 1 - 11, 1, 7728, 11, 2, 11012, 12, 1, 10397, 12, 2, 36399, // 12, 2 - 11, 2, 7164, 11, 3, 9998, 12, 2, 9924, 12, 3, 38450, // 12, 3 - 11, 3, 6615, 11, 4, 9056, 12, 3, 9421, 12, 4, 40444, // 12, 4 - 11, 4, 6116, 11, 5, 8224, 12, 4, 8940, 12, 5, 42256, // 12, 5 - 11, 5, 5712, 11, 6, 7556, 12, 5, 8558, 12, 6, 43710, // 12, 6 - 11, 6, 5454, 11, 7, 7106, 12, 6, 8359, 12, 7, 44617, // 12, 7 - 12, 7, 8373, 12, 8, 44649, 13, 7, 5443, 13, 8, 7071, // 12, 8 - 12, 8, 8584, 12, 9, 43733, 13, 8, 5703, 13, 9, 7516, // 12, 9 - 12, 9, 8982, 12, 10, 42271, 13, 9, 6108, 13, 10, 8175, // 12,10 - 12, 10, 9478, 12, 11, 40452, 13, 10, 6611, 13, 11, 8995, // 12,11 - 12, 11, 9998, 12, 12, 38450, 13, 11, 7164, 13, 12, 9924, // 12,12 - 12, 12, 10488, 12, 13, 36392, 13, 12, 7734, 13, 13, 10922, // 12,13 - 12, 13, 10918, 12, 14, 34358, 13, 13, 8296, 13, 14, 11964, // 12,14 - 12, 14, 11269, 12, 15, 32391, 13, 14, 8838, 13, 15, 13038, // 12,15 - 12, -1, 9229, 12, 0, 13332, 13, -1, 11829, 13, 0, 31146, // 13, 0 - 12, 0, 8735, 12, 1, 12334, 13, 0, 11580, 13, 1, 32887, // 13, 1 - 12, 1, 8232, 12, 2, 11382, 13, 1, 11272, 13, 2, 34650, // 13, 2 - 12, 2, 7734, 12, 3, 10488, 13, 2, 10922, 13, 3, 36392, // 13, 3 - 12, 3, 7261, 12, 4, 9674, 13, 3, 10559, 13, 4, 38042, // 13, 4 - 12, 4, 6842, 12, 5, 8966, 13, 4, 10226, 13, 5, 39502, // 13, 5 - 12, 5, 6506, 12, 6, 8397, 13, 5, 9977, 13, 6, 40656, // 13, 6 - 12, 6, 6284, 12, 7, 7996, 13, 6, 9867, 13, 7, 41389, // 13, 7 - 13, 7, 9886, 13, 8, 41432, 14, 7, 6266, 14, 8, 7952, // 13, 8 - 13, 8, 10013, 13, 9, 40688, 14, 8, 6491, 14, 9, 8344, // 13, 9 - 13, 9, 10279, 13, 10, 39526, 14, 9, 6829, 14, 10, 8902, // 13,10 - 13, 10, 10630, 13, 11, 38057, 14, 10, 7252, 14, 11, 9597, // 13,11 - 13, 11, 11012, 13, 12, 36399, 14, 11, 7728, 14, 12, 10397, // 13,12 - 13, 12, 11382, 13, 13, 34650, 14, 12, 8232, 14, 13, 11272, // 13,13 - 13, 13, 11709, 13, 14, 32881, 14, 13, 8742, 14, 14, 12204, // 13,14 - 13, 14, 11977, 13, 15, 31138, 14, 14, 9245, 14, 15, 13176, // 13,15 - 13, -1, 9662, 13, 0, 13470, 14, -1, 12574, 14, 0, 29830, // 14, 0 - 13, 0, 9202, 13, 1, 12564, 14, 0, 12412, 14, 1, 31358, // 14, 1 - 13, 1, 8742, 13, 2, 11709, 14, 1, 12203, 14, 2, 32882, // 14, 2 - 13, 2, 8296, 13, 3, 10918, 14, 2, 11964, 14, 3, 34358, // 14, 3 - 13, 3, 7881, 13, 4, 10204, 14, 3, 11721, 14, 4, 35730, // 14, 4 - 13, 4, 7517, 13, 5, 9587, 14, 4, 11507, 14, 5, 36925, // 14, 5 - 13, 5, 7224, 13, 6, 9086, 14, 5, 11360, 14, 6, 37866, // 14, 6 - 13, 6, 7020, 13, 7, 8718, 14, 6, 11317, 14, 7, 38481, // 14, 7 - 14, 7, 11344, 14, 8, 38534, 15, 7, 6997, 15, 8, 8661, // 14, 8 - 14, 8, 11407, 14, 9, 37906, 15, 8, 7202, 15, 9, 9021, // 14, 9 - 14, 9, 11575, 14, 10, 36955, 15, 9, 7497, 15, 10, 9509, // 14,10 - 14, 10, 11810, 14, 11, 35750, 15, 10, 7865, 15, 11, 10111, // 14,11 - 14, 11, 12074, 14, 12, 34369, 15, 11, 8284, 15, 12, 10809, // 14,12 - 14, 12, 12334, 14, 13, 32886, 15, 12, 8735, 15, 13, 11581, // 14,13 - 14, 13, 12564, 14, 14, 31358, 15, 13, 9202, 15, 14, 12412, // 14,14 - 14, 14, 12746, 14, 15, 29828, 15, 14, 9671, 15, 15, 13291, // 14,15 - 14, -1, 10104, 14, 0, 13569, 15, -1, 13368, 15, 0, 28495, // 15, 0 - 14, 0, 9671, 14, 1, 12746, 15, 0, 13291, 15, 1, 29828, // 15, 1 - 14, 1, 9245, 14, 2, 11977, 15, 1, 13176, 15, 2, 31138, // 15, 2 - 14, 2, 8838, 14, 3, 11269, 15, 2, 13038, 15, 3, 32391, // 15, 3 - 14, 3, 8463, 14, 4, 10635, 15, 3, 12899, 15, 4, 33539, // 15, 4 - 14, 4, 8135, 14, 5, 10086, 15, 4, 12783, 15, 5, 34532, // 15, 5 - 14, 5, 7868, 14, 6, 9635, 15, 5, 12717, 15, 6, 35316, // 15, 6 - 14, 6, 7674, 14, 7, 9290, 15, 6, 12728, 15, 7, 35844, // 15, 7 - 15, 7, 12764, 15, 8, 35905, 16, 7, 7643, 16, 8, 9224, // 15, 8 - 15, 8, 12777, 15, 9, 35362, 16, 8, 7839, 16, 9, 9558, // 15, 9 - 15, 9, 12867, 15, 10, 34567, 16, 9, 8107, 16, 10, 9995, // 15,10 - 15, 10, 13007, 15, 11, 33564, 16, 10, 8438, 16, 11, 10527, // 15,11 - 15, 11, 13171, 15, 12, 32406, 16, 11, 8816, 16, 12, 11143, // 15,12 - 15, 12, 13332, 15, 13, 31146, 16, 12, 9229, 16, 13, 11829, // 15,13 - 15, 13, 13470, 15, 14, 29831, 16, 13, 9662, 16, 14, 12573, // 15,14 - 15, 14, 13569, 15, 15, 28495, 16, 14, 10104, 16, 15, 13368, // 15,15 - // angle of -1.5 degrees - -1, 0, 11440, -1, 1, 8358, 0, 0, 34212, 0, 1, 11526, // 0, 0 - -1, 1, 10780, -1, 2, 7983, 0, 1, 35506, 0, 2, 11267, // 0, 1 - -1, 2, 10158, -1, 3, 7620, 0, 2, 36764, 0, 3, 10994, // 0, 2 - -1, 3, 9585, -1, 4, 7276, 0, 3, 37951, 0, 4, 10724, // 0, 3 - -1, 4, 9072, -1, 5, 6965, 0, 4, 39026, 0, 5, 10473, // 0, 4 - -1, 5, 8632, -1, 6, 6699, 0, 5, 39940, 0, 6, 10265, // 0, 5 - -1, 6, 8278, -1, 7, 6489, 0, 6, 40646, 0, 7, 10123, // 0, 6 - -1, 7, 8018, -1, 8, 6346, 0, 7, 41106, 0, 8, 10066, // 0, 7 - 0, 8, 41072, 0, 9, 10052, 1, 8, 8052, 1, 9, 6360, // 0, 8 - 0, 9, 40618, 0, 10, 10100, 1, 9, 8316, 1, 10, 6502, // 0, 9 - 0, 10, 39918, 0, 11, 10232, 1, 10, 8676, 1, 11, 6710, // 0,10 - 0, 11, 39009, 0, 12, 10430, 1, 11, 9122, 1, 12, 6975, // 0,11 - 0, 12, 37939, 0, 13, 10670, 1, 12, 9642, 1, 13, 7285, // 0,12 - 0, 13, 36756, 0, 14, 10930, 1, 13, 10224, 1, 14, 7626, // 0,13 - 0, 14, 35502, 0, 15, 11192, 1, 14, 10855, 1, 15, 7987, // 0,14 - 0, 15, 34212, 0, 16, 11440, 1, 15, 11526, 1, 16, 8358, // 0,15 - 0, 0, 11192, 0, 1, 7987, 1, 0, 35502, 1, 1, 10855, // 1, 0 - 0, 1, 10467, 0, 2, 7579, 1, 1, 36959, 1, 2, 10531, // 1, 1 - 0, 2, 9777, 0, 3, 7177, 1, 2, 38394, 1, 3, 10188, // 1, 2 - 0, 3, 9135, 0, 4, 6792, 1, 3, 39767, 1, 4, 9842, // 1, 3 - 0, 4, 8557, 0, 5, 6440, 1, 4, 41026, 1, 5, 9513, // 1, 4 - 0, 5, 8061, 0, 6, 6137, 1, 5, 42105, 1, 6, 9233, // 1, 5 - 0, 6, 7667, 0, 7, 5900, 1, 6, 42936, 1, 7, 9033, // 1, 6 - 0, 7, 7390, 0, 8, 5745, 1, 7, 43461, 1, 8, 8940, // 1, 7 - 1, 8, 43433, 1, 9, 8929, 2, 8, 7418, 2, 9, 5756, // 1, 8 - 1, 9, 42913, 1, 10, 9014, 2, 9, 7699, 2, 10, 5910, // 1, 9 - 1, 10, 42087, 1, 11, 9206, 2, 10, 8098, 2, 11, 6145, // 1,10 - 1, 11, 41013, 1, 12, 9478, 2, 11, 8599, 2, 12, 6446, // 1,11 - 1, 12, 39759, 1, 13, 9796, 2, 12, 9184, 2, 13, 6797, // 1,12 - 1, 13, 38390, 1, 14, 10133, 2, 13, 9834, 2, 14, 7179, // 1,13 - 1, 14, 36959, 1, 15, 10467, 2, 14, 10532, 2, 15, 7578, // 1,14 - 1, 15, 35506, 1, 16, 10780, 2, 15, 11267, 2, 16, 7983, // 1,15 - 1, 0, 10930, 1, 1, 7626, 2, 0, 36756, 2, 1, 10224, // 2, 0 - 1, 1, 10133, 1, 2, 7179, 2, 1, 38390, 2, 2, 9834, // 2, 1 - 1, 2, 9366, 1, 3, 6732, 2, 2, 40025, 2, 3, 9413, // 2, 2 - 1, 3, 8641, 1, 4, 6297, 2, 3, 41618, 2, 4, 8980, // 2, 3 - 1, 4, 7981, 1, 5, 5891, 2, 4, 43105, 2, 5, 8559, // 2, 4 - 1, 5, 7411, 1, 6, 5537, 2, 5, 44399, 2, 6, 8189, // 2, 5 - 1, 6, 6961, 1, 7, 5261, 2, 6, 45401, 2, 7, 7913, // 2, 6 - 1, 7, 6658, 1, 8, 5087, 2, 7, 46017, 2, 8, 7774, // 2, 7 - 2, 8, 45995, 2, 9, 7766, 3, 8, 6680, 3, 9, 5095, // 2, 8 - 2, 9, 45383, 2, 10, 7899, 3, 9, 6986, 3, 10, 5268, // 2, 9 - 2, 10, 44386, 2, 11, 8167, 3, 10, 7440, 3, 11, 5543, // 2,10 - 2, 11, 43096, 2, 12, 8530, 3, 11, 8015, 3, 12, 5895, // 2,11 - 2, 12, 41614, 2, 13, 8941, 3, 12, 8681, 3, 13, 6300, // 2,12 - 2, 13, 40025, 2, 14, 9366, 3, 13, 9413, 3, 14, 6732, // 2,13 - 2, 14, 38394, 2, 15, 9777, 3, 14, 10188, 3, 15, 7177, // 2,14 - 2, 15, 36764, 2, 16, 10158, 3, 15, 10994, 3, 16, 7620, // 2,15 - 2, 0, 10670, 2, 1, 7285, 3, 0, 37939, 3, 1, 9642, // 3, 0 - 2, 1, 9796, 2, 2, 6797, 3, 1, 39759, 3, 2, 9184, // 3, 1 - 2, 2, 8941, 2, 3, 6299, 3, 2, 41614, 3, 3, 8682, // 3, 2 - 2, 3, 8120, 2, 4, 5804, 3, 3, 43461, 3, 4, 8151, // 3, 3 - 2, 4, 7356, 2, 5, 5330, 3, 4, 45229, 3, 5, 7621, // 3, 4 - 2, 5, 6685, 2, 6, 4906, 3, 5, 46806, 3, 6, 7139, // 3, 5 - 2, 6, 6154, 2, 7, 4572, 3, 6, 48049, 3, 7, 6761, // 3, 6 - 2, 7, 5811, 2, 8, 4366, 3, 7, 48801, 3, 8, 6558, // 3, 7 - 3, 8, 48785, 3, 9, 6552, 4, 8, 5827, 4, 9, 4372, // 3, 8 - 3, 9, 48037, 3, 10, 6750, 4, 9, 6173, 4, 10, 4576, // 3, 9 - 3, 10, 46798, 3, 11, 7121, 4, 10, 6707, 4, 11, 4910, // 3,10 - 3, 11, 45224, 3, 12, 7598, 4, 11, 7382, 4, 12, 5332, // 3,11 - 3, 12, 43461, 3, 13, 8120, 4, 12, 8151, 4, 13, 5804, // 3,12 - 3, 13, 41618, 3, 14, 8641, 4, 13, 8979, 4, 14, 6298, // 3,13 - 3, 14, 39767, 3, 15, 9135, 4, 14, 9841, 4, 15, 6793, // 3,14 - 3, 15, 37951, 3, 16, 9585, 4, 15, 10723, 4, 16, 7277, // 3,15 - 3, 0, 10430, 3, 1, 6975, 4, 0, 39009, 4, 1, 9122, // 4, 0 - 3, 1, 9478, 3, 2, 6447, 4, 1, 41013, 4, 2, 8598, // 4, 1 - 3, 2, 8530, 3, 3, 5895, 4, 2, 43096, 4, 3, 8015, // 4, 2 - 3, 3, 7598, 3, 4, 5331, 4, 3, 45224, 4, 4, 7383, // 4, 3 - 3, 4, 6708, 3, 5, 4774, 4, 4, 47328, 4, 5, 6726, // 4, 4 - 3, 5, 5901, 3, 6, 4257, 4, 5, 49279, 4, 6, 6099, // 4, 5 - 3, 6, 5248, 3, 7, 3834, 4, 6, 50873, 4, 7, 5581, // 4, 6 - 3, 7, 4835, 3, 8, 3575, 4, 7, 51842, 4, 8, 5284, // 4, 7 - 4, 8, 51832, 4, 9, 5280, 5, 8, 4846, 5, 9, 3578, // 4, 8 - 4, 9, 50865, 4, 10, 5573, 5, 9, 5261, 5, 10, 3837, // 4, 9 - 4, 10, 49275, 4, 11, 6086, 5, 10, 5917, 5, 11, 4258, // 4,10 - 4, 11, 47328, 4, 12, 6708, 5, 11, 6727, 5, 12, 4773, // 4,11 - 4, 12, 45229, 4, 13, 7356, 5, 12, 7622, 5, 13, 5329, // 4,12 - 4, 13, 43105, 4, 14, 7981, 5, 13, 8559, 5, 14, 5891, // 4,13 - 4, 14, 41026, 4, 15, 8557, 5, 14, 9513, 5, 15, 6440, // 4,14 - 4, 15, 39026, 4, 16, 9072, 5, 15, 10473, 5, 16, 6965, // 4,15 - 4, 0, 10232, 4, 1, 6710, 5, 0, 39918, 5, 1, 8676, // 5, 0 - 4, 1, 9206, 4, 2, 6145, 5, 1, 42087, 5, 2, 8098, // 5, 1 - 4, 2, 8167, 4, 3, 5543, 5, 2, 44386, 5, 3, 7440, // 5, 2 - 4, 3, 7121, 4, 4, 4909, 5, 3, 46798, 5, 4, 6708, // 5, 3 - 4, 4, 6086, 4, 5, 4258, 5, 4, 49275, 5, 5, 5917, // 5, 4 - 4, 5, 5103, 4, 6, 3621, 5, 5, 51700, 5, 6, 5112, // 5, 5 - 4, 6, 4262, 4, 7, 3064, 5, 6, 53816, 5, 7, 4394, // 5, 6 - 4, 7, 3720, 4, 8, 2708, 5, 7, 55168, 5, 8, 3940, // 5, 7 - 5, 8, 55162, 5, 9, 3938, 6, 8, 3726, 6, 9, 2710, // 5, 8 - 5, 9, 53813, 5, 10, 4388, 6, 9, 4269, 6, 10, 3066, // 5, 9 - 5, 10, 51700, 5, 11, 5103, 6, 10, 5113, 6, 11, 3620, // 5,10 - 5, 11, 49279, 5, 12, 5901, 6, 11, 6099, 6, 12, 4257, // 5,11 - 5, 12, 46806, 5, 13, 6685, 6, 12, 7138, 6, 13, 4907, // 5,12 - 5, 13, 44399, 5, 14, 7411, 6, 13, 8189, 6, 14, 5537, // 5,13 - 5, 14, 42105, 5, 15, 8061, 6, 14, 9233, 6, 15, 6137, // 5,14 - 5, 15, 39940, 5, 16, 8632, 6, 15, 10265, 6, 16, 6699, // 5,15 - 5, 0, 10100, 5, 1, 6502, 6, 0, 40618, 6, 1, 8316, // 6, 0 - 5, 1, 9014, 5, 2, 5910, 6, 1, 42913, 6, 2, 7699, // 6, 1 - 5, 2, 7899, 5, 3, 5268, 6, 2, 45383, 6, 3, 6986, // 6, 2 - 5, 3, 6750, 5, 4, 4576, 6, 3, 48037, 6, 4, 6173, // 6, 3 - 5, 4, 5573, 5, 5, 3837, 6, 4, 50865, 6, 5, 5261, // 6, 4 - 5, 5, 4388, 5, 6, 3065, 6, 5, 53813, 6, 6, 4270, // 6, 5 - 5, 6, 3271, 5, 7, 2316, 6, 6, 56673, 6, 7, 3276, // 6, 6 - 5, 7, 2462, 5, 8, 1766, 6, 7, 58775, 6, 8, 2533, // 6, 7 - 6, 8, 58773, 6, 9, 2532, 7, 8, 2464, 7, 9, 1767, // 6, 8 - 6, 9, 56673, 6, 10, 3271, 7, 9, 3275, 7, 10, 2317, // 6, 9 - 6, 10, 53816, 6, 11, 4262, 7, 10, 4394, 7, 11, 3064, // 6,10 - 6, 11, 50873, 6, 12, 5248, 7, 11, 5581, 7, 12, 3834, // 6,11 - 6, 12, 48049, 6, 13, 6154, 7, 12, 6761, 7, 13, 4572, // 6,12 - 6, 13, 45401, 6, 14, 6961, 7, 13, 7913, 7, 14, 5261, // 6,13 - 6, 14, 42936, 6, 15, 7667, 7, 14, 9032, 7, 15, 5901, // 6,14 - 6, 15, 40646, 6, 16, 8278, 7, 15, 10123, 7, 16, 6489, // 6,15 - 6, 0, 10052, 6, 1, 6360, 7, 0, 41072, 7, 1, 8052, // 7, 0 - 6, 1, 8929, 6, 2, 5756, 7, 1, 43433, 7, 2, 7418, // 7, 1 - 6, 2, 7766, 6, 3, 5095, 7, 2, 45995, 7, 3, 6680, // 7, 2 - 6, 3, 6552, 6, 4, 4372, 7, 3, 48785, 7, 4, 5827, // 7, 3 - 6, 4, 5280, 6, 5, 3579, 7, 4, 51832, 7, 5, 4845, // 7, 4 - 6, 5, 3938, 6, 6, 2710, 7, 5, 55162, 7, 6, 3726, // 7, 5 - 6, 6, 2532, 6, 7, 1767, 7, 6, 58773, 7, 7, 2464, // 7, 6 - 6, 7, 1170, 6, 8, 827, 7, 7, 62369, 7, 8, 1170, // 7, 7 - 7, 8, 62369, 7, 9, 1170, 8, 8, 1170, 8, 9, 827, // 7, 8 - 7, 9, 58775, 7, 10, 2462, 8, 9, 2533, 8, 10, 1766, // 7, 9 - 7, 10, 55168, 7, 11, 3720, 8, 10, 3940, 8, 11, 2708, // 7,10 - 7, 11, 51842, 7, 12, 4835, 8, 11, 5283, 8, 12, 3576, // 7,11 - 7, 12, 48801, 7, 13, 5811, 8, 12, 6558, 8, 13, 4366, // 7,12 - 7, 13, 46017, 7, 14, 6658, 8, 13, 7773, 8, 14, 5088, // 7,13 - 7, 14, 43461, 7, 15, 7390, 8, 14, 8939, 8, 15, 5746, // 7,14 - 7, 15, 41106, 7, 16, 8018, 8, 15, 10066, 8, 16, 6346, // 7,15 - 7, -1, 6346, 7, 0, 10066, 8, -1, 8018, 8, 0, 41106, // 8, 0 - 7, 0, 5745, 7, 1, 8939, 8, 0, 7390, 8, 1, 43462, // 8, 1 - 7, 1, 5087, 7, 2, 7773, 8, 1, 6658, 8, 2, 46018, // 8, 2 - 7, 2, 4366, 7, 3, 6558, 8, 2, 5811, 8, 3, 48801, // 8, 3 - 7, 3, 3575, 7, 4, 5283, 8, 3, 4835, 8, 4, 51843, // 8, 4 - 7, 4, 2708, 7, 5, 3940, 8, 4, 3720, 8, 5, 55168, // 8, 5 - 7, 5, 1766, 7, 6, 2533, 8, 5, 2462, 8, 6, 58775, // 8, 6 - 7, 6, 827, 7, 7, 1170, 8, 6, 1170, 8, 7, 62369, // 8, 7 - 8, 7, 1170, 8, 8, 62369, 9, 7, 827, 9, 8, 1170, // 8, 8 - 8, 8, 2464, 8, 9, 58773, 9, 8, 1767, 9, 9, 2532, // 8, 9 - 8, 9, 3726, 8, 10, 55162, 9, 9, 2710, 9, 10, 3938, // 8,10 - 8, 10, 4846, 8, 11, 51832, 9, 10, 3579, 9, 11, 5279, // 8,11 - 8, 11, 5827, 8, 12, 48785, 9, 11, 4372, 9, 12, 6552, // 8,12 - 8, 12, 6680, 8, 13, 45995, 9, 12, 5095, 9, 13, 7766, // 8,13 - 8, 13, 7418, 8, 14, 43433, 9, 13, 5756, 9, 14, 8929, // 8,14 - 8, 14, 8052, 8, 15, 41072, 9, 14, 6360, 9, 15, 10052, // 8,15 - 8, -1, 6489, 8, 0, 10123, 9, -1, 8278, 9, 0, 40646, // 9, 0 - 8, 0, 5900, 8, 1, 9032, 9, 0, 7667, 9, 1, 42937, // 9, 1 - 8, 1, 5261, 8, 2, 7913, 9, 1, 6961, 9, 2, 45401, // 9, 2 - 8, 2, 4572, 8, 3, 6761, 9, 2, 6154, 9, 3, 48049, // 9, 3 - 8, 3, 3834, 8, 4, 5581, 9, 3, 5248, 9, 4, 50873, // 9, 4 - 8, 4, 3064, 8, 5, 4394, 9, 4, 4262, 9, 5, 53816, // 9, 5 - 8, 5, 2316, 8, 6, 3275, 9, 5, 3271, 9, 6, 56674, // 9, 6 - 8, 6, 1767, 8, 7, 2464, 9, 6, 2532, 9, 7, 58773, // 9, 7 - 9, 7, 2533, 9, 8, 58775, 10, 7, 1766, 10, 8, 2462, // 9, 8 - 9, 8, 3275, 9, 9, 56673, 10, 8, 2316, 10, 9, 3272, // 9, 9 - 9, 9, 4269, 9, 10, 53813, 10, 9, 3065, 10, 10, 4389, // 9,10 - 9, 10, 5261, 9, 11, 50865, 10, 10, 3837, 10, 11, 5573, // 9,11 - 9, 11, 6173, 9, 12, 48037, 10, 11, 4576, 10, 12, 6750, // 9,12 - 9, 12, 6986, 9, 13, 45383, 10, 12, 5268, 10, 13, 7899, // 9,13 - 9, 13, 7699, 9, 14, 42913, 10, 13, 5910, 10, 14, 9014, // 9,14 - 9, 14, 8316, 9, 15, 40618, 10, 14, 6502, 10, 15, 10100, // 9,15 - 9, -1, 6699, 9, 0, 10265, 10, -1, 8632, 10, 0, 39940, // 10, 0 - 9, 0, 6137, 9, 1, 9233, 10, 0, 8061, 10, 1, 42105, // 10, 1 - 9, 1, 5537, 9, 2, 8189, 10, 1, 7411, 10, 2, 44399, // 10, 2 - 9, 2, 4906, 9, 3, 7138, 10, 2, 6685, 10, 3, 46807, // 10, 3 - 9, 3, 4257, 9, 4, 6099, 10, 3, 5901, 10, 4, 49279, // 10, 4 - 9, 4, 3621, 9, 5, 5113, 10, 4, 5103, 10, 5, 51699, // 10, 5 - 9, 5, 3065, 9, 6, 4269, 10, 5, 4388, 10, 6, 53814, // 10, 6 - 9, 6, 2710, 9, 7, 3726, 10, 6, 3938, 10, 7, 55162, // 10, 7 - 10, 7, 3940, 10, 8, 55168, 11, 7, 2708, 11, 8, 3720, // 10, 8 - 10, 8, 4394, 10, 9, 53816, 11, 8, 3064, 11, 9, 4262, // 10, 9 - 10, 9, 5113, 10, 10, 51700, 11, 9, 3621, 11, 10, 5102, // 10,10 - 10, 10, 5917, 10, 11, 49275, 11, 10, 4258, 11, 11, 6086, // 10,11 - 10, 11, 6707, 10, 12, 46798, 11, 11, 4909, 11, 12, 7122, // 10,12 - 10, 12, 7440, 10, 13, 44386, 11, 12, 5543, 11, 13, 8167, // 10,13 - 10, 13, 8098, 10, 14, 42087, 11, 13, 6145, 11, 14, 9206, // 10,14 - 10, 14, 8676, 10, 15, 39918, 11, 14, 6710, 11, 15, 10232, // 10,15 - 10, -1, 6965, 10, 0, 10473, 11, -1, 9072, 11, 0, 39026, // 11, 0 - 10, 0, 6440, 10, 1, 9513, 11, 0, 8557, 11, 1, 41026, // 11, 1 - 10, 1, 5891, 10, 2, 8559, 11, 1, 7981, 11, 2, 43105, // 11, 2 - 10, 2, 5330, 10, 3, 7622, 11, 2, 7356, 11, 3, 45228, // 11, 3 - 10, 3, 4774, 10, 4, 6727, 11, 3, 6708, 11, 4, 47327, // 11, 4 - 10, 4, 4258, 10, 5, 5917, 11, 4, 6086, 11, 5, 49275, // 11, 5 - 10, 5, 3837, 10, 6, 5261, 11, 5, 5573, 11, 6, 50865, // 11, 6 - 10, 6, 3579, 10, 7, 4846, 11, 6, 5280, 11, 7, 51831, // 11, 7 - 11, 7, 5283, 11, 8, 51842, 12, 7, 3575, 12, 8, 4836, // 11, 8 - 11, 8, 5581, 11, 9, 50873, 12, 8, 3834, 12, 9, 5248, // 11, 9 - 11, 9, 6099, 11, 10, 49279, 12, 9, 4257, 12, 10, 5901, // 11,10 - 11, 10, 6727, 11, 11, 47328, 12, 10, 4774, 12, 11, 6707, // 11,11 - 11, 11, 7382, 11, 12, 45224, 12, 11, 5331, 12, 12, 7599, // 11,12 - 11, 12, 8015, 11, 13, 43096, 12, 12, 5895, 12, 13, 8530, // 11,13 - 11, 13, 8599, 11, 14, 41013, 12, 13, 6447, 12, 14, 9477, // 11,14 - 11, 14, 9122, 11, 15, 39009, 12, 14, 6975, 12, 15, 10430, // 11,15 - 11, -1, 7276, 11, 0, 10723, 12, -1, 9585, 12, 0, 37952, // 12, 0 - 11, 0, 6792, 11, 1, 9841, 12, 0, 9135, 12, 1, 39768, // 12, 1 - 11, 1, 6297, 11, 2, 8979, 12, 1, 8641, 12, 2, 41619, // 12, 2 - 11, 2, 5804, 11, 3, 8151, 12, 2, 8120, 12, 3, 43461, // 12, 3 - 11, 3, 5331, 11, 4, 7382, 12, 3, 7598, 12, 4, 45225, // 12, 4 - 11, 4, 4909, 11, 5, 6707, 12, 4, 7121, 12, 5, 46799, // 12, 5 - 11, 5, 4576, 11, 6, 6173, 12, 5, 6750, 12, 6, 48037, // 12, 6 - 11, 6, 4372, 11, 7, 5827, 12, 6, 6552, 12, 7, 48785, // 12, 7 - 12, 7, 6558, 12, 8, 48801, 13, 7, 4366, 13, 8, 5811, // 12, 8 - 12, 8, 6761, 12, 9, 48049, 13, 8, 4572, 13, 9, 6154, // 12, 9 - 12, 9, 7138, 12, 10, 46806, 13, 9, 4906, 13, 10, 6686, // 12,10 - 12, 10, 7622, 12, 11, 45229, 13, 10, 5330, 13, 11, 7355, // 12,11 - 12, 11, 8151, 12, 12, 43461, 13, 11, 5804, 13, 12, 8120, // 12,12 - 12, 12, 8681, 12, 13, 41614, 13, 12, 6299, 13, 13, 8942, // 12,13 - 12, 13, 9184, 12, 14, 39759, 13, 13, 6797, 13, 14, 9796, // 12,14 - 12, 14, 9642, 12, 15, 37939, 13, 14, 7285, 13, 15, 10670, // 12,15 - 12, -1, 7620, 12, 0, 10994, 13, -1, 10158, 13, 0, 36764, // 13, 0 - 12, 0, 7177, 12, 1, 10188, 13, 0, 9777, 13, 1, 38394, // 13, 1 - 12, 1, 6732, 12, 2, 9413, 13, 1, 9366, 13, 2, 40025, // 13, 2 - 12, 2, 6299, 12, 3, 8681, 13, 2, 8941, 13, 3, 41615, // 13, 3 - 12, 3, 5895, 12, 4, 8015, 13, 3, 8530, 13, 4, 43096, // 13, 4 - 12, 4, 5543, 12, 5, 7440, 13, 4, 8167, 13, 5, 44386, // 13, 5 - 12, 5, 5268, 12, 6, 6986, 13, 5, 7899, 13, 6, 45383, // 13, 6 - 12, 6, 5095, 12, 7, 6680, 13, 6, 7766, 13, 7, 45995, // 13, 7 - 13, 7, 7773, 13, 8, 46017, 14, 7, 5087, 14, 8, 6659, // 13, 8 - 13, 8, 7913, 13, 9, 45401, 14, 8, 5261, 14, 9, 6961, // 13, 9 - 13, 9, 8189, 13, 10, 44399, 14, 9, 5537, 14, 10, 7411, // 13,10 - 13, 10, 8559, 13, 11, 43105, 14, 10, 5891, 14, 11, 7981, // 13,11 - 13, 11, 8979, 13, 12, 41618, 14, 11, 6297, 14, 12, 8642, // 13,12 - 13, 12, 9413, 13, 13, 40025, 14, 12, 6732, 14, 13, 9366, // 13,13 - 13, 13, 9834, 13, 14, 38390, 14, 13, 7179, 14, 14, 10133, // 13,14 - 13, 14, 10224, 13, 15, 36756, 14, 14, 7626, 14, 15, 10930, // 13,15 - 13, -1, 7983, 13, 0, 11267, 14, -1, 10780, 14, 0, 35506, // 14, 0 - 13, 0, 7579, 13, 1, 10532, 14, 0, 10467, 14, 1, 36958, // 14, 1 - 13, 1, 7179, 13, 2, 9834, 14, 1, 10133, 14, 2, 38390, // 14, 2 - 13, 2, 6797, 13, 3, 9184, 14, 2, 9796, 14, 3, 39759, // 14, 3 - 13, 3, 6447, 13, 4, 8599, 14, 3, 9478, 14, 4, 41012, // 14, 4 - 13, 4, 6145, 13, 5, 8098, 14, 4, 9206, 14, 5, 42087, // 14, 5 - 13, 5, 5910, 13, 6, 7699, 14, 5, 9014, 14, 6, 42913, // 14, 6 - 13, 6, 5756, 13, 7, 7418, 14, 6, 8929, 14, 7, 43433, // 14, 7 - 14, 7, 8939, 14, 8, 43461, 15, 7, 5745, 15, 8, 7391, // 14, 8 - 14, 8, 9032, 14, 9, 42936, 15, 8, 5900, 15, 9, 7668, // 14, 9 - 14, 9, 9233, 14, 10, 42105, 15, 9, 6137, 15, 10, 8061, // 14,10 - 14, 10, 9513, 14, 11, 41026, 15, 10, 6440, 15, 11, 8557, // 14,11 - 14, 11, 9841, 14, 12, 39767, 15, 11, 6792, 15, 12, 9136, // 14,12 - 14, 12, 10188, 14, 13, 38394, 15, 12, 7177, 15, 13, 9777, // 14,13 - 14, 13, 10532, 14, 14, 36959, 15, 13, 7579, 15, 14, 10466, // 14,14 - 14, 14, 10855, 14, 15, 35502, 15, 14, 7987, 15, 15, 11192, // 14,15 - 14, -1, 8358, 14, 0, 11526, 15, -1, 11440, 15, 0, 34212, // 15, 0 - 14, 0, 7987, 14, 1, 10855, 15, 0, 11192, 15, 1, 35502, // 15, 1 - 14, 1, 7626, 14, 2, 10224, 15, 1, 10930, 15, 2, 36756, // 15, 2 - 14, 2, 7285, 14, 3, 9642, 15, 2, 10670, 15, 3, 37939, // 15, 3 - 14, 3, 6975, 14, 4, 9122, 15, 3, 10430, 15, 4, 39009, // 15, 4 - 14, 4, 6710, 14, 5, 8676, 15, 4, 10232, 15, 5, 39918, // 15, 5 - 14, 5, 6502, 14, 6, 8316, 15, 5, 10100, 15, 6, 40618, // 15, 6 - 14, 6, 6360, 14, 7, 8052, 15, 6, 10052, 15, 7, 41072, // 15, 7 - 15, 7, 10066, 15, 8, 41106, 16, 7, 6346, 16, 8, 8018, // 15, 8 - 15, 8, 10123, 15, 9, 40646, 16, 8, 6489, 16, 9, 8278, // 15, 9 - 15, 9, 10265, 15, 10, 39940, 16, 9, 6699, 16, 10, 8632, // 15,10 - 15, 10, 10473, 15, 11, 39026, 16, 10, 6965, 16, 11, 9072, // 15,11 - 15, 11, 10723, 15, 12, 37951, 16, 11, 7276, 16, 12, 9586, // 15,12 - 15, 12, 10994, 15, 13, 36764, 16, 12, 7620, 16, 13, 10158, // 15,13 - 15, 13, 11267, 15, 14, 35506, 16, 13, 7983, 16, 14, 10780, // 15,14 - 15, 14, 11526, 15, 15, 34212, 16, 14, 8358, 16, 15, 11440, // 15,15 - // angle of -1.0 degrees - -1, 0, 8769, -1, 1, 6280, 0, 0, 41693, 0, 1, 8794, // 0, 0 - -1, 1, 8265, -1, 2, 5974, 0, 1, 42823, 0, 2, 8474, // 0, 1 - -1, 2, 7791, -1, 3, 5682, 0, 2, 43904, 0, 3, 8159, // 0, 2 - -1, 3, 7356, -1, 4, 5410, 0, 3, 44907, 0, 4, 7863, // 0, 3 - -1, 4, 6970, -1, 5, 5169, 0, 4, 45799, 0, 5, 7598, // 0, 4 - -1, 5, 6644, -1, 6, 4967, 0, 5, 46541, 0, 6, 7384, // 0, 5 - -1, 6, 6391, -1, 7, 4814, 0, 6, 47098, 0, 7, 7233, // 0, 6 - -1, 7, 6217, -1, 8, 4718, 0, 7, 47440, 0, 8, 7161, // 0, 7 - 0, 8, 47426, 0, 9, 7158, 1, 8, 6230, 1, 9, 4722, // 0, 8 - 0, 9, 47086, 0, 10, 7227, 1, 9, 6405, 1, 10, 4818, // 0, 9 - 0, 10, 46532, 0, 11, 7374, 1, 10, 6659, 1, 11, 4971, // 0,10 - 0, 11, 45791, 0, 12, 7587, 1, 11, 6986, 1, 12, 5172, // 0,11 - 0, 12, 44901, 0, 13, 7848, 1, 12, 7374, 1, 13, 5413, // 0,12 - 0, 13, 43900, 0, 14, 8141, 1, 13, 7812, 1, 14, 5683, // 0,13 - 0, 14, 42821, 0, 15, 8452, 1, 14, 8288, 1, 15, 5975, // 0,14 - 0, 15, 41693, 0, 16, 8769, 1, 15, 8795, 1, 16, 6279, // 0,15 - 0, 0, 8452, 0, 1, 5975, 1, 0, 42821, 1, 1, 8288, // 1, 0 - 0, 1, 7901, 0, 2, 5640, 1, 1, 44074, 1, 2, 7921, // 1, 1 - 0, 2, 7378, 0, 3, 5315, 1, 2, 45288, 1, 3, 7555, // 1, 2 - 0, 3, 6892, 0, 4, 5009, 1, 3, 46430, 1, 4, 7205, // 1, 3 - 0, 4, 6458, 0, 5, 4734, 1, 4, 47458, 1, 5, 6886, // 1, 4 - 0, 5, 6092, 0, 6, 4502, 1, 5, 48322, 1, 6, 6620, // 1, 5 - 0, 6, 5809, 0, 7, 4327, 1, 6, 48969, 1, 7, 6431, // 1, 6 - 0, 7, 5623, 0, 8, 4221, 1, 7, 49358, 1, 8, 6334, // 1, 7 - 1, 8, 49347, 1, 9, 6332, 2, 8, 5633, 2, 9, 4224, // 1, 8 - 1, 9, 48960, 1, 10, 6425, 2, 9, 5820, 2, 10, 4331, // 1, 9 - 1, 10, 48314, 1, 11, 6613, 2, 10, 6104, 2, 11, 4505, // 1,10 - 1, 11, 47453, 1, 12, 6875, 2, 11, 6472, 2, 12, 4736, // 1,11 - 1, 12, 46427, 1, 13, 7191, 2, 12, 6908, 2, 13, 5010, // 1,12 - 1, 13, 45286, 1, 14, 7539, 2, 13, 7395, 2, 14, 5316, // 1,13 - 1, 14, 44074, 1, 15, 7901, 2, 14, 7921, 2, 15, 5640, // 1,14 - 1, 15, 42823, 1, 16, 8265, 2, 15, 8474, 2, 16, 5974, // 1,15 - 1, 0, 8141, 1, 1, 5684, 2, 0, 43900, 2, 1, 7811, // 2, 0 - 1, 1, 7539, 1, 2, 5316, 2, 1, 45286, 2, 2, 7395, // 2, 1 - 1, 2, 6959, 1, 3, 4954, 2, 2, 46650, 2, 3, 6973, // 2, 2 - 1, 3, 6414, 1, 4, 4607, 2, 3, 47955, 2, 4, 6560, // 2, 3 - 1, 4, 5920, 1, 5, 4290, 2, 4, 49150, 2, 5, 6176, // 2, 4 - 1, 5, 5499, 1, 6, 4019, 2, 5, 50171, 2, 6, 5847, // 2, 5 - 1, 6, 5175, 1, 7, 3813, 2, 6, 50942, 2, 7, 5606, // 2, 6 - 1, 7, 4970, 1, 8, 3691, 2, 7, 51395, 2, 8, 5480, // 2, 7 - 2, 8, 51387, 2, 9, 5478, 3, 8, 4978, 3, 9, 3693, // 2, 8 - 2, 9, 50935, 2, 10, 5602, 3, 9, 5184, 3, 10, 3815, // 2, 9 - 2, 10, 50165, 2, 11, 5842, 3, 10, 5508, 3, 11, 4021, // 2,10 - 2, 11, 49147, 2, 12, 6168, 3, 11, 5930, 3, 12, 4291, // 2,11 - 2, 12, 47953, 2, 13, 6549, 3, 12, 6426, 3, 13, 4608, // 2,12 - 2, 13, 46650, 2, 14, 6959, 3, 13, 6973, 3, 14, 4954, // 2,13 - 2, 14, 45288, 2, 15, 7378, 3, 14, 7555, 3, 15, 5315, // 2,14 - 2, 15, 43904, 2, 16, 7791, 3, 15, 8159, 3, 16, 5682, // 2,15 - 2, 0, 7848, 2, 1, 5413, 3, 0, 44901, 3, 1, 7374, // 3, 0 - 2, 1, 7191, 2, 2, 5011, 3, 1, 46427, 3, 2, 6907, // 3, 1 - 2, 2, 6549, 2, 3, 4608, 3, 2, 47953, 3, 3, 6426, // 3, 2 - 2, 3, 5934, 2, 4, 4214, 3, 3, 49445, 3, 4, 5943, // 3, 3 - 2, 4, 5365, 2, 5, 3845, 3, 4, 50844, 3, 5, 5482, // 3, 4 - 2, 5, 4872, 2, 6, 3522, 3, 5, 52069, 3, 6, 5073, // 3, 5 - 2, 6, 4489, 2, 7, 3273, 3, 6, 53012, 3, 7, 4762, // 3, 6 - 2, 7, 4254, 2, 8, 3126, 3, 7, 53562, 3, 8, 4594, // 3, 7 - 3, 8, 53557, 3, 9, 4592, 4, 8, 4259, 4, 9, 3128, // 3, 8 - 3, 9, 53008, 3, 10, 4759, 4, 9, 4495, 4, 10, 3274, // 3, 9 - 3, 10, 52066, 3, 11, 5069, 4, 10, 4879, 4, 11, 3522, // 3,10 - 3, 11, 50843, 3, 12, 5474, 4, 11, 5373, 4, 12, 3846, // 3,11 - 3, 12, 49445, 3, 13, 5934, 4, 12, 5943, 4, 13, 4214, // 3,12 - 3, 13, 47955, 3, 14, 6414, 4, 13, 6560, 4, 14, 4607, // 3,13 - 3, 14, 46430, 3, 15, 6892, 4, 14, 7204, 4, 15, 5010, // 3,14 - 3, 15, 44907, 3, 16, 7356, 4, 15, 7863, 4, 16, 5410, // 3,15 - 3, 0, 7587, 3, 1, 5172, 4, 0, 45791, 4, 1, 6986, // 4, 0 - 3, 1, 6875, 3, 2, 4736, 4, 1, 47453, 4, 2, 6472, // 4, 1 - 3, 2, 6168, 3, 3, 4291, 4, 2, 49147, 4, 3, 5930, // 4, 2 - 3, 3, 5474, 3, 4, 3846, 4, 3, 50843, 4, 4, 5373, // 4, 3 - 3, 4, 4816, 3, 5, 3415, 4, 4, 52484, 4, 5, 4821, // 4, 4 - 3, 5, 4226, 3, 6, 3023, 4, 5, 53975, 4, 6, 4312, // 4, 5 - 3, 6, 3755, 3, 7, 2710, 4, 6, 55166, 4, 7, 3905, // 4, 6 - 3, 7, 3469, 3, 8, 2524, 4, 7, 55870, 4, 8, 3673, // 4, 7 - 4, 8, 55867, 4, 9, 3671, 5, 8, 3473, 5, 9, 2525, // 4, 8 - 4, 9, 55164, 4, 10, 3902, 5, 9, 3759, 5, 10, 2711, // 4, 9 - 4, 10, 53973, 4, 11, 4309, 5, 10, 4230, 5, 11, 3024, // 4,10 - 4, 11, 52484, 4, 12, 4816, 5, 11, 4822, 5, 12, 3414, // 4,11 - 4, 12, 50844, 4, 13, 5365, 5, 12, 5481, 5, 13, 3846, // 4,12 - 4, 13, 49150, 4, 14, 5920, 5, 13, 6176, 5, 14, 4290, // 4,13 - 4, 14, 47458, 4, 15, 6458, 5, 14, 6886, 5, 15, 4734, // 4,14 - 4, 15, 45799, 4, 16, 6970, 5, 15, 7599, 5, 16, 5168, // 4,15 - 4, 0, 7374, 4, 1, 4971, 5, 0, 46532, 5, 1, 6659, // 5, 0 - 4, 1, 6613, 4, 2, 4505, 5, 1, 48314, 5, 2, 6104, // 5, 1 - 4, 2, 5842, 4, 3, 4020, 5, 2, 50165, 5, 3, 5509, // 5, 2 - 4, 3, 5069, 4, 4, 3523, 5, 3, 52066, 5, 4, 4878, // 5, 3 - 4, 4, 4309, 4, 5, 3023, 5, 4, 53973, 5, 5, 4231, // 5, 4 - 4, 5, 3595, 4, 6, 2546, 5, 5, 55798, 5, 6, 3597, // 5, 5 - 4, 6, 2993, 4, 7, 2138, 5, 6, 57354, 5, 7, 3051, // 5, 6 - 4, 7, 2615, 4, 8, 1884, 5, 7, 58324, 5, 8, 2713, // 5, 7 - 5, 8, 58322, 5, 9, 2713, 6, 8, 2616, 6, 9, 1885, // 5, 8 - 5, 9, 57353, 5, 10, 3050, 6, 9, 2995, 6, 10, 2138, // 5, 9 - 5, 10, 55798, 5, 11, 3595, 6, 10, 3598, 6, 11, 2545, // 5,10 - 5, 11, 53975, 5, 12, 4226, 6, 11, 4313, 6, 12, 3022, // 5,11 - 5, 12, 52069, 5, 13, 4872, 6, 12, 5073, 6, 13, 3522, // 5,12 - 5, 13, 50171, 5, 14, 5499, 6, 13, 5848, 6, 14, 4018, // 5,13 - 5, 14, 48322, 5, 15, 6092, 6, 14, 6620, 6, 15, 4502, // 5,14 - 5, 15, 46541, 5, 16, 6644, 6, 15, 7383, 6, 16, 4968, // 5,15 - 5, 0, 7227, 5, 1, 4818, 6, 0, 47086, 6, 1, 6405, // 6, 0 - 5, 1, 6425, 5, 2, 4330, 6, 1, 48960, 6, 2, 5821, // 6, 1 - 5, 2, 5602, 5, 3, 3815, 6, 2, 50935, 6, 3, 5184, // 6, 2 - 5, 3, 4759, 5, 4, 3274, 6, 3, 53008, 6, 4, 4495, // 6, 3 - 5, 4, 3902, 5, 5, 2711, 6, 4, 55164, 6, 5, 3759, // 6, 4 - 5, 5, 3050, 5, 6, 2138, 6, 5, 57353, 6, 6, 2995, // 6, 5 - 5, 6, 2258, 5, 7, 1597, 6, 6, 59422, 6, 7, 2259, // 6, 6 - 5, 7, 1695, 5, 8, 1209, 6, 7, 60906, 6, 8, 1726, // 6, 7 - 6, 8, 60905, 6, 9, 1726, 7, 8, 1695, 7, 9, 1210, // 6, 8 - 6, 9, 59422, 6, 10, 2258, 7, 9, 2259, 7, 10, 1597, // 6, 9 - 6, 10, 57354, 6, 11, 2993, 7, 10, 3051, 7, 11, 2138, // 6,10 - 6, 11, 55166, 6, 12, 3755, 7, 11, 3904, 7, 12, 2711, // 6,11 - 6, 12, 53012, 6, 13, 4489, 7, 12, 4762, 7, 13, 3273, // 6,12 - 6, 13, 50942, 6, 14, 5175, 7, 13, 5606, 7, 14, 3813, // 6,13 - 6, 14, 48969, 6, 15, 5809, 7, 14, 6430, 7, 15, 4328, // 6,14 - 6, 15, 47098, 6, 16, 6391, 7, 15, 7233, 7, 16, 4814, // 6,15 - 6, 0, 7158, 6, 1, 4722, 7, 0, 47426, 7, 1, 6230, // 7, 0 - 6, 1, 6332, 6, 2, 4224, 7, 1, 49347, 7, 2, 5633, // 7, 1 - 6, 2, 5478, 6, 3, 3693, 7, 2, 51387, 7, 3, 4978, // 7, 2 - 6, 3, 4592, 6, 4, 3128, 7, 3, 53557, 7, 4, 4259, // 7, 3 - 6, 4, 3671, 6, 5, 2525, 7, 4, 55867, 7, 5, 3473, // 7, 4 - 6, 5, 2713, 6, 6, 1884, 7, 5, 58322, 7, 6, 2617, // 7, 5 - 6, 6, 1726, 6, 7, 1210, 7, 6, 60905, 7, 7, 1695, // 7, 6 - 6, 7, 789, 6, 8, 558, 7, 7, 63399, 7, 8, 790, // 7, 7 - 7, 8, 63399, 7, 9, 789, 8, 8, 789, 8, 9, 559, // 7, 8 - 7, 9, 60906, 7, 10, 1695, 8, 9, 1726, 8, 10, 1209, // 7, 9 - 7, 10, 58324, 7, 11, 2615, 8, 10, 2714, 8, 11, 1883, // 7,10 - 7, 11, 55870, 7, 12, 3469, 8, 11, 3672, 8, 12, 2525, // 7,11 - 7, 12, 53562, 7, 13, 4254, 8, 12, 4594, 8, 13, 3126, // 7,12 - 7, 13, 51395, 7, 14, 4970, 8, 13, 5480, 8, 14, 3691, // 7,13 - 7, 14, 49358, 7, 15, 5623, 8, 14, 6335, 8, 15, 4220, // 7,14 - 7, 15, 47440, 7, 16, 6217, 8, 15, 7161, 8, 16, 4718, // 7,15 - 7, -1, 4718, 7, 0, 7161, 8, -1, 6217, 8, 0, 47440, // 8, 0 - 7, 0, 4221, 7, 1, 6335, 8, 0, 5623, 8, 1, 49357, // 8, 1 - 7, 1, 3691, 7, 2, 5480, 8, 1, 4970, 8, 2, 51395, // 8, 2 - 7, 2, 3126, 7, 3, 4594, 8, 2, 4254, 8, 3, 53562, // 8, 3 - 7, 3, 2524, 7, 4, 3672, 8, 3, 3469, 8, 4, 55871, // 8, 4 - 7, 4, 1884, 7, 5, 2714, 8, 4, 2615, 8, 5, 58323, // 8, 5 - 7, 5, 1209, 7, 6, 1726, 8, 5, 1695, 8, 6, 60906, // 8, 6 - 7, 6, 558, 7, 7, 789, 8, 6, 789, 8, 7, 63400, // 8, 7 - 8, 7, 789, 8, 8, 63399, 9, 7, 558, 9, 8, 790, // 8, 8 - 8, 8, 1695, 8, 9, 60905, 9, 8, 1210, 9, 9, 1726, // 8, 9 - 8, 9, 2616, 8, 10, 58322, 9, 9, 1884, 9, 10, 2714, // 8,10 - 8, 10, 3473, 8, 11, 55867, 9, 10, 2525, 9, 11, 3671, // 8,11 - 8, 11, 4259, 8, 12, 53557, 9, 11, 3128, 9, 12, 4592, // 8,12 - 8, 12, 4978, 8, 13, 51387, 9, 12, 3693, 9, 13, 5478, // 8,13 - 8, 13, 5633, 8, 14, 49347, 9, 13, 4224, 9, 14, 6332, // 8,14 - 8, 14, 6230, 8, 15, 47426, 9, 14, 4722, 9, 15, 7158, // 8,15 - 8, -1, 4814, 8, 0, 7233, 9, -1, 6391, 9, 0, 47098, // 9, 0 - 8, 0, 4327, 8, 1, 6430, 9, 0, 5809, 9, 1, 48970, // 9, 1 - 8, 1, 3813, 8, 2, 5606, 9, 1, 5175, 9, 2, 50942, // 9, 2 - 8, 2, 3273, 8, 3, 4762, 9, 2, 4489, 9, 3, 53012, // 9, 3 - 8, 3, 2710, 8, 4, 3904, 9, 3, 3755, 9, 4, 55167, // 9, 4 - 8, 4, 2138, 8, 5, 3051, 9, 4, 2993, 9, 5, 57354, // 9, 5 - 8, 5, 1597, 8, 6, 2259, 9, 5, 2258, 9, 6, 59422, // 9, 6 - 8, 6, 1210, 8, 7, 1695, 9, 6, 1726, 9, 7, 60905, // 9, 7 - 9, 7, 1726, 9, 8, 60906, 10, 7, 1209, 10, 8, 1695, // 9, 8 - 9, 8, 2259, 9, 9, 59422, 10, 8, 1597, 10, 9, 2258, // 9, 9 - 9, 9, 2995, 9, 10, 57353, 10, 9, 2138, 10, 10, 3050, // 9,10 - 9, 10, 3759, 9, 11, 55164, 10, 10, 2711, 10, 11, 3902, // 9,11 - 9, 11, 4495, 9, 12, 53008, 10, 11, 3274, 10, 12, 4759, // 9,12 - 9, 12, 5184, 9, 13, 50935, 10, 12, 3815, 10, 13, 5602, // 9,13 - 9, 13, 5820, 9, 14, 48960, 10, 13, 4330, 10, 14, 6426, // 9,14 - 9, 14, 6405, 9, 15, 47086, 10, 14, 4818, 10, 15, 7227, // 9,15 - 9, -1, 4967, 9, 0, 7383, 10, -1, 6644, 10, 0, 46542, // 10, 0 - 9, 0, 4502, 9, 1, 6620, 10, 0, 6092, 10, 1, 48322, // 10, 1 - 9, 1, 4019, 9, 2, 5848, 10, 1, 5499, 10, 2, 50170, // 10, 2 - 9, 2, 3522, 9, 3, 5073, 10, 2, 4872, 10, 3, 52069, // 10, 3 - 9, 3, 3023, 9, 4, 4313, 10, 3, 4226, 10, 4, 53974, // 10, 4 - 9, 4, 2546, 9, 5, 3598, 10, 4, 3595, 10, 5, 55797, // 10, 5 - 9, 5, 2138, 9, 6, 2995, 10, 5, 3050, 10, 6, 57353, // 10, 6 - 9, 6, 1884, 9, 7, 2616, 10, 6, 2713, 10, 7, 58323, // 10, 7 - 10, 7, 2714, 10, 8, 58324, 11, 7, 1884, 11, 8, 2614, // 10, 8 - 10, 8, 3051, 10, 9, 57354, 11, 8, 2138, 11, 9, 2993, // 10, 9 - 10, 9, 3598, 10, 10, 55798, 11, 9, 2546, 11, 10, 3594, // 10,10 - 10, 10, 4230, 10, 11, 53973, 11, 10, 3023, 11, 11, 4310, // 10,11 - 10, 11, 4879, 10, 12, 52066, 11, 11, 3523, 11, 12, 5068, // 10,12 - 10, 12, 5508, 10, 13, 50165, 11, 12, 4020, 11, 13, 5843, // 10,13 - 10, 13, 6104, 10, 14, 48314, 11, 13, 4505, 11, 14, 6613, // 10,14 - 10, 14, 6659, 10, 15, 46532, 11, 14, 4971, 11, 15, 7374, // 10,15 - 10, -1, 5169, 10, 0, 7599, 11, -1, 6970, 11, 0, 45798, // 11, 0 - 10, 0, 4734, 10, 1, 6886, 11, 0, 6458, 11, 1, 47458, // 11, 1 - 10, 1, 4290, 10, 2, 6176, 11, 1, 5920, 11, 2, 49150, // 11, 2 - 10, 2, 3845, 10, 3, 5481, 11, 2, 5365, 11, 3, 50845, // 11, 3 - 10, 3, 3415, 10, 4, 4822, 11, 3, 4816, 11, 4, 52483, // 11, 4 - 10, 4, 3023, 10, 5, 4230, 11, 4, 4309, 11, 5, 53974, // 11, 5 - 10, 5, 2711, 10, 6, 3759, 11, 5, 3902, 11, 6, 55164, // 11, 6 - 10, 6, 2525, 10, 7, 3473, 11, 6, 3671, 11, 7, 55867, // 11, 7 - 11, 7, 3672, 11, 8, 55870, 12, 7, 2524, 12, 8, 3470, // 11, 8 - 11, 8, 3904, 11, 9, 55166, 12, 8, 2710, 12, 9, 3756, // 11, 9 - 11, 9, 4313, 11, 10, 53975, 12, 9, 3023, 12, 10, 4225, // 11,10 - 11, 10, 4822, 11, 11, 52484, 12, 10, 3415, 12, 11, 4815, // 11,11 - 11, 11, 5373, 11, 12, 50843, 12, 11, 3846, 12, 12, 5474, // 11,12 - 11, 12, 5930, 11, 13, 49147, 12, 12, 4291, 12, 13, 6168, // 11,13 - 11, 13, 6472, 11, 14, 47453, 12, 13, 4736, 12, 14, 6875, // 11,14 - 11, 14, 6986, 11, 15, 45791, 12, 14, 5172, 12, 15, 7587, // 11,15 - 11, -1, 5410, 11, 0, 7863, 12, -1, 7356, 12, 0, 44907, // 12, 0 - 11, 0, 5009, 11, 1, 7204, 12, 0, 6892, 12, 1, 46431, // 12, 1 - 11, 1, 4607, 11, 2, 6560, 12, 1, 6414, 12, 2, 47955, // 12, 2 - 11, 2, 4214, 11, 3, 5943, 12, 2, 5934, 12, 3, 49445, // 12, 3 - 11, 3, 3846, 11, 4, 5373, 12, 3, 5474, 12, 4, 50843, // 12, 4 - 11, 4, 3523, 11, 5, 4879, 12, 4, 5069, 12, 5, 52065, // 12, 5 - 11, 5, 3274, 11, 6, 4495, 12, 5, 4759, 12, 6, 53008, // 12, 6 - 11, 6, 3128, 11, 7, 4259, 12, 6, 4592, 12, 7, 53557, // 12, 7 - 12, 7, 4594, 12, 8, 53562, 13, 7, 3126, 13, 8, 4254, // 12, 8 - 12, 8, 4762, 12, 9, 53012, 13, 8, 3273, 13, 9, 4489, // 12, 9 - 12, 9, 5073, 12, 10, 52069, 13, 9, 3522, 13, 10, 4872, // 12,10 - 12, 10, 5481, 12, 11, 50844, 13, 10, 3845, 13, 11, 5366, // 12,11 - 12, 11, 5943, 12, 12, 49445, 13, 11, 4214, 13, 12, 5934, // 12,12 - 12, 12, 6426, 12, 13, 47953, 13, 12, 4608, 13, 13, 6549, // 12,13 - 12, 13, 6908, 12, 14, 46427, 13, 13, 5011, 13, 14, 7190, // 12,14 - 12, 14, 7374, 12, 15, 44901, 13, 14, 5413, 13, 15, 7848, // 12,15 - 12, -1, 5682, 12, 0, 8159, 13, -1, 7791, 13, 0, 43904, // 13, 0 - 12, 0, 5315, 12, 1, 7555, 13, 0, 7378, 13, 1, 45288, // 13, 1 - 12, 1, 4954, 12, 2, 6973, 13, 1, 6959, 13, 2, 46650, // 13, 2 - 12, 2, 4608, 12, 3, 6426, 13, 2, 6549, 13, 3, 47953, // 13, 3 - 12, 3, 4291, 12, 4, 5930, 13, 3, 6168, 13, 4, 49147, // 13, 4 - 12, 4, 4020, 12, 5, 5508, 13, 4, 5842, 13, 5, 50166, // 13, 5 - 12, 5, 3815, 12, 6, 5184, 13, 5, 5602, 13, 6, 50935, // 13, 6 - 12, 6, 3693, 12, 7, 4978, 13, 6, 5478, 13, 7, 51387, // 13, 7 - 13, 7, 5480, 13, 8, 51395, 14, 7, 3691, 14, 8, 4970, // 13, 8 - 13, 8, 5606, 13, 9, 50942, 14, 8, 3813, 14, 9, 5175, // 13, 9 - 13, 9, 5848, 13, 10, 50171, 14, 9, 4019, 14, 10, 5498, // 13,10 - 13, 10, 6176, 13, 11, 49150, 14, 10, 4290, 14, 11, 5920, // 13,11 - 13, 11, 6560, 13, 12, 47955, 14, 11, 4607, 14, 12, 6414, // 13,12 - 13, 12, 6973, 13, 13, 46650, 14, 12, 4954, 14, 13, 6959, // 13,13 - 13, 13, 7395, 13, 14, 45286, 14, 13, 5316, 14, 14, 7539, // 13,14 - 13, 14, 7812, 13, 15, 43900, 14, 14, 5684, 14, 15, 8140, // 13,15 - 13, -1, 5974, 13, 0, 8474, 14, -1, 8265, 14, 0, 42823, // 14, 0 - 13, 0, 5640, 13, 1, 7921, 14, 0, 7901, 14, 1, 44074, // 14, 1 - 13, 1, 5316, 13, 2, 7395, 14, 1, 7539, 14, 2, 45286, // 14, 2 - 13, 2, 5011, 13, 3, 6908, 14, 2, 7191, 14, 3, 46426, // 14, 3 - 13, 3, 4736, 13, 4, 6472, 14, 3, 6875, 14, 4, 47453, // 14, 4 - 13, 4, 4505, 13, 5, 6104, 14, 4, 6613, 14, 5, 48314, // 14, 5 - 13, 5, 4330, 13, 6, 5820, 14, 5, 6425, 14, 6, 48961, // 14, 6 - 13, 6, 4224, 13, 7, 5633, 14, 6, 6332, 14, 7, 49347, // 14, 7 - 14, 7, 6335, 14, 8, 49358, 15, 7, 4221, 15, 8, 5622, // 14, 8 - 14, 8, 6430, 14, 9, 48969, 15, 8, 4327, 15, 9, 5810, // 14, 9 - 14, 9, 6620, 14, 10, 48322, 15, 9, 4502, 15, 10, 6092, // 14,10 - 14, 10, 6886, 14, 11, 47458, 15, 10, 4734, 15, 11, 6458, // 14,11 - 14, 11, 7204, 14, 12, 46430, 15, 11, 5009, 15, 12, 6893, // 14,12 - 14, 12, 7555, 14, 13, 45288, 15, 12, 5315, 15, 13, 7378, // 14,13 - 14, 13, 7921, 14, 14, 44074, 15, 13, 5640, 15, 14, 7901, // 14,14 - 14, 14, 8288, 14, 15, 42821, 15, 14, 5975, 15, 15, 8452, // 14,15 - 14, -1, 6280, 14, 0, 8795, 15, -1, 8769, 15, 0, 41692, // 15, 0 - 14, 0, 5975, 14, 1, 8288, 15, 0, 8452, 15, 1, 42821, // 15, 1 - 14, 1, 5684, 14, 2, 7812, 15, 1, 8141, 15, 2, 43899, // 15, 2 - 14, 2, 5413, 14, 3, 7374, 15, 2, 7848, 15, 3, 44901, // 15, 3 - 14, 3, 5172, 14, 4, 6986, 15, 3, 7587, 15, 4, 45791, // 15, 4 - 14, 4, 4971, 14, 5, 6659, 15, 4, 7374, 15, 5, 46532, // 15, 5 - 14, 5, 4818, 14, 6, 6405, 15, 5, 7227, 15, 6, 47086, // 15, 6 - 14, 6, 4722, 14, 7, 6230, 15, 6, 7158, 15, 7, 47426, // 15, 7 - 15, 7, 7161, 15, 8, 47440, 16, 7, 4718, 16, 8, 6217, // 15, 8 - 15, 8, 7233, 15, 9, 47098, 16, 8, 4814, 16, 9, 6391, // 15, 9 - 15, 9, 7383, 15, 10, 46541, 16, 9, 4967, 16, 10, 6645, // 15,10 - 15, 10, 7599, 15, 11, 45799, 16, 10, 5169, 16, 11, 6969, // 15,11 - 15, 11, 7863, 15, 12, 44907, 16, 11, 5410, 16, 12, 7356, // 15,12 - 15, 12, 8159, 15, 13, 43904, 16, 12, 5682, 16, 13, 7791, // 15,13 - 15, 13, 8474, 15, 14, 42823, 16, 13, 5974, 16, 14, 8265, // 15,14 - 15, 14, 8795, 15, 15, 41693, 16, 14, 6280, 16, 15, 8768, // 15,15 - // angle of -0.5 degrees - -1, 0, 5106, -1, 1, 3621, 0, 0, 51699, 0, 1, 5110, // 0, 0 - -1, 1, 4803, -1, 2, 3421, 0, 1, 52457, 0, 2, 4855, // 0, 1 - -1, 2, 4521, -1, 3, 3235, 0, 2, 53168, 0, 3, 4612, // 0, 2 - -1, 3, 4264, -1, 4, 3064, 0, 3, 53815, 0, 4, 4393, // 0, 3 - -1, 4, 4041, -1, 5, 2916, 0, 4, 54378, 0, 5, 4201, // 0, 4 - -1, 5, 3858, -1, 6, 2796, 0, 5, 54835, 0, 6, 4047, // 0, 5 - -1, 6, 3722, -1, 7, 2709, 0, 6, 55166, 0, 7, 3939, // 0, 6 - -1, 7, 3638, -1, 8, 2659, 0, 7, 55354, 0, 8, 3885, // 0, 7 - 0, 8, 55352, 0, 9, 3885, 1, 8, 3640, 1, 9, 2659, // 0, 8 - 0, 9, 55164, 0, 10, 3939, 1, 9, 3724, 1, 10, 2709, // 0, 9 - 0, 10, 54833, 0, 11, 4046, 1, 10, 3860, 1, 11, 2797, // 0,10 - 0, 11, 54376, 0, 12, 4200, 1, 11, 4043, 1, 12, 2917, // 0,11 - 0, 12, 53814, 0, 13, 4390, 1, 12, 4267, 1, 13, 3065, // 0,12 - 0, 13, 53168, 0, 14, 4610, 1, 13, 4523, 1, 14, 3235, // 0,13 - 0, 14, 52457, 0, 15, 4851, 1, 14, 4806, 1, 15, 3422, // 0,14 - 0, 15, 51699, 0, 16, 5106, 1, 15, 5110, 1, 16, 3621, // 0,15 - 0, 0, 4851, 0, 1, 3422, 1, 0, 52457, 1, 1, 4806, // 1, 0 - 0, 1, 4522, 0, 2, 3204, 1, 1, 53285, 1, 2, 4525, // 1, 1 - 0, 2, 4212, 0, 3, 2998, 1, 2, 54072, 1, 3, 4254, // 1, 2 - 0, 3, 3927, 0, 4, 2808, 1, 3, 54796, 1, 4, 4005, // 1, 3 - 0, 4, 3677, 0, 5, 2640, 1, 4, 55435, 1, 5, 3784, // 1, 4 - 0, 5, 3470, 0, 6, 2502, 1, 5, 55959, 1, 6, 3605, // 1, 5 - 0, 6, 3317, 0, 7, 2402, 1, 6, 56340, 1, 7, 3477, // 1, 6 - 0, 7, 3225, 0, 8, 2346, 1, 7, 56554, 1, 8, 3411, // 1, 7 - 1, 8, 56552, 1, 9, 3411, 2, 8, 3227, 2, 9, 2346, // 1, 8 - 1, 9, 56339, 1, 10, 3476, 2, 9, 3319, 2, 10, 2402, // 1, 9 - 1, 10, 55958, 1, 11, 3604, 2, 10, 3472, 2, 11, 2502, // 1,10 - 1, 11, 55434, 1, 12, 3783, 2, 11, 3678, 2, 12, 2641, // 1,11 - 1, 12, 54796, 1, 13, 4003, 2, 12, 3929, 2, 13, 2808, // 1,12 - 1, 13, 54071, 1, 14, 4253, 2, 13, 4214, 2, 14, 2998, // 1,13 - 1, 14, 53285, 1, 15, 4522, 2, 14, 4525, 2, 15, 3204, // 1,14 - 1, 15, 52457, 1, 16, 4803, 2, 15, 4854, 2, 16, 3422, // 1,15 - 1, 0, 4610, 1, 1, 3235, 2, 0, 53168, 2, 1, 4523, // 2, 0 - 1, 1, 4253, 1, 2, 2998, 2, 1, 54071, 2, 2, 4214, // 2, 1 - 1, 2, 3911, 1, 3, 2770, 2, 2, 54941, 2, 3, 3914, // 2, 2 - 1, 3, 3594, 1, 4, 2556, 2, 3, 55756, 2, 4, 3630, // 2, 3 - 1, 4, 3310, 1, 5, 2365, 2, 4, 56487, 2, 5, 3374, // 2, 4 - 1, 5, 3073, 1, 6, 2205, 2, 5, 57096, 2, 6, 3162, // 2, 5 - 1, 6, 2897, 1, 7, 2088, 2, 6, 57545, 2, 7, 3006, // 2, 6 - 1, 7, 2794, 1, 8, 2022, 2, 7, 57795, 2, 8, 2925, // 2, 7 - 2, 8, 57793, 2, 9, 2926, 3, 8, 2795, 3, 9, 2022, // 2, 8 - 2, 9, 57544, 2, 10, 3007, 3, 9, 2898, 3, 10, 2087, // 2, 9 - 2, 10, 57095, 2, 11, 3161, 3, 10, 3074, 3, 11, 2206, // 2,10 - 2, 11, 56486, 2, 12, 3373, 3, 11, 3311, 3, 12, 2366, // 2,11 - 2, 12, 55756, 2, 13, 3628, 3, 12, 3595, 3, 13, 2557, // 2,12 - 2, 13, 54941, 2, 14, 3911, 3, 13, 3913, 3, 14, 2771, // 2,13 - 2, 14, 54072, 2, 15, 4212, 3, 14, 4255, 3, 15, 2997, // 2,14 - 2, 15, 53168, 2, 16, 4521, 3, 15, 4612, 3, 16, 3235, // 2,15 - 2, 0, 4390, 2, 1, 3065, 3, 0, 53814, 3, 1, 4267, // 3, 0 - 2, 1, 4003, 2, 2, 2808, 3, 1, 54796, 3, 2, 3929, // 3, 1 - 2, 2, 3628, 2, 3, 2557, 3, 2, 55756, 3, 3, 3595, // 3, 2 - 2, 3, 3273, 2, 4, 2317, 3, 3, 56673, 3, 4, 3273, // 3, 3 - 2, 4, 2948, 2, 5, 2096, 3, 4, 57514, 3, 5, 2978, // 3, 4 - 2, 5, 2672, 2, 6, 1908, 3, 5, 58234, 3, 6, 2722, // 3, 5 - 2, 6, 2463, 2, 7, 1766, 3, 6, 58775, 3, 7, 2532, // 3, 6 - 2, 7, 2342, 2, 8, 1687, 3, 7, 59077, 3, 8, 2430, // 3, 7 - 3, 8, 59076, 3, 9, 2430, 4, 8, 2343, 4, 9, 1687, // 3, 8 - 3, 9, 58774, 3, 10, 2532, 4, 9, 2464, 4, 10, 1766, // 3, 9 - 3, 10, 58233, 3, 11, 2722, 4, 10, 2673, 4, 11, 1908, // 3,10 - 3, 11, 57514, 3, 12, 2976, 4, 11, 2950, 4, 12, 2096, // 3,11 - 3, 12, 56673, 3, 13, 3273, 4, 12, 3274, 4, 13, 2316, // 3,12 - 3, 13, 55756, 3, 14, 3594, 4, 13, 3630, 4, 14, 2556, // 3,13 - 3, 14, 54796, 3, 15, 3927, 4, 14, 4005, 4, 15, 2808, // 3,14 - 3, 15, 53815, 3, 16, 4264, 4, 15, 4392, 4, 16, 3065, // 3,15 - 3, 0, 4200, 3, 1, 2917, 4, 0, 54376, 4, 1, 4043, // 4, 0 - 3, 1, 3783, 3, 2, 2640, 4, 1, 55434, 4, 2, 3679, // 4, 1 - 3, 2, 3373, 3, 3, 2365, 4, 2, 56486, 4, 3, 3312, // 4, 2 - 3, 3, 2976, 3, 4, 2096, 4, 3, 57514, 4, 4, 2950, // 4, 3 - 3, 4, 2604, 3, 5, 1843, 4, 4, 58484, 4, 5, 2605, // 4, 4 - 3, 5, 2276, 3, 6, 1617, 4, 5, 59346, 4, 6, 2297, // 4, 5 - 3, 6, 2020, 3, 7, 1442, 4, 6, 60018, 4, 7, 2056, // 4, 6 - 3, 7, 1871, 3, 8, 1341, 4, 7, 60402, 4, 8, 1922, // 4, 7 - 4, 8, 60402, 4, 9, 1922, 5, 8, 1871, 5, 9, 1341, // 4, 8 - 4, 9, 60017, 4, 10, 2057, 5, 9, 2020, 5, 10, 1442, // 4, 9 - 4, 10, 59345, 4, 11, 2297, 5, 10, 2276, 5, 11, 1618, // 4,10 - 4, 11, 58484, 4, 12, 2604, 5, 11, 2605, 5, 12, 1843, // 4,11 - 4, 12, 57514, 4, 13, 2948, 5, 12, 2977, 5, 13, 2097, // 4,12 - 4, 13, 56487, 4, 14, 3310, 5, 13, 3374, 5, 14, 2365, // 4,13 - 4, 14, 55435, 4, 15, 3677, 5, 14, 3785, 5, 15, 2639, // 4,14 - 4, 15, 54378, 4, 16, 4041, 5, 15, 4201, 5, 16, 2916, // 4,15 - 4, 0, 4046, 4, 1, 2797, 5, 0, 54833, 5, 1, 3860, // 5, 0 - 4, 1, 3604, 4, 2, 2503, 5, 1, 55958, 5, 2, 3471, // 5, 1 - 4, 2, 3161, 4, 3, 2205, 5, 2, 57095, 5, 3, 3075, // 5, 2 - 4, 3, 2722, 4, 4, 1908, 5, 3, 58233, 5, 4, 2673, // 5, 3 - 4, 4, 2297, 4, 5, 1617, 5, 4, 59345, 5, 5, 2277, // 5, 4 - 4, 5, 1904, 4, 6, 1347, 5, 5, 60381, 5, 6, 1904, // 5, 5 - 4, 6, 1578, 4, 7, 1121, 5, 6, 61243, 5, 7, 1594, // 5, 6 - 4, 7, 1380, 4, 8, 985, 5, 7, 61767, 5, 8, 1404, // 5, 7 - 5, 8, 61767, 5, 9, 1405, 6, 8, 1380, 6, 9, 984, // 5, 8 - 5, 9, 61243, 5, 10, 1593, 6, 9, 1579, 6, 10, 1121, // 5, 9 - 5, 10, 60381, 5, 11, 1904, 6, 10, 1904, 6, 11, 1347, // 5,10 - 5, 11, 59346, 5, 12, 2276, 6, 11, 2297, 6, 12, 1617, // 5,11 - 5, 12, 58234, 5, 13, 2672, 6, 12, 2723, 6, 13, 1907, // 5,12 - 5, 13, 57096, 5, 14, 3073, 6, 13, 3161, 6, 14, 2206, // 5,13 - 5, 14, 55959, 5, 15, 3470, 6, 14, 3605, 6, 15, 2502, // 5,14 - 5, 15, 54835, 5, 16, 3858, 6, 15, 4047, 6, 16, 2796, // 5,15 - 5, 0, 3939, 5, 1, 2709, 6, 0, 55164, 6, 1, 3724, // 6, 0 - 5, 1, 3476, 5, 2, 2403, 6, 1, 56339, 6, 2, 3318, // 6, 1 - 5, 2, 3007, 5, 3, 2088, 6, 2, 57544, 6, 3, 2897, // 6, 2 - 5, 3, 2532, 5, 4, 1767, 6, 3, 58774, 6, 4, 2463, // 6, 3 - 5, 4, 2057, 5, 5, 1442, 6, 4, 60017, 6, 5, 2020, // 6, 4 - 5, 5, 1593, 5, 6, 1121, 6, 5, 61243, 6, 6, 1579, // 6, 5 - 5, 6, 1170, 5, 7, 827, 6, 6, 62369, 6, 7, 1170, // 6, 6 - 5, 7, 875, 5, 8, 622, 6, 7, 63156, 6, 8, 883, // 6, 7 - 6, 8, 63156, 6, 9, 883, 7, 8, 875, 7, 9, 622, // 6, 8 - 6, 9, 62369, 6, 10, 1170, 7, 9, 1170, 7, 10, 827, // 6, 9 - 6, 10, 61243, 6, 11, 1578, 7, 10, 1593, 7, 11, 1122, // 6,10 - 6, 11, 60018, 6, 12, 2020, 7, 11, 2057, 7, 12, 1441, // 6,11 - 6, 12, 58775, 6, 13, 2463, 7, 12, 2532, 7, 13, 1766, // 6,12 - 6, 13, 57545, 6, 14, 2897, 7, 13, 3007, 7, 14, 2087, // 6,13 - 6, 14, 56340, 6, 15, 3317, 7, 14, 3477, 7, 15, 2402, // 6,14 - 6, 15, 55166, 6, 16, 3722, 7, 15, 3940, 7, 16, 2708, // 6,15 - 6, 0, 3885, 6, 1, 2659, 7, 0, 55352, 7, 1, 3640, // 7, 0 - 6, 1, 3411, 6, 2, 2346, 7, 1, 56552, 7, 2, 3227, // 7, 1 - 6, 2, 2926, 6, 3, 2022, 7, 2, 57793, 7, 3, 2795, // 7, 2 - 6, 3, 2430, 6, 4, 1687, 7, 3, 59076, 7, 4, 2343, // 7, 3 - 6, 4, 1922, 6, 5, 1341, 7, 4, 60402, 7, 5, 1871, // 7, 4 - 6, 5, 1405, 6, 6, 985, 7, 5, 61767, 7, 6, 1379, // 7, 5 - 6, 6, 883, 6, 7, 622, 7, 6, 63156, 7, 7, 875, // 7, 6 - 6, 7, 399, 6, 8, 282, 7, 7, 64455, 7, 8, 400, // 7, 7 - 7, 8, 64455, 7, 9, 399, 8, 8, 399, 8, 9, 283, // 7, 8 - 7, 9, 63156, 7, 10, 875, 8, 9, 883, 8, 10, 622, // 7, 9 - 7, 10, 61767, 7, 11, 1380, 8, 10, 1405, 8, 11, 984, // 7,10 - 7, 11, 60402, 7, 12, 1871, 8, 11, 1922, 8, 12, 1341, // 7,11 - 7, 12, 59077, 7, 13, 2342, 8, 12, 2430, 8, 13, 1687, // 7,12 - 7, 13, 57795, 7, 14, 2794, 8, 13, 2926, 8, 14, 2021, // 7,13 - 7, 14, 56554, 7, 15, 3225, 8, 14, 3411, 8, 15, 2346, // 7,14 - 7, 15, 55354, 7, 16, 3638, 8, 15, 3885, 8, 16, 2659, // 7,15 - 7, -1, 2659, 7, 0, 3885, 8, -1, 3638, 8, 0, 55354, // 8, 0 - 7, 0, 2346, 7, 1, 3411, 8, 0, 3225, 8, 1, 56554, // 8, 1 - 7, 1, 2022, 7, 2, 2926, 8, 1, 2794, 8, 2, 57794, // 8, 2 - 7, 2, 1687, 7, 3, 2430, 8, 2, 2342, 8, 3, 59077, // 8, 3 - 7, 3, 1341, 7, 4, 1922, 8, 3, 1871, 8, 4, 60402, // 8, 4 - 7, 4, 985, 7, 5, 1405, 8, 4, 1380, 8, 5, 61766, // 8, 5 - 7, 5, 622, 7, 6, 883, 8, 5, 875, 8, 6, 63156, // 8, 6 - 7, 6, 282, 7, 7, 399, 8, 6, 399, 8, 7, 64456, // 8, 7 - 8, 7, 399, 8, 8, 64455, 9, 7, 282, 9, 8, 400, // 8, 8 - 8, 8, 875, 8, 9, 63156, 9, 8, 622, 9, 9, 883, // 8, 9 - 8, 9, 1380, 8, 10, 61767, 9, 9, 985, 9, 10, 1404, // 8,10 - 8, 10, 1871, 8, 11, 60402, 9, 10, 1341, 9, 11, 1922, // 8,11 - 8, 11, 2343, 8, 12, 59076, 9, 11, 1687, 9, 12, 2430, // 8,12 - 8, 12, 2795, 8, 13, 57793, 9, 12, 2022, 9, 13, 2926, // 8,13 - 8, 13, 3227, 8, 14, 56552, 9, 13, 2346, 9, 14, 3411, // 8,14 - 8, 14, 3640, 8, 15, 55352, 9, 14, 2659, 9, 15, 3885, // 8,15 - 8, -1, 2709, 8, 0, 3940, 9, -1, 3722, 9, 0, 55165, // 9, 0 - 8, 0, 2402, 8, 1, 3477, 9, 0, 3317, 9, 1, 56340, // 9, 1 - 8, 1, 2088, 8, 2, 3007, 9, 1, 2897, 9, 2, 57544, // 9, 2 - 8, 2, 1766, 8, 3, 2532, 9, 2, 2463, 9, 3, 58775, // 9, 3 - 8, 3, 1442, 8, 4, 2057, 9, 3, 2020, 9, 4, 60017, // 9, 4 - 8, 4, 1121, 8, 5, 1593, 9, 4, 1578, 9, 5, 61244, // 9, 5 - 8, 5, 827, 8, 6, 1170, 9, 5, 1170, 9, 6, 62369, // 9, 6 - 8, 6, 622, 8, 7, 875, 9, 6, 883, 9, 7, 63156, // 9, 7 - 9, 7, 883, 9, 8, 63156, 10, 7, 622, 10, 8, 875, // 9, 8 - 9, 8, 1170, 9, 9, 62369, 10, 8, 827, 10, 9, 1170, // 9, 9 - 9, 9, 1579, 9, 10, 61243, 10, 9, 1121, 10, 10, 1593, // 9,10 - 9, 10, 2020, 9, 11, 60017, 10, 10, 1442, 10, 11, 2057, // 9,11 - 9, 11, 2464, 9, 12, 58774, 10, 11, 1767, 10, 12, 2531, // 9,12 - 9, 12, 2898, 9, 13, 57544, 10, 12, 2088, 10, 13, 3006, // 9,13 - 9, 13, 3319, 9, 14, 56339, 10, 13, 2403, 10, 14, 3475, // 9,14 - 9, 14, 3724, 9, 15, 55164, 10, 14, 2709, 10, 15, 3939, // 9,15 - 9, -1, 2796, 9, 0, 4047, 10, -1, 3858, 10, 0, 54835, // 10, 0 - 9, 0, 2502, 9, 1, 3605, 10, 0, 3470, 10, 1, 55959, // 10, 1 - 9, 1, 2205, 9, 2, 3161, 10, 1, 3073, 10, 2, 57097, // 10, 2 - 9, 2, 1908, 9, 3, 2723, 10, 2, 2672, 10, 3, 58233, // 10, 3 - 9, 3, 1617, 9, 4, 2297, 10, 3, 2276, 10, 4, 59346, // 10, 4 - 9, 4, 1347, 9, 5, 1904, 10, 4, 1904, 10, 5, 60381, // 10, 5 - 9, 5, 1121, 9, 6, 1579, 10, 5, 1593, 10, 6, 61243, // 10, 6 - 9, 6, 985, 9, 7, 1380, 10, 6, 1405, 10, 7, 61766, // 10, 7 - 10, 7, 1405, 10, 8, 61767, 11, 7, 985, 11, 8, 1379, // 10, 8 - 10, 8, 1593, 10, 9, 61243, 11, 8, 1121, 11, 9, 1579, // 10, 9 - 10, 9, 1904, 10, 10, 60381, 11, 9, 1347, 11, 10, 1904, // 10,10 - 10, 10, 2276, 10, 11, 59345, 11, 10, 1617, 11, 11, 2298, // 10,11 - 10, 11, 2673, 10, 12, 58233, 11, 11, 1908, 11, 12, 2722, // 10,12 - 10, 12, 3074, 10, 13, 57095, 11, 12, 2205, 11, 13, 3162, // 10,13 - 10, 13, 3472, 10, 14, 55958, 11, 13, 2503, 11, 14, 3603, // 10,14 - 10, 14, 3860, 10, 15, 54833, 11, 14, 2797, 11, 15, 4046, // 10,15 - 10, -1, 2916, 10, 0, 4201, 11, -1, 4041, 11, 0, 54378, // 11, 0 - 10, 0, 2640, 10, 1, 3785, 11, 0, 3677, 11, 1, 55434, // 11, 1 - 10, 1, 2365, 10, 2, 3374, 11, 1, 3310, 11, 2, 56487, // 11, 2 - 10, 2, 2096, 10, 3, 2977, 11, 2, 2948, 11, 3, 57515, // 11, 3 - 10, 3, 1843, 10, 4, 2605, 11, 3, 2604, 11, 4, 58484, // 11, 4 - 10, 4, 1617, 10, 5, 2276, 11, 4, 2297, 11, 5, 59346, // 11, 5 - 10, 5, 1442, 10, 6, 2020, 11, 5, 2057, 11, 6, 60017, // 11, 6 - 10, 6, 1341, 10, 7, 1871, 11, 6, 1922, 11, 7, 60402, // 11, 7 - 11, 7, 1922, 11, 8, 60402, 12, 7, 1341, 12, 8, 1871, // 11, 8 - 11, 8, 2057, 11, 9, 60018, 12, 8, 1442, 12, 9, 2019, // 11, 9 - 11, 9, 2297, 11, 10, 59346, 12, 9, 1617, 12, 10, 2276, // 11,10 - 11, 10, 2605, 11, 11, 58484, 12, 10, 1843, 12, 11, 2604, // 11,11 - 11, 11, 2950, 11, 12, 57514, 12, 11, 2096, 12, 12, 2976, // 11,12 - 11, 12, 3311, 11, 13, 56486, 12, 12, 2365, 12, 13, 3374, // 11,13 - 11, 13, 3678, 11, 14, 55434, 12, 13, 2640, 12, 14, 3784, // 11,14 - 11, 14, 4043, 11, 15, 54376, 12, 14, 2917, 12, 15, 4200, // 11,15 - 11, -1, 3064, 11, 0, 4392, 12, -1, 4264, 12, 0, 53816, // 12, 0 - 11, 0, 2808, 11, 1, 4005, 12, 0, 3927, 12, 1, 54796, // 12, 1 - 11, 1, 2556, 11, 2, 3630, 12, 1, 3594, 12, 2, 55756, // 12, 2 - 11, 2, 2317, 11, 3, 3274, 12, 2, 3273, 12, 3, 56672, // 12, 3 - 11, 3, 2096, 11, 4, 2950, 12, 3, 2976, 12, 4, 57514, // 12, 4 - 11, 4, 1908, 11, 5, 2673, 12, 4, 2722, 12, 5, 58233, // 12, 5 - 11, 5, 1767, 11, 6, 2464, 12, 5, 2532, 12, 6, 58773, // 12, 6 - 11, 6, 1687, 11, 7, 2343, 12, 6, 2430, 12, 7, 59076, // 12, 7 - 12, 7, 2430, 12, 8, 59077, 13, 7, 1687, 13, 8, 2342, // 12, 8 - 12, 8, 2532, 12, 9, 58775, 13, 8, 1766, 13, 9, 2463, // 12, 9 - 12, 9, 2723, 12, 10, 58234, 13, 9, 1908, 13, 10, 2671, // 12,10 - 12, 10, 2977, 12, 11, 57514, 13, 10, 2096, 13, 11, 2949, // 12,11 - 12, 11, 3274, 12, 12, 56673, 13, 11, 2317, 13, 12, 3272, // 12,12 - 12, 12, 3595, 12, 13, 55756, 13, 12, 2557, 13, 13, 3628, // 12,13 - 12, 13, 3929, 12, 14, 54796, 13, 13, 2808, 13, 14, 4003, // 12,14 - 12, 14, 4267, 12, 15, 53814, 13, 14, 3065, 13, 15, 4390, // 12,15 - 12, -1, 3235, 12, 0, 4612, 13, -1, 4521, 13, 0, 53168, // 13, 0 - 12, 0, 2998, 12, 1, 4255, 13, 0, 4212, 13, 1, 54071, // 13, 1 - 12, 1, 2770, 12, 2, 3913, 13, 1, 3911, 13, 2, 54942, // 13, 2 - 12, 2, 2557, 12, 3, 3595, 13, 2, 3628, 13, 3, 55756, // 13, 3 - 12, 3, 2365, 12, 4, 3311, 13, 3, 3373, 13, 4, 56487, // 13, 4 - 12, 4, 2205, 12, 5, 3074, 13, 4, 3161, 13, 5, 57096, // 13, 5 - 12, 5, 2088, 12, 6, 2898, 13, 5, 3007, 13, 6, 57543, // 13, 6 - 12, 6, 2022, 12, 7, 2795, 13, 6, 2926, 13, 7, 57793, // 13, 7 - 13, 7, 2926, 13, 8, 57795, 14, 7, 2022, 14, 8, 2793, // 13, 8 - 13, 8, 3007, 13, 9, 57545, 14, 8, 2088, 14, 9, 2896, // 13, 9 - 13, 9, 3161, 13, 10, 57096, 14, 9, 2205, 14, 10, 3074, // 13,10 - 13, 10, 3374, 13, 11, 56487, 14, 10, 2365, 14, 11, 3310, // 13,11 - 13, 11, 3630, 13, 12, 55756, 14, 11, 2556, 14, 12, 3594, // 13,12 - 13, 12, 3913, 13, 13, 54941, 14, 12, 2770, 14, 13, 3912, // 13,13 - 13, 13, 4214, 13, 14, 54071, 14, 13, 2998, 14, 14, 4253, // 13,14 - 13, 14, 4523, 13, 15, 53168, 14, 14, 3235, 14, 15, 4610, // 13,15 - 13, -1, 3421, 13, 0, 4854, 14, -1, 4803, 14, 0, 52458, // 14, 0 - 13, 0, 3204, 13, 1, 4525, 14, 0, 4522, 14, 1, 53285, // 14, 1 - 13, 1, 2998, 13, 2, 4214, 14, 1, 4253, 14, 2, 54071, // 14, 2 - 13, 2, 2808, 13, 3, 3929, 14, 2, 4003, 14, 3, 54796, // 14, 3 - 13, 3, 2640, 13, 4, 3678, 14, 3, 3783, 14, 4, 55435, // 14, 4 - 13, 4, 2503, 13, 5, 3472, 14, 4, 3604, 14, 5, 55957, // 14, 5 - 13, 5, 2403, 13, 6, 3319, 14, 5, 3476, 14, 6, 56338, // 14, 6 - 13, 6, 2346, 13, 7, 3227, 14, 6, 3411, 14, 7, 56552, // 14, 7 - 14, 7, 3411, 14, 8, 56554, 15, 7, 2346, 15, 8, 3225, // 14, 8 - 14, 8, 3477, 14, 9, 56340, 15, 8, 2402, 15, 9, 3317, // 14, 9 - 14, 9, 3605, 14, 10, 55959, 15, 9, 2502, 15, 10, 3470, // 14,10 - 14, 10, 3785, 14, 11, 55435, 15, 10, 2640, 15, 11, 3676, // 14,11 - 14, 11, 4005, 14, 12, 54796, 15, 11, 2808, 15, 12, 3927, // 14,12 - 14, 12, 4255, 14, 13, 54072, 15, 12, 2998, 15, 13, 4211, // 14,13 - 14, 13, 4525, 14, 14, 53285, 15, 13, 3204, 15, 14, 4522, // 14,14 - 14, 14, 4806, 14, 15, 52457, 15, 14, 3422, 15, 15, 4851, // 14,15 - 14, -1, 3621, 14, 0, 5110, 15, -1, 5106, 15, 0, 51699, // 15, 0 - 14, 0, 3422, 14, 1, 4806, 15, 0, 4851, 15, 1, 52457, // 15, 1 - 14, 1, 3235, 14, 2, 4523, 15, 1, 4610, 15, 2, 53168, // 15, 2 - 14, 2, 3065, 14, 3, 4267, 15, 2, 4390, 15, 3, 53814, // 15, 3 - 14, 3, 2917, 14, 4, 4043, 15, 3, 4200, 15, 4, 54376, // 15, 4 - 14, 4, 2797, 14, 5, 3860, 15, 4, 4046, 15, 5, 54833, // 15, 5 - 14, 5, 2709, 14, 6, 3724, 15, 5, 3939, 15, 6, 55164, // 15, 6 - 14, 6, 2659, 14, 7, 3640, 15, 6, 3885, 15, 7, 55352, // 15, 7 - 15, 7, 3885, 15, 8, 55354, 16, 7, 2659, 16, 8, 3638, // 15, 8 - 15, 8, 3940, 15, 9, 55166, 16, 8, 2709, 16, 9, 3721, // 15, 9 - 15, 9, 4047, 15, 10, 54835, 16, 9, 2796, 16, 10, 3858, // 15,10 - 15, 10, 4201, 15, 11, 54378, 16, 10, 2916, 16, 11, 4041, // 15,11 - 15, 11, 4392, 15, 12, 53815, 16, 11, 3064, 16, 12, 4265, // 15,12 - 15, 12, 4612, 15, 13, 53168, 16, 12, 3235, 16, 13, 4521, // 15,13 - 15, 13, 4854, 15, 14, 52457, 16, 13, 3421, 16, 14, 4804, // 15,14 - 15, 14, 5110, 15, 15, 51699, 16, 14, 3621, 16, 15, 5106, // 15,15 - // angle of 0.0 degrees - 0, 0, 16384, 0, 0, 16384, 0, 0, 16384, 0, 0, 16384, // 0, 0 - 0, 1, 16384, 0, 1, 16384, 0, 1, 16384, 0, 1, 16384, // 0, 1 - 0, 2, 16384, 0, 2, 16384, 0, 2, 16384, 0, 2, 16384, // 0, 2 - 0, 3, 16384, 0, 3, 16384, 0, 3, 16384, 0, 3, 16384, // 0, 3 - 0, 4, 16384, 0, 4, 16384, 0, 4, 16384, 0, 4, 16384, // 0, 4 - 0, 5, 16384, 0, 5, 16384, 0, 5, 16384, 0, 5, 16384, // 0, 5 - 0, 6, 16384, 0, 6, 16384, 0, 6, 16384, 0, 6, 16384, // 0, 6 - 0, 7, 16384, 0, 7, 16384, 0, 7, 16384, 0, 7, 16384, // 0, 7 - 0, 8, 16384, 0, 8, 16384, 0, 8, 16384, 0, 8, 16384, // 0, 8 - 0, 9, 16384, 0, 9, 16384, 0, 9, 16384, 0, 9, 16384, // 0, 9 - 0, 10, 16384, 0, 10, 16384, 0, 10, 16384, 0, 10, 16384, // 0,10 - 0, 11, 16384, 0, 11, 16384, 0, 11, 16384, 0, 11, 16384, // 0,11 - 0, 12, 16384, 0, 12, 16384, 0, 12, 16384, 0, 12, 16384, // 0,12 - 0, 13, 16384, 0, 13, 16384, 0, 13, 16384, 0, 13, 16384, // 0,13 - 0, 14, 16384, 0, 14, 16384, 0, 14, 16384, 0, 14, 16384, // 0,14 - 0, 15, 16384, 0, 15, 16384, 0, 15, 16384, 0, 15, 16384, // 0,15 - 1, 0, 16384, 1, 0, 16384, 1, 0, 16384, 1, 0, 16384, // 1, 0 - 1, 1, 16384, 1, 1, 16384, 1, 1, 16384, 1, 1, 16384, // 1, 1 - 1, 2, 16384, 1, 2, 16384, 1, 2, 16384, 1, 2, 16384, // 1, 2 - 1, 3, 16384, 1, 3, 16384, 1, 3, 16384, 1, 3, 16384, // 1, 3 - 1, 4, 16384, 1, 4, 16384, 1, 4, 16384, 1, 4, 16384, // 1, 4 - 1, 5, 16384, 1, 5, 16384, 1, 5, 16384, 1, 5, 16384, // 1, 5 - 1, 6, 16384, 1, 6, 16384, 1, 6, 16384, 1, 6, 16384, // 1, 6 - 1, 7, 16384, 1, 7, 16384, 1, 7, 16384, 1, 7, 16384, // 1, 7 - 1, 8, 16384, 1, 8, 16384, 1, 8, 16384, 1, 8, 16384, // 1, 8 - 1, 9, 16384, 1, 9, 16384, 1, 9, 16384, 1, 9, 16384, // 1, 9 - 1, 10, 16384, 1, 10, 16384, 1, 10, 16384, 1, 10, 16384, // 1,10 - 1, 11, 16384, 1, 11, 16384, 1, 11, 16384, 1, 11, 16384, // 1,11 - 1, 12, 16384, 1, 12, 16384, 1, 12, 16384, 1, 12, 16384, // 1,12 - 1, 13, 16384, 1, 13, 16384, 1, 13, 16384, 1, 13, 16384, // 1,13 - 1, 14, 16384, 1, 14, 16384, 1, 14, 16384, 1, 14, 16384, // 1,14 - 1, 15, 16384, 1, 15, 16384, 1, 15, 16384, 1, 15, 16384, // 1,15 - 2, 0, 16384, 2, 0, 16384, 2, 0, 16384, 2, 0, 16384, // 2, 0 - 2, 1, 16384, 2, 1, 16384, 2, 1, 16384, 2, 1, 16384, // 2, 1 - 2, 2, 16384, 2, 2, 16384, 2, 2, 16384, 2, 2, 16384, // 2, 2 - 2, 3, 16384, 2, 3, 16384, 2, 3, 16384, 2, 3, 16384, // 2, 3 - 2, 4, 16384, 2, 4, 16384, 2, 4, 16384, 2, 4, 16384, // 2, 4 - 2, 5, 16384, 2, 5, 16384, 2, 5, 16384, 2, 5, 16384, // 2, 5 - 2, 6, 16384, 2, 6, 16384, 2, 6, 16384, 2, 6, 16384, // 2, 6 - 2, 7, 16384, 2, 7, 16384, 2, 7, 16384, 2, 7, 16384, // 2, 7 - 2, 8, 16384, 2, 8, 16384, 2, 8, 16384, 2, 8, 16384, // 2, 8 - 2, 9, 16384, 2, 9, 16384, 2, 9, 16384, 2, 9, 16384, // 2, 9 - 2, 10, 16384, 2, 10, 16384, 2, 10, 16384, 2, 10, 16384, // 2,10 - 2, 11, 16384, 2, 11, 16384, 2, 11, 16384, 2, 11, 16384, // 2,11 - 2, 12, 16384, 2, 12, 16384, 2, 12, 16384, 2, 12, 16384, // 2,12 - 2, 13, 16384, 2, 13, 16384, 2, 13, 16384, 2, 13, 16384, // 2,13 - 2, 14, 16384, 2, 14, 16384, 2, 14, 16384, 2, 14, 16384, // 2,14 - 2, 15, 16384, 2, 15, 16384, 2, 15, 16384, 2, 15, 16384, // 2,15 - 3, 0, 16384, 3, 0, 16384, 3, 0, 16384, 3, 0, 16384, // 3, 0 - 3, 1, 16384, 3, 1, 16384, 3, 1, 16384, 3, 1, 16384, // 3, 1 - 3, 2, 16384, 3, 2, 16384, 3, 2, 16384, 3, 2, 16384, // 3, 2 - 3, 3, 16384, 3, 3, 16384, 3, 3, 16384, 3, 3, 16384, // 3, 3 - 3, 4, 16384, 3, 4, 16384, 3, 4, 16384, 3, 4, 16384, // 3, 4 - 3, 5, 16384, 3, 5, 16384, 3, 5, 16384, 3, 5, 16384, // 3, 5 - 3, 6, 16384, 3, 6, 16384, 3, 6, 16384, 3, 6, 16384, // 3, 6 - 3, 7, 16384, 3, 7, 16384, 3, 7, 16384, 3, 7, 16384, // 3, 7 - 3, 8, 16384, 3, 8, 16384, 3, 8, 16384, 3, 8, 16384, // 3, 8 - 3, 9, 16384, 3, 9, 16384, 3, 9, 16384, 3, 9, 16384, // 3, 9 - 3, 10, 16384, 3, 10, 16384, 3, 10, 16384, 3, 10, 16384, // 3,10 - 3, 11, 16384, 3, 11, 16384, 3, 11, 16384, 3, 11, 16384, // 3,11 - 3, 12, 16384, 3, 12, 16384, 3, 12, 16384, 3, 12, 16384, // 3,12 - 3, 13, 16384, 3, 13, 16384, 3, 13, 16384, 3, 13, 16384, // 3,13 - 3, 14, 16384, 3, 14, 16384, 3, 14, 16384, 3, 14, 16384, // 3,14 - 3, 15, 16384, 3, 15, 16384, 3, 15, 16384, 3, 15, 16384, // 3,15 - 4, 0, 16384, 4, 0, 16384, 4, 0, 16384, 4, 0, 16384, // 4, 0 - 4, 1, 16384, 4, 1, 16384, 4, 1, 16384, 4, 1, 16384, // 4, 1 - 4, 2, 16384, 4, 2, 16384, 4, 2, 16384, 4, 2, 16384, // 4, 2 - 4, 3, 16384, 4, 3, 16384, 4, 3, 16384, 4, 3, 16384, // 4, 3 - 4, 4, 16384, 4, 4, 16384, 4, 4, 16384, 4, 4, 16384, // 4, 4 - 4, 5, 16384, 4, 5, 16384, 4, 5, 16384, 4, 5, 16384, // 4, 5 - 4, 6, 16384, 4, 6, 16384, 4, 6, 16384, 4, 6, 16384, // 4, 6 - 4, 7, 16384, 4, 7, 16384, 4, 7, 16384, 4, 7, 16384, // 4, 7 - 4, 8, 16384, 4, 8, 16384, 4, 8, 16384, 4, 8, 16384, // 4, 8 - 4, 9, 16384, 4, 9, 16384, 4, 9, 16384, 4, 9, 16384, // 4, 9 - 4, 10, 16384, 4, 10, 16384, 4, 10, 16384, 4, 10, 16384, // 4,10 - 4, 11, 16384, 4, 11, 16384, 4, 11, 16384, 4, 11, 16384, // 4,11 - 4, 12, 16384, 4, 12, 16384, 4, 12, 16384, 4, 12, 16384, // 4,12 - 4, 13, 16384, 4, 13, 16384, 4, 13, 16384, 4, 13, 16384, // 4,13 - 4, 14, 16384, 4, 14, 16384, 4, 14, 16384, 4, 14, 16384, // 4,14 - 4, 15, 16384, 4, 15, 16384, 4, 15, 16384, 4, 15, 16384, // 4,15 - 5, 0, 16384, 5, 0, 16384, 5, 0, 16384, 5, 0, 16384, // 5, 0 - 5, 1, 16384, 5, 1, 16384, 5, 1, 16384, 5, 1, 16384, // 5, 1 - 5, 2, 16384, 5, 2, 16384, 5, 2, 16384, 5, 2, 16384, // 5, 2 - 5, 3, 16384, 5, 3, 16384, 5, 3, 16384, 5, 3, 16384, // 5, 3 - 5, 4, 16384, 5, 4, 16384, 5, 4, 16384, 5, 4, 16384, // 5, 4 - 5, 5, 16384, 5, 5, 16384, 5, 5, 16384, 5, 5, 16384, // 5, 5 - 5, 6, 16384, 5, 6, 16384, 5, 6, 16384, 5, 6, 16384, // 5, 6 - 5, 7, 16384, 5, 7, 16384, 5, 7, 16384, 5, 7, 16384, // 5, 7 - 5, 8, 16384, 5, 8, 16384, 5, 8, 16384, 5, 8, 16384, // 5, 8 - 5, 9, 16384, 5, 9, 16384, 5, 9, 16384, 5, 9, 16384, // 5, 9 - 5, 10, 16384, 5, 10, 16384, 5, 10, 16384, 5, 10, 16384, // 5,10 - 5, 11, 16384, 5, 11, 16384, 5, 11, 16384, 5, 11, 16384, // 5,11 - 5, 12, 16384, 5, 12, 16384, 5, 12, 16384, 5, 12, 16384, // 5,12 - 5, 13, 16384, 5, 13, 16384, 5, 13, 16384, 5, 13, 16384, // 5,13 - 5, 14, 16384, 5, 14, 16384, 5, 14, 16384, 5, 14, 16384, // 5,14 - 5, 15, 16384, 5, 15, 16384, 5, 15, 16384, 5, 15, 16384, // 5,15 - 6, 0, 16384, 6, 0, 16384, 6, 0, 16384, 6, 0, 16384, // 6, 0 - 6, 1, 16384, 6, 1, 16384, 6, 1, 16384, 6, 1, 16384, // 6, 1 - 6, 2, 16384, 6, 2, 16384, 6, 2, 16384, 6, 2, 16384, // 6, 2 - 6, 3, 16384, 6, 3, 16384, 6, 3, 16384, 6, 3, 16384, // 6, 3 - 6, 4, 16384, 6, 4, 16384, 6, 4, 16384, 6, 4, 16384, // 6, 4 - 6, 5, 16384, 6, 5, 16384, 6, 5, 16384, 6, 5, 16384, // 6, 5 - 6, 6, 16384, 6, 6, 16384, 6, 6, 16384, 6, 6, 16384, // 6, 6 - 6, 7, 16384, 6, 7, 16384, 6, 7, 16384, 6, 7, 16384, // 6, 7 - 6, 8, 16384, 6, 8, 16384, 6, 8, 16384, 6, 8, 16384, // 6, 8 - 6, 9, 16384, 6, 9, 16384, 6, 9, 16384, 6, 9, 16384, // 6, 9 - 6, 10, 16384, 6, 10, 16384, 6, 10, 16384, 6, 10, 16384, // 6,10 - 6, 11, 16384, 6, 11, 16384, 6, 11, 16384, 6, 11, 16384, // 6,11 - 6, 12, 16384, 6, 12, 16384, 6, 12, 16384, 6, 12, 16384, // 6,12 - 6, 13, 16384, 6, 13, 16384, 6, 13, 16384, 6, 13, 16384, // 6,13 - 6, 14, 16384, 6, 14, 16384, 6, 14, 16384, 6, 14, 16384, // 6,14 - 6, 15, 16384, 6, 15, 16384, 6, 15, 16384, 6, 15, 16384, // 6,15 - 7, 0, 16384, 7, 0, 16384, 7, 0, 16384, 7, 0, 16384, // 7, 0 - 7, 1, 16384, 7, 1, 16384, 7, 1, 16384, 7, 1, 16384, // 7, 1 - 7, 2, 16384, 7, 2, 16384, 7, 2, 16384, 7, 2, 16384, // 7, 2 - 7, 3, 16384, 7, 3, 16384, 7, 3, 16384, 7, 3, 16384, // 7, 3 - 7, 4, 16384, 7, 4, 16384, 7, 4, 16384, 7, 4, 16384, // 7, 4 - 7, 5, 16384, 7, 5, 16384, 7, 5, 16384, 7, 5, 16384, // 7, 5 - 7, 6, 16384, 7, 6, 16384, 7, 6, 16384, 7, 6, 16384, // 7, 6 - 7, 7, 16384, 7, 7, 16384, 7, 7, 16384, 7, 7, 16384, // 7, 7 - 7, 8, 16384, 7, 8, 16384, 7, 8, 16384, 7, 8, 16384, // 7, 8 - 7, 9, 16384, 7, 9, 16384, 7, 9, 16384, 7, 9, 16384, // 7, 9 - 7, 10, 16384, 7, 10, 16384, 7, 10, 16384, 7, 10, 16384, // 7,10 - 7, 11, 16384, 7, 11, 16384, 7, 11, 16384, 7, 11, 16384, // 7,11 - 7, 12, 16384, 7, 12, 16384, 7, 12, 16384, 7, 12, 16384, // 7,12 - 7, 13, 16384, 7, 13, 16384, 7, 13, 16384, 7, 13, 16384, // 7,13 - 7, 14, 16384, 7, 14, 16384, 7, 14, 16384, 7, 14, 16384, // 7,14 - 7, 15, 16384, 7, 15, 16384, 7, 15, 16384, 7, 15, 16384, // 7,15 - 8, 0, 16384, 8, 0, 16384, 8, 0, 16384, 8, 0, 16384, // 8, 0 - 8, 1, 16384, 8, 1, 16384, 8, 1, 16384, 8, 1, 16384, // 8, 1 - 8, 2, 16384, 8, 2, 16384, 8, 2, 16384, 8, 2, 16384, // 8, 2 - 8, 3, 16384, 8, 3, 16384, 8, 3, 16384, 8, 3, 16384, // 8, 3 - 8, 4, 16384, 8, 4, 16384, 8, 4, 16384, 8, 4, 16384, // 8, 4 - 8, 5, 16384, 8, 5, 16384, 8, 5, 16384, 8, 5, 16384, // 8, 5 - 8, 6, 16384, 8, 6, 16384, 8, 6, 16384, 8, 6, 16384, // 8, 6 - 8, 7, 16384, 8, 7, 16384, 8, 7, 16384, 8, 7, 16384, // 8, 7 - 8, 8, 16384, 8, 8, 16384, 8, 8, 16384, 8, 8, 16384, // 8, 8 - 8, 9, 16384, 8, 9, 16384, 8, 9, 16384, 8, 9, 16384, // 8, 9 - 8, 10, 16384, 8, 10, 16384, 8, 10, 16384, 8, 10, 16384, // 8,10 - 8, 11, 16384, 8, 11, 16384, 8, 11, 16384, 8, 11, 16384, // 8,11 - 8, 12, 16384, 8, 12, 16384, 8, 12, 16384, 8, 12, 16384, // 8,12 - 8, 13, 16384, 8, 13, 16384, 8, 13, 16384, 8, 13, 16384, // 8,13 - 8, 14, 16384, 8, 14, 16384, 8, 14, 16384, 8, 14, 16384, // 8,14 - 8, 15, 16384, 8, 15, 16384, 8, 15, 16384, 8, 15, 16384, // 8,15 - 9, 0, 16384, 9, 0, 16384, 9, 0, 16384, 9, 0, 16384, // 9, 0 - 9, 1, 16384, 9, 1, 16384, 9, 1, 16384, 9, 1, 16384, // 9, 1 - 9, 2, 16384, 9, 2, 16384, 9, 2, 16384, 9, 2, 16384, // 9, 2 - 9, 3, 16384, 9, 3, 16384, 9, 3, 16384, 9, 3, 16384, // 9, 3 - 9, 4, 16384, 9, 4, 16384, 9, 4, 16384, 9, 4, 16384, // 9, 4 - 9, 5, 16384, 9, 5, 16384, 9, 5, 16384, 9, 5, 16384, // 9, 5 - 9, 6, 16384, 9, 6, 16384, 9, 6, 16384, 9, 6, 16384, // 9, 6 - 9, 7, 16384, 9, 7, 16384, 9, 7, 16384, 9, 7, 16384, // 9, 7 - 9, 8, 16384, 9, 8, 16384, 9, 8, 16384, 9, 8, 16384, // 9, 8 - 9, 9, 16384, 9, 9, 16384, 9, 9, 16384, 9, 9, 16384, // 9, 9 - 9, 10, 16384, 9, 10, 16384, 9, 10, 16384, 9, 10, 16384, // 9,10 - 9, 11, 16384, 9, 11, 16384, 9, 11, 16384, 9, 11, 16384, // 9,11 - 9, 12, 16384, 9, 12, 16384, 9, 12, 16384, 9, 12, 16384, // 9,12 - 9, 13, 16384, 9, 13, 16384, 9, 13, 16384, 9, 13, 16384, // 9,13 - 9, 14, 16384, 9, 14, 16384, 9, 14, 16384, 9, 14, 16384, // 9,14 - 9, 15, 16384, 9, 15, 16384, 9, 15, 16384, 9, 15, 16384, // 9,15 - 10, 0, 16384, 10, 0, 16384, 10, 0, 16384, 10, 0, 16384, // 10, 0 - 10, 1, 16384, 10, 1, 16384, 10, 1, 16384, 10, 1, 16384, // 10, 1 - 10, 2, 16384, 10, 2, 16384, 10, 2, 16384, 10, 2, 16384, // 10, 2 - 10, 3, 16384, 10, 3, 16384, 10, 3, 16384, 10, 3, 16384, // 10, 3 - 10, 4, 16384, 10, 4, 16384, 10, 4, 16384, 10, 4, 16384, // 10, 4 - 10, 5, 16384, 10, 5, 16384, 10, 5, 16384, 10, 5, 16384, // 10, 5 - 10, 6, 16384, 10, 6, 16384, 10, 6, 16384, 10, 6, 16384, // 10, 6 - 10, 7, 16384, 10, 7, 16384, 10, 7, 16384, 10, 7, 16384, // 10, 7 - 10, 8, 16384, 10, 8, 16384, 10, 8, 16384, 10, 8, 16384, // 10, 8 - 10, 9, 16384, 10, 9, 16384, 10, 9, 16384, 10, 9, 16384, // 10, 9 - 10, 10, 16384, 10, 10, 16384, 10, 10, 16384, 10, 10, 16384, // 10,10 - 10, 11, 16384, 10, 11, 16384, 10, 11, 16384, 10, 11, 16384, // 10,11 - 10, 12, 16384, 10, 12, 16384, 10, 12, 16384, 10, 12, 16384, // 10,12 - 10, 13, 16384, 10, 13, 16384, 10, 13, 16384, 10, 13, 16384, // 10,13 - 10, 14, 16384, 10, 14, 16384, 10, 14, 16384, 10, 14, 16384, // 10,14 - 10, 15, 16384, 10, 15, 16384, 10, 15, 16384, 10, 15, 16384, // 10,15 - 11, 0, 16384, 11, 0, 16384, 11, 0, 16384, 11, 0, 16384, // 11, 0 - 11, 1, 16384, 11, 1, 16384, 11, 1, 16384, 11, 1, 16384, // 11, 1 - 11, 2, 16384, 11, 2, 16384, 11, 2, 16384, 11, 2, 16384, // 11, 2 - 11, 3, 16384, 11, 3, 16384, 11, 3, 16384, 11, 3, 16384, // 11, 3 - 11, 4, 16384, 11, 4, 16384, 11, 4, 16384, 11, 4, 16384, // 11, 4 - 11, 5, 16384, 11, 5, 16384, 11, 5, 16384, 11, 5, 16384, // 11, 5 - 11, 6, 16384, 11, 6, 16384, 11, 6, 16384, 11, 6, 16384, // 11, 6 - 11, 7, 16384, 11, 7, 16384, 11, 7, 16384, 11, 7, 16384, // 11, 7 - 11, 8, 16384, 11, 8, 16384, 11, 8, 16384, 11, 8, 16384, // 11, 8 - 11, 9, 16384, 11, 9, 16384, 11, 9, 16384, 11, 9, 16384, // 11, 9 - 11, 10, 16384, 11, 10, 16384, 11, 10, 16384, 11, 10, 16384, // 11,10 - 11, 11, 16384, 11, 11, 16384, 11, 11, 16384, 11, 11, 16384, // 11,11 - 11, 12, 16384, 11, 12, 16384, 11, 12, 16384, 11, 12, 16384, // 11,12 - 11, 13, 16384, 11, 13, 16384, 11, 13, 16384, 11, 13, 16384, // 11,13 - 11, 14, 16384, 11, 14, 16384, 11, 14, 16384, 11, 14, 16384, // 11,14 - 11, 15, 16384, 11, 15, 16384, 11, 15, 16384, 11, 15, 16384, // 11,15 - 12, 0, 16384, 12, 0, 16384, 12, 0, 16384, 12, 0, 16384, // 12, 0 - 12, 1, 16384, 12, 1, 16384, 12, 1, 16384, 12, 1, 16384, // 12, 1 - 12, 2, 16384, 12, 2, 16384, 12, 2, 16384, 12, 2, 16384, // 12, 2 - 12, 3, 16384, 12, 3, 16384, 12, 3, 16384, 12, 3, 16384, // 12, 3 - 12, 4, 16384, 12, 4, 16384, 12, 4, 16384, 12, 4, 16384, // 12, 4 - 12, 5, 16384, 12, 5, 16384, 12, 5, 16384, 12, 5, 16384, // 12, 5 - 12, 6, 16384, 12, 6, 16384, 12, 6, 16384, 12, 6, 16384, // 12, 6 - 12, 7, 16384, 12, 7, 16384, 12, 7, 16384, 12, 7, 16384, // 12, 7 - 12, 8, 16384, 12, 8, 16384, 12, 8, 16384, 12, 8, 16384, // 12, 8 - 12, 9, 16384, 12, 9, 16384, 12, 9, 16384, 12, 9, 16384, // 12, 9 - 12, 10, 16384, 12, 10, 16384, 12, 10, 16384, 12, 10, 16384, // 12,10 - 12, 11, 16384, 12, 11, 16384, 12, 11, 16384, 12, 11, 16384, // 12,11 - 12, 12, 16384, 12, 12, 16384, 12, 12, 16384, 12, 12, 16384, // 12,12 - 12, 13, 16384, 12, 13, 16384, 12, 13, 16384, 12, 13, 16384, // 12,13 - 12, 14, 16384, 12, 14, 16384, 12, 14, 16384, 12, 14, 16384, // 12,14 - 12, 15, 16384, 12, 15, 16384, 12, 15, 16384, 12, 15, 16384, // 12,15 - 13, 0, 16384, 13, 0, 16384, 13, 0, 16384, 13, 0, 16384, // 13, 0 - 13, 1, 16384, 13, 1, 16384, 13, 1, 16384, 13, 1, 16384, // 13, 1 - 13, 2, 16384, 13, 2, 16384, 13, 2, 16384, 13, 2, 16384, // 13, 2 - 13, 3, 16384, 13, 3, 16384, 13, 3, 16384, 13, 3, 16384, // 13, 3 - 13, 4, 16384, 13, 4, 16384, 13, 4, 16384, 13, 4, 16384, // 13, 4 - 13, 5, 16384, 13, 5, 16384, 13, 5, 16384, 13, 5, 16384, // 13, 5 - 13, 6, 16384, 13, 6, 16384, 13, 6, 16384, 13, 6, 16384, // 13, 6 - 13, 7, 16384, 13, 7, 16384, 13, 7, 16384, 13, 7, 16384, // 13, 7 - 13, 8, 16384, 13, 8, 16384, 13, 8, 16384, 13, 8, 16384, // 13, 8 - 13, 9, 16384, 13, 9, 16384, 13, 9, 16384, 13, 9, 16384, // 13, 9 - 13, 10, 16384, 13, 10, 16384, 13, 10, 16384, 13, 10, 16384, // 13,10 - 13, 11, 16384, 13, 11, 16384, 13, 11, 16384, 13, 11, 16384, // 13,11 - 13, 12, 16384, 13, 12, 16384, 13, 12, 16384, 13, 12, 16384, // 13,12 - 13, 13, 16384, 13, 13, 16384, 13, 13, 16384, 13, 13, 16384, // 13,13 - 13, 14, 16384, 13, 14, 16384, 13, 14, 16384, 13, 14, 16384, // 13,14 - 13, 15, 16384, 13, 15, 16384, 13, 15, 16384, 13, 15, 16384, // 13,15 - 14, 0, 16384, 14, 0, 16384, 14, 0, 16384, 14, 0, 16384, // 14, 0 - 14, 1, 16384, 14, 1, 16384, 14, 1, 16384, 14, 1, 16384, // 14, 1 - 14, 2, 16384, 14, 2, 16384, 14, 2, 16384, 14, 2, 16384, // 14, 2 - 14, 3, 16384, 14, 3, 16384, 14, 3, 16384, 14, 3, 16384, // 14, 3 - 14, 4, 16384, 14, 4, 16384, 14, 4, 16384, 14, 4, 16384, // 14, 4 - 14, 5, 16384, 14, 5, 16384, 14, 5, 16384, 14, 5, 16384, // 14, 5 - 14, 6, 16384, 14, 6, 16384, 14, 6, 16384, 14, 6, 16384, // 14, 6 - 14, 7, 16384, 14, 7, 16384, 14, 7, 16384, 14, 7, 16384, // 14, 7 - 14, 8, 16384, 14, 8, 16384, 14, 8, 16384, 14, 8, 16384, // 14, 8 - 14, 9, 16384, 14, 9, 16384, 14, 9, 16384, 14, 9, 16384, // 14, 9 - 14, 10, 16384, 14, 10, 16384, 14, 10, 16384, 14, 10, 16384, // 14,10 - 14, 11, 16384, 14, 11, 16384, 14, 11, 16384, 14, 11, 16384, // 14,11 - 14, 12, 16384, 14, 12, 16384, 14, 12, 16384, 14, 12, 16384, // 14,12 - 14, 13, 16384, 14, 13, 16384, 14, 13, 16384, 14, 13, 16384, // 14,13 - 14, 14, 16384, 14, 14, 16384, 14, 14, 16384, 14, 14, 16384, // 14,14 - 14, 15, 16384, 14, 15, 16384, 14, 15, 16384, 14, 15, 16384, // 14,15 - 15, 0, 16384, 15, 0, 16384, 15, 0, 16384, 15, 0, 16384, // 15, 0 - 15, 1, 16384, 15, 1, 16384, 15, 1, 16384, 15, 1, 16384, // 15, 1 - 15, 2, 16384, 15, 2, 16384, 15, 2, 16384, 15, 2, 16384, // 15, 2 - 15, 3, 16384, 15, 3, 16384, 15, 3, 16384, 15, 3, 16384, // 15, 3 - 15, 4, 16384, 15, 4, 16384, 15, 4, 16384, 15, 4, 16384, // 15, 4 - 15, 5, 16384, 15, 5, 16384, 15, 5, 16384, 15, 5, 16384, // 15, 5 - 15, 6, 16384, 15, 6, 16384, 15, 6, 16384, 15, 6, 16384, // 15, 6 - 15, 7, 16384, 15, 7, 16384, 15, 7, 16384, 15, 7, 16384, // 15, 7 - 15, 8, 16384, 15, 8, 16384, 15, 8, 16384, 15, 8, 16384, // 15, 8 - 15, 9, 16384, 15, 9, 16384, 15, 9, 16384, 15, 9, 16384, // 15, 9 - 15, 10, 16384, 15, 10, 16384, 15, 10, 16384, 15, 10, 16384, // 15,10 - 15, 11, 16384, 15, 11, 16384, 15, 11, 16384, 15, 11, 16384, // 15,11 - 15, 12, 16384, 15, 12, 16384, 15, 12, 16384, 15, 12, 16384, // 15,12 - 15, 13, 16384, 15, 13, 16384, 15, 13, 16384, 15, 13, 16384, // 15,13 - 15, 14, 16384, 15, 14, 16384, 15, 14, 16384, 15, 14, 16384, // 15,14 - 15, 15, 16384, 15, 15, 16384, 15, 15, 16384, 15, 15, 16384, // 15,15 - // angle of 0.5 degrees - 0, -1, 5106, 0, 0, 51699, 1, -1, 3621, 1, 0, 5110, // 0, 0 - 0, 0, 4851, 0, 1, 52457, 1, 0, 3422, 1, 1, 4806, // 0, 1 - 0, 1, 4610, 0, 2, 53168, 1, 1, 3235, 1, 2, 4523, // 0, 2 - 0, 2, 4390, 0, 3, 53814, 1, 2, 3065, 1, 3, 4267, // 0, 3 - 0, 3, 4200, 0, 4, 54376, 1, 3, 2917, 1, 4, 4043, // 0, 4 - 0, 4, 4046, 0, 5, 54833, 1, 4, 2797, 1, 5, 3860, // 0, 5 - 0, 5, 3939, 0, 6, 55164, 1, 5, 2709, 1, 6, 3724, // 0, 6 - 0, 6, 3885, 0, 7, 55352, 1, 6, 2659, 1, 7, 3640, // 0, 7 - -1, 7, 2659, -1, 8, 3638, 0, 7, 3885, 0, 8, 55354, // 0, 8 - -1, 8, 2709, -1, 9, 3722, 0, 8, 3940, 0, 9, 55165, // 0, 9 - -1, 9, 2796, -1, 10, 3858, 0, 9, 4047, 0, 10, 54835, // 0,10 - -1, 10, 2916, -1, 11, 4041, 0, 10, 4201, 0, 11, 54378, // 0,11 - -1, 11, 3064, -1, 12, 4264, 0, 11, 4392, 0, 12, 53816, // 0,12 - -1, 12, 3235, -1, 13, 4521, 0, 12, 4612, 0, 13, 53168, // 0,13 - -1, 13, 3421, -1, 14, 4803, 0, 13, 4854, 0, 14, 52458, // 0,14 - -1, 14, 3621, -1, 15, 5106, 0, 14, 5110, 0, 15, 51699, // 0,15 - 1, -1, 4803, 1, 0, 52457, 2, -1, 3421, 2, 0, 4855, // 1, 0 - 1, 0, 4522, 1, 1, 53285, 2, 0, 3204, 2, 1, 4525, // 1, 1 - 1, 1, 4253, 1, 2, 54071, 2, 1, 2998, 2, 2, 4214, // 1, 2 - 1, 2, 4003, 1, 3, 54796, 2, 2, 2808, 2, 3, 3929, // 1, 3 - 1, 3, 3783, 1, 4, 55434, 2, 3, 2640, 2, 4, 3679, // 1, 4 - 1, 4, 3604, 1, 5, 55958, 2, 4, 2503, 2, 5, 3471, // 1, 5 - 1, 5, 3476, 1, 6, 56339, 2, 5, 2403, 2, 6, 3318, // 1, 6 - 1, 6, 3411, 1, 7, 56552, 2, 6, 2346, 2, 7, 3227, // 1, 7 - 0, 7, 2346, 0, 8, 3225, 1, 7, 3411, 1, 8, 56554, // 1, 8 - 0, 8, 2402, 0, 9, 3317, 1, 8, 3477, 1, 9, 56340, // 1, 9 - 0, 9, 2502, 0, 10, 3470, 1, 9, 3605, 1, 10, 55959, // 1,10 - 0, 10, 2640, 0, 11, 3677, 1, 10, 3785, 1, 11, 55434, // 1,11 - 0, 11, 2808, 0, 12, 3927, 1, 11, 4005, 1, 12, 54796, // 1,12 - 0, 12, 2998, 0, 13, 4212, 1, 12, 4255, 1, 13, 54071, // 1,13 - 0, 13, 3204, 0, 14, 4522, 1, 13, 4525, 1, 14, 53285, // 1,14 - 0, 14, 3422, 0, 15, 4851, 1, 14, 4806, 1, 15, 52457, // 1,15 - 2, -1, 4521, 2, 0, 53168, 3, -1, 3235, 3, 0, 4612, // 2, 0 - 2, 0, 4212, 2, 1, 54072, 3, 0, 2998, 3, 1, 4254, // 2, 1 - 2, 1, 3911, 2, 2, 54941, 3, 1, 2770, 3, 2, 3914, // 2, 2 - 2, 2, 3628, 2, 3, 55756, 3, 2, 2557, 3, 3, 3595, // 2, 3 - 2, 3, 3373, 2, 4, 56486, 3, 3, 2365, 3, 4, 3312, // 2, 4 - 2, 4, 3161, 2, 5, 57095, 3, 4, 2205, 3, 5, 3075, // 2, 5 - 2, 5, 3007, 2, 6, 57544, 3, 5, 2088, 3, 6, 2897, // 2, 6 - 2, 6, 2926, 2, 7, 57793, 3, 6, 2022, 3, 7, 2795, // 2, 7 - 1, 7, 2022, 1, 8, 2794, 2, 7, 2926, 2, 8, 57794, // 2, 8 - 1, 8, 2088, 1, 9, 2897, 2, 8, 3007, 2, 9, 57544, // 2, 9 - 1, 9, 2205, 1, 10, 3073, 2, 9, 3161, 2, 10, 57097, // 2,10 - 1, 10, 2365, 1, 11, 3310, 2, 10, 3374, 2, 11, 56487, // 2,11 - 1, 11, 2556, 1, 12, 3594, 2, 11, 3630, 2, 12, 55756, // 2,12 - 1, 12, 2770, 1, 13, 3911, 2, 12, 3913, 2, 13, 54942, // 2,13 - 1, 13, 2998, 1, 14, 4253, 2, 13, 4214, 2, 14, 54071, // 2,14 - 1, 14, 3235, 1, 15, 4610, 2, 14, 4523, 2, 15, 53168, // 2,15 - 3, -1, 4264, 3, 0, 53815, 4, -1, 3064, 4, 0, 4393, // 3, 0 - 3, 0, 3927, 3, 1, 54796, 4, 0, 2808, 4, 1, 4005, // 3, 1 - 3, 1, 3594, 3, 2, 55756, 4, 1, 2556, 4, 2, 3630, // 3, 2 - 3, 2, 3273, 3, 3, 56673, 4, 2, 2317, 4, 3, 3273, // 3, 3 - 3, 3, 2976, 3, 4, 57514, 4, 3, 2096, 4, 4, 2950, // 3, 4 - 3, 4, 2722, 3, 5, 58233, 4, 4, 1908, 4, 5, 2673, // 3, 5 - 3, 5, 2532, 3, 6, 58774, 4, 5, 1767, 4, 6, 2463, // 3, 6 - 3, 6, 2430, 3, 7, 59076, 4, 6, 1687, 4, 7, 2343, // 3, 7 - 2, 7, 1687, 2, 8, 2342, 3, 7, 2430, 3, 8, 59077, // 3, 8 - 2, 8, 1766, 2, 9, 2463, 3, 8, 2532, 3, 9, 58775, // 3, 9 - 2, 9, 1908, 2, 10, 2672, 3, 9, 2723, 3, 10, 58233, // 3,10 - 2, 10, 2096, 2, 11, 2948, 3, 10, 2977, 3, 11, 57515, // 3,11 - 2, 11, 2317, 2, 12, 3273, 3, 11, 3274, 3, 12, 56672, // 3,12 - 2, 12, 2557, 2, 13, 3628, 3, 12, 3595, 3, 13, 55756, // 3,13 - 2, 13, 2808, 2, 14, 4003, 3, 13, 3929, 3, 14, 54796, // 3,14 - 2, 14, 3065, 2, 15, 4390, 3, 14, 4267, 3, 15, 53814, // 3,15 - 4, -1, 4041, 4, 0, 54378, 5, -1, 2916, 5, 0, 4201, // 4, 0 - 4, 0, 3677, 4, 1, 55435, 5, 0, 2640, 5, 1, 3784, // 4, 1 - 4, 1, 3310, 4, 2, 56487, 5, 1, 2365, 5, 2, 3374, // 4, 2 - 4, 2, 2948, 4, 3, 57514, 5, 2, 2096, 5, 3, 2978, // 4, 3 - 4, 3, 2604, 4, 4, 58484, 5, 3, 1843, 5, 4, 2605, // 4, 4 - 4, 4, 2297, 4, 5, 59345, 5, 4, 1617, 5, 5, 2277, // 4, 5 - 4, 5, 2057, 4, 6, 60017, 5, 5, 1442, 5, 6, 2020, // 4, 6 - 4, 6, 1922, 4, 7, 60402, 5, 6, 1341, 5, 7, 1871, // 4, 7 - 3, 7, 1341, 3, 8, 1871, 4, 7, 1922, 4, 8, 60402, // 4, 8 - 3, 8, 1442, 3, 9, 2020, 4, 8, 2057, 4, 9, 60017, // 4, 9 - 3, 9, 1617, 3, 10, 2276, 4, 9, 2297, 4, 10, 59346, // 4,10 - 3, 10, 1843, 3, 11, 2604, 4, 10, 2605, 4, 11, 58484, // 4,11 - 3, 11, 2096, 3, 12, 2976, 4, 11, 2950, 4, 12, 57514, // 4,12 - 3, 12, 2365, 3, 13, 3373, 4, 12, 3311, 4, 13, 56487, // 4,13 - 3, 13, 2640, 3, 14, 3783, 4, 13, 3678, 4, 14, 55435, // 4,14 - 3, 14, 2917, 3, 15, 4200, 4, 14, 4043, 4, 15, 54376, // 4,15 - 5, -1, 3858, 5, 0, 54835, 6, -1, 2796, 6, 0, 4047, // 5, 0 - 5, 0, 3470, 5, 1, 55959, 6, 0, 2502, 6, 1, 3605, // 5, 1 - 5, 1, 3073, 5, 2, 57096, 6, 1, 2205, 6, 2, 3162, // 5, 2 - 5, 2, 2672, 5, 3, 58234, 6, 2, 1908, 6, 3, 2722, // 5, 3 - 5, 3, 2276, 5, 4, 59346, 6, 3, 1617, 6, 4, 2297, // 5, 4 - 5, 4, 1904, 5, 5, 60381, 6, 4, 1347, 6, 5, 1904, // 5, 5 - 5, 5, 1593, 5, 6, 61243, 6, 5, 1121, 6, 6, 1579, // 5, 6 - 5, 6, 1405, 5, 7, 61767, 6, 6, 985, 6, 7, 1379, // 5, 7 - 4, 7, 985, 4, 8, 1380, 5, 7, 1405, 5, 8, 61766, // 5, 8 - 4, 8, 1121, 4, 9, 1578, 5, 8, 1593, 5, 9, 61244, // 5, 9 - 4, 9, 1347, 4, 10, 1904, 5, 9, 1904, 5, 10, 60381, // 5,10 - 4, 10, 1617, 4, 11, 2297, 5, 10, 2276, 5, 11, 59346, // 5,11 - 4, 11, 1908, 4, 12, 2722, 5, 11, 2673, 5, 12, 58233, // 5,12 - 4, 12, 2205, 4, 13, 3161, 5, 12, 3074, 5, 13, 57096, // 5,13 - 4, 13, 2503, 4, 14, 3604, 5, 13, 3472, 5, 14, 55957, // 5,14 - 4, 14, 2797, 4, 15, 4046, 5, 14, 3860, 5, 15, 54833, // 5,15 - 6, -1, 3722, 6, 0, 55166, 7, -1, 2709, 7, 0, 3939, // 6, 0 - 6, 0, 3317, 6, 1, 56340, 7, 0, 2402, 7, 1, 3477, // 6, 1 - 6, 1, 2897, 6, 2, 57545, 7, 1, 2088, 7, 2, 3006, // 6, 2 - 6, 2, 2463, 6, 3, 58775, 7, 2, 1766, 7, 3, 2532, // 6, 3 - 6, 3, 2020, 6, 4, 60018, 7, 3, 1442, 7, 4, 2056, // 6, 4 - 6, 4, 1578, 6, 5, 61243, 7, 4, 1121, 7, 5, 1594, // 6, 5 - 6, 5, 1170, 6, 6, 62369, 7, 5, 827, 7, 6, 1170, // 6, 6 - 6, 6, 883, 6, 7, 63156, 7, 6, 622, 7, 7, 875, // 6, 7 - 5, 7, 622, 5, 8, 875, 6, 7, 883, 6, 8, 63156, // 6, 8 - 5, 8, 827, 5, 9, 1170, 6, 8, 1170, 6, 9, 62369, // 6, 9 - 5, 9, 1121, 5, 10, 1593, 6, 9, 1579, 6, 10, 61243, // 6,10 - 5, 10, 1442, 5, 11, 2057, 6, 10, 2020, 6, 11, 60017, // 6,11 - 5, 11, 1767, 5, 12, 2532, 6, 11, 2464, 6, 12, 58773, // 6,12 - 5, 12, 2088, 5, 13, 3007, 6, 12, 2898, 6, 13, 57543, // 6,13 - 5, 13, 2403, 5, 14, 3476, 6, 13, 3319, 6, 14, 56338, // 6,14 - 5, 14, 2709, 5, 15, 3939, 6, 14, 3724, 6, 15, 55164, // 6,15 - 7, -1, 3638, 7, 0, 55354, 8, -1, 2659, 8, 0, 3885, // 7, 0 - 7, 0, 3225, 7, 1, 56554, 8, 0, 2346, 8, 1, 3411, // 7, 1 - 7, 1, 2794, 7, 2, 57795, 8, 1, 2022, 8, 2, 2925, // 7, 2 - 7, 2, 2342, 7, 3, 59077, 8, 2, 1687, 8, 3, 2430, // 7, 3 - 7, 3, 1871, 7, 4, 60402, 8, 3, 1341, 8, 4, 1922, // 7, 4 - 7, 4, 1380, 7, 5, 61767, 8, 4, 985, 8, 5, 1404, // 7, 5 - 7, 5, 875, 7, 6, 63156, 8, 5, 622, 8, 6, 883, // 7, 6 - 7, 6, 399, 7, 7, 64455, 8, 6, 282, 8, 7, 400, // 7, 7 - 6, 7, 282, 6, 8, 399, 7, 7, 399, 7, 8, 64456, // 7, 8 - 6, 8, 622, 6, 9, 883, 7, 8, 875, 7, 9, 63156, // 7, 9 - 6, 9, 985, 6, 10, 1405, 7, 9, 1380, 7, 10, 61766, // 7,10 - 6, 10, 1341, 6, 11, 1922, 7, 10, 1871, 7, 11, 60402, // 7,11 - 6, 11, 1687, 6, 12, 2430, 7, 11, 2343, 7, 12, 59076, // 7,12 - 6, 12, 2022, 6, 13, 2926, 7, 12, 2795, 7, 13, 57793, // 7,13 - 6, 13, 2346, 6, 14, 3411, 7, 13, 3227, 7, 14, 56552, // 7,14 - 6, 14, 2659, 6, 15, 3885, 7, 14, 3640, 7, 15, 55352, // 7,15 - 8, 0, 55352, 8, 1, 3640, 9, 0, 3885, 9, 1, 2659, // 8, 0 - 8, 1, 56552, 8, 2, 3227, 9, 1, 3411, 9, 2, 2346, // 8, 1 - 8, 2, 57793, 8, 3, 2795, 9, 2, 2926, 9, 3, 2022, // 8, 2 - 8, 3, 59076, 8, 4, 2343, 9, 3, 2430, 9, 4, 1687, // 8, 3 - 8, 4, 60402, 8, 5, 1871, 9, 4, 1922, 9, 5, 1341, // 8, 4 - 8, 5, 61767, 8, 6, 1380, 9, 5, 1405, 9, 6, 984, // 8, 5 - 8, 6, 63156, 8, 7, 875, 9, 6, 883, 9, 7, 622, // 8, 6 - 8, 7, 64455, 8, 8, 399, 9, 7, 399, 9, 8, 283, // 8, 7 - 7, 8, 399, 7, 9, 282, 8, 8, 64455, 8, 9, 400, // 8, 8 - 7, 9, 883, 7, 10, 622, 8, 9, 63156, 8, 10, 875, // 8, 9 - 7, 10, 1405, 7, 11, 985, 8, 10, 61767, 8, 11, 1379, // 8,10 - 7, 11, 1922, 7, 12, 1341, 8, 11, 60402, 8, 12, 1871, // 8,11 - 7, 12, 2430, 7, 13, 1687, 8, 12, 59077, 8, 13, 2342, // 8,12 - 7, 13, 2926, 7, 14, 2022, 8, 13, 57795, 8, 14, 2793, // 8,13 - 7, 14, 3411, 7, 15, 2346, 8, 14, 56554, 8, 15, 3225, // 8,14 - 7, 15, 3885, 7, 16, 2659, 8, 15, 55354, 8, 16, 3638, // 8,15 - 9, 0, 55164, 9, 1, 3724, 10, 0, 3939, 10, 1, 2709, // 9, 0 - 9, 1, 56339, 9, 2, 3319, 10, 1, 3476, 10, 2, 2402, // 9, 1 - 9, 2, 57544, 9, 3, 2898, 10, 2, 3007, 10, 3, 2087, // 9, 2 - 9, 3, 58774, 9, 4, 2464, 10, 3, 2532, 10, 4, 1766, // 9, 3 - 9, 4, 60017, 9, 5, 2020, 10, 4, 2057, 10, 5, 1442, // 9, 4 - 9, 5, 61243, 9, 6, 1579, 10, 5, 1593, 10, 6, 1121, // 9, 5 - 9, 6, 62369, 9, 7, 1170, 10, 6, 1170, 10, 7, 827, // 9, 6 - 9, 7, 63156, 9, 8, 883, 10, 7, 875, 10, 8, 622, // 9, 7 - 8, 8, 875, 8, 9, 622, 9, 8, 63156, 9, 9, 883, // 9, 8 - 8, 9, 1170, 8, 10, 827, 9, 9, 62369, 9, 10, 1170, // 9, 9 - 8, 10, 1593, 8, 11, 1121, 9, 10, 61243, 9, 11, 1579, // 9,10 - 8, 11, 2057, 8, 12, 1442, 9, 11, 60018, 9, 12, 2019, // 9,11 - 8, 12, 2532, 8, 13, 1766, 9, 12, 58775, 9, 13, 2463, // 9,12 - 8, 13, 3007, 8, 14, 2088, 9, 13, 57545, 9, 14, 2896, // 9,13 - 8, 14, 3477, 8, 15, 2402, 9, 14, 56340, 9, 15, 3317, // 9,14 - 8, 15, 3940, 8, 16, 2709, 9, 15, 55166, 9, 16, 3721, // 9,15 - 10, 0, 54833, 10, 1, 3860, 11, 0, 4046, 11, 1, 2797, // 10, 0 - 10, 1, 55958, 10, 2, 3472, 11, 1, 3604, 11, 2, 2502, // 10, 1 - 10, 2, 57095, 10, 3, 3074, 11, 2, 3161, 11, 3, 2206, // 10, 2 - 10, 3, 58233, 10, 4, 2673, 11, 3, 2722, 11, 4, 1908, // 10, 3 - 10, 4, 59345, 10, 5, 2276, 11, 4, 2297, 11, 5, 1618, // 10, 4 - 10, 5, 60381, 10, 6, 1904, 11, 5, 1904, 11, 6, 1347, // 10, 5 - 10, 6, 61243, 10, 7, 1593, 11, 6, 1578, 11, 7, 1122, // 10, 6 - 10, 7, 61767, 10, 8, 1405, 11, 7, 1380, 11, 8, 984, // 10, 7 - 9, 8, 1380, 9, 9, 985, 10, 8, 61767, 10, 9, 1404, // 10, 8 - 9, 9, 1579, 9, 10, 1121, 10, 9, 61243, 10, 10, 1593, // 10, 9 - 9, 10, 1904, 9, 11, 1347, 10, 10, 60381, 10, 11, 1904, // 10,10 - 9, 11, 2297, 9, 12, 1617, 10, 11, 59346, 10, 12, 2276, // 10,11 - 9, 12, 2723, 9, 13, 1908, 10, 12, 58234, 10, 13, 2671, // 10,12 - 9, 13, 3161, 9, 14, 2205, 10, 13, 57096, 10, 14, 3074, // 10,13 - 9, 14, 3605, 9, 15, 2502, 10, 14, 55959, 10, 15, 3470, // 10,14 - 9, 15, 4047, 9, 16, 2796, 10, 15, 54835, 10, 16, 3858, // 10,15 - 11, 0, 54376, 11, 1, 4043, 12, 0, 4200, 12, 1, 2917, // 11, 0 - 11, 1, 55434, 11, 2, 3678, 12, 1, 3783, 12, 2, 2641, // 11, 1 - 11, 2, 56486, 11, 3, 3311, 12, 2, 3373, 12, 3, 2366, // 11, 2 - 11, 3, 57514, 11, 4, 2950, 12, 3, 2976, 12, 4, 2096, // 11, 3 - 11, 4, 58484, 11, 5, 2605, 12, 4, 2604, 12, 5, 1843, // 11, 4 - 11, 5, 59346, 11, 6, 2297, 12, 5, 2276, 12, 6, 1617, // 11, 5 - 11, 6, 60018, 11, 7, 2057, 12, 6, 2020, 12, 7, 1441, // 11, 6 - 11, 7, 60402, 11, 8, 1922, 12, 7, 1871, 12, 8, 1341, // 11, 7 - 10, 8, 1871, 10, 9, 1341, 11, 8, 60402, 11, 9, 1922, // 11, 8 - 10, 9, 2020, 10, 10, 1442, 11, 9, 60017, 11, 10, 2057, // 11, 9 - 10, 10, 2276, 10, 11, 1617, 11, 10, 59345, 11, 11, 2298, // 11,10 - 10, 11, 2605, 10, 12, 1843, 11, 11, 58484, 11, 12, 2604, // 11,11 - 10, 12, 2977, 10, 13, 2096, 11, 12, 57514, 11, 13, 2949, // 11,12 - 10, 13, 3374, 10, 14, 2365, 11, 13, 56487, 11, 14, 3310, // 11,13 - 10, 14, 3785, 10, 15, 2640, 11, 14, 55435, 11, 15, 3676, // 11,14 - 10, 15, 4201, 10, 16, 2916, 11, 15, 54378, 11, 16, 4041, // 11,15 - 12, 0, 53814, 12, 1, 4267, 13, 0, 4390, 13, 1, 3065, // 12, 0 - 12, 1, 54796, 12, 2, 3929, 13, 1, 4003, 13, 2, 2808, // 12, 1 - 12, 2, 55756, 12, 3, 3595, 13, 2, 3628, 13, 3, 2557, // 12, 2 - 12, 3, 56673, 12, 4, 3274, 13, 3, 3273, 13, 4, 2316, // 12, 3 - 12, 4, 57514, 12, 5, 2977, 13, 4, 2948, 13, 5, 2097, // 12, 4 - 12, 5, 58234, 12, 6, 2723, 13, 5, 2672, 13, 6, 1907, // 12, 5 - 12, 6, 58775, 12, 7, 2532, 13, 6, 2463, 13, 7, 1766, // 12, 6 - 12, 7, 59077, 12, 8, 2430, 13, 7, 2342, 13, 8, 1687, // 12, 7 - 11, 8, 2343, 11, 9, 1687, 12, 8, 59076, 12, 9, 2430, // 12, 8 - 11, 9, 2464, 11, 10, 1767, 12, 9, 58774, 12, 10, 2531, // 12, 9 - 11, 10, 2673, 11, 11, 1908, 12, 10, 58233, 12, 11, 2722, // 12,10 - 11, 11, 2950, 11, 12, 2096, 12, 11, 57514, 12, 12, 2976, // 12,11 - 11, 12, 3274, 11, 13, 2317, 12, 12, 56673, 12, 13, 3272, // 12,12 - 11, 13, 3630, 11, 14, 2556, 12, 13, 55756, 12, 14, 3594, // 12,13 - 11, 14, 4005, 11, 15, 2808, 12, 14, 54796, 12, 15, 3927, // 12,14 - 11, 15, 4392, 11, 16, 3064, 12, 15, 53815, 12, 16, 4265, // 12,15 - 13, 0, 53168, 13, 1, 4523, 14, 0, 4610, 14, 1, 3235, // 13, 0 - 13, 1, 54071, 13, 2, 4214, 14, 1, 4253, 14, 2, 2998, // 13, 1 - 13, 2, 54941, 13, 3, 3913, 14, 2, 3911, 14, 3, 2771, // 13, 2 - 13, 3, 55756, 13, 4, 3630, 14, 3, 3594, 14, 4, 2556, // 13, 3 - 13, 4, 56487, 13, 5, 3374, 14, 4, 3310, 14, 5, 2365, // 13, 4 - 13, 5, 57096, 13, 6, 3161, 14, 5, 3073, 14, 6, 2206, // 13, 5 - 13, 6, 57545, 13, 7, 3007, 14, 6, 2897, 14, 7, 2087, // 13, 6 - 13, 7, 57795, 13, 8, 2926, 14, 7, 2794, 14, 8, 2021, // 13, 7 - 12, 8, 2795, 12, 9, 2022, 13, 8, 57793, 13, 9, 2926, // 13, 8 - 12, 9, 2898, 12, 10, 2088, 13, 9, 57544, 13, 10, 3006, // 13, 9 - 12, 10, 3074, 12, 11, 2205, 13, 10, 57095, 13, 11, 3162, // 13,10 - 12, 11, 3311, 12, 12, 2365, 13, 11, 56486, 13, 12, 3374, // 13,11 - 12, 12, 3595, 12, 13, 2557, 13, 12, 55756, 13, 13, 3628, // 13,12 - 12, 13, 3913, 12, 14, 2770, 13, 13, 54941, 13, 14, 3912, // 13,13 - 12, 14, 4255, 12, 15, 2998, 13, 14, 54072, 13, 15, 4211, // 13,14 - 12, 15, 4612, 12, 16, 3235, 13, 15, 53168, 13, 16, 4521, // 13,15 - 14, 0, 52457, 14, 1, 4806, 15, 0, 4851, 15, 1, 3422, // 14, 0 - 14, 1, 53285, 14, 2, 4525, 15, 1, 4522, 15, 2, 3204, // 14, 1 - 14, 2, 54072, 14, 3, 4255, 15, 2, 4212, 15, 3, 2997, // 14, 2 - 14, 3, 54796, 14, 4, 4005, 15, 3, 3927, 15, 4, 2808, // 14, 3 - 14, 4, 55435, 14, 5, 3785, 15, 4, 3677, 15, 5, 2639, // 14, 4 - 14, 5, 55959, 14, 6, 3605, 15, 5, 3470, 15, 6, 2502, // 14, 5 - 14, 6, 56340, 14, 7, 3477, 15, 6, 3317, 15, 7, 2402, // 14, 6 - 14, 7, 56554, 14, 8, 3411, 15, 7, 3225, 15, 8, 2346, // 14, 7 - 13, 8, 3227, 13, 9, 2346, 14, 8, 56552, 14, 9, 3411, // 14, 8 - 13, 9, 3319, 13, 10, 2403, 14, 9, 56339, 14, 10, 3475, // 14, 9 - 13, 10, 3472, 13, 11, 2503, 14, 10, 55958, 14, 11, 3603, // 14,10 - 13, 11, 3678, 13, 12, 2640, 14, 11, 55434, 14, 12, 3784, // 14,11 - 13, 12, 3929, 13, 13, 2808, 14, 12, 54796, 14, 13, 4003, // 14,12 - 13, 13, 4214, 13, 14, 2998, 14, 13, 54071, 14, 14, 4253, // 14,13 - 13, 14, 4525, 13, 15, 3204, 14, 14, 53285, 14, 15, 4522, // 14,14 - 13, 15, 4854, 13, 16, 3421, 14, 15, 52457, 14, 16, 4804, // 14,15 - 15, 0, 51699, 15, 1, 5110, 16, 0, 5106, 16, 1, 3621, // 15, 0 - 15, 1, 52457, 15, 2, 4854, 16, 1, 4803, 16, 2, 3422, // 15, 1 - 15, 2, 53168, 15, 3, 4612, 16, 2, 4521, 16, 3, 3235, // 15, 2 - 15, 3, 53815, 15, 4, 4392, 16, 3, 4264, 16, 4, 3065, // 15, 3 - 15, 4, 54378, 15, 5, 4201, 16, 4, 4041, 16, 5, 2916, // 15, 4 - 15, 5, 54835, 15, 6, 4047, 16, 5, 3858, 16, 6, 2796, // 15, 5 - 15, 6, 55166, 15, 7, 3940, 16, 6, 3722, 16, 7, 2708, // 15, 6 - 15, 7, 55354, 15, 8, 3885, 16, 7, 3638, 16, 8, 2659, // 15, 7 - 14, 8, 3640, 14, 9, 2659, 15, 8, 55352, 15, 9, 3885, // 15, 8 - 14, 9, 3724, 14, 10, 2709, 15, 9, 55164, 15, 10, 3939, // 15, 9 - 14, 10, 3860, 14, 11, 2797, 15, 10, 54833, 15, 11, 4046, // 15,10 - 14, 11, 4043, 14, 12, 2917, 15, 11, 54376, 15, 12, 4200, // 15,11 - 14, 12, 4267, 14, 13, 3065, 15, 12, 53814, 15, 13, 4390, // 15,12 - 14, 13, 4523, 14, 14, 3235, 15, 13, 53168, 15, 14, 4610, // 15,13 - 14, 14, 4806, 14, 15, 3422, 15, 14, 52457, 15, 15, 4851, // 15,14 - 14, 15, 5110, 14, 16, 3621, 15, 15, 51699, 15, 16, 5106, // 15,15 - // angle of 1.0 degrees - 0, -1, 8769, 0, 0, 41693, 1, -1, 6280, 1, 0, 8794, // 0, 0 - 0, 0, 8452, 0, 1, 42821, 1, 0, 5975, 1, 1, 8288, // 0, 1 - 0, 1, 8141, 0, 2, 43900, 1, 1, 5684, 1, 2, 7811, // 0, 2 - 0, 2, 7848, 0, 3, 44901, 1, 2, 5413, 1, 3, 7374, // 0, 3 - 0, 3, 7587, 0, 4, 45791, 1, 3, 5172, 1, 4, 6986, // 0, 4 - 0, 4, 7374, 0, 5, 46532, 1, 4, 4971, 1, 5, 6659, // 0, 5 - 0, 5, 7227, 0, 6, 47086, 1, 5, 4818, 1, 6, 6405, // 0, 6 - 0, 6, 7158, 0, 7, 47426, 1, 6, 4722, 1, 7, 6230, // 0, 7 - -1, 7, 4718, -1, 8, 6217, 0, 7, 7161, 0, 8, 47440, // 0, 8 - -1, 8, 4814, -1, 9, 6391, 0, 8, 7233, 0, 9, 47098, // 0, 9 - -1, 9, 4967, -1, 10, 6644, 0, 9, 7383, 0, 10, 46542, // 0,10 - -1, 10, 5169, -1, 11, 6970, 0, 10, 7599, 0, 11, 45798, // 0,11 - -1, 11, 5410, -1, 12, 7356, 0, 11, 7863, 0, 12, 44907, // 0,12 - -1, 12, 5682, -1, 13, 7791, 0, 12, 8159, 0, 13, 43904, // 0,13 - -1, 13, 5974, -1, 14, 8265, 0, 13, 8474, 0, 14, 42823, // 0,14 - -1, 14, 6280, -1, 15, 8769, 0, 14, 8795, 0, 15, 41692, // 0,15 - 1, -1, 8265, 1, 0, 42823, 2, -1, 5974, 2, 0, 8474, // 1, 0 - 1, 0, 7901, 1, 1, 44074, 2, 0, 5640, 2, 1, 7921, // 1, 1 - 1, 1, 7539, 1, 2, 45286, 2, 1, 5316, 2, 2, 7395, // 1, 2 - 1, 2, 7191, 1, 3, 46427, 2, 2, 5011, 2, 3, 6907, // 1, 3 - 1, 3, 6875, 1, 4, 47453, 2, 3, 4736, 2, 4, 6472, // 1, 4 - 1, 4, 6613, 1, 5, 48314, 2, 4, 4505, 2, 5, 6104, // 1, 5 - 1, 5, 6425, 1, 6, 48960, 2, 5, 4330, 2, 6, 5821, // 1, 6 - 1, 6, 6332, 1, 7, 49347, 2, 6, 4224, 2, 7, 5633, // 1, 7 - 0, 7, 4221, 0, 8, 5623, 1, 7, 6335, 1, 8, 49357, // 1, 8 - 0, 8, 4327, 0, 9, 5809, 1, 8, 6430, 1, 9, 48970, // 1, 9 - 0, 9, 4502, 0, 10, 6092, 1, 9, 6620, 1, 10, 48322, // 1,10 - 0, 10, 4734, 0, 11, 6458, 1, 10, 6886, 1, 11, 47458, // 1,11 - 0, 11, 5009, 0, 12, 6892, 1, 11, 7204, 1, 12, 46431, // 1,12 - 0, 12, 5315, 0, 13, 7378, 1, 12, 7555, 1, 13, 45288, // 1,13 - 0, 13, 5640, 0, 14, 7901, 1, 13, 7921, 1, 14, 44074, // 1,14 - 0, 14, 5975, 0, 15, 8452, 1, 14, 8288, 1, 15, 42821, // 1,15 - 2, -1, 7791, 2, 0, 43904, 3, -1, 5682, 3, 0, 8159, // 2, 0 - 2, 0, 7378, 2, 1, 45288, 3, 0, 5315, 3, 1, 7555, // 2, 1 - 2, 1, 6959, 2, 2, 46650, 3, 1, 4954, 3, 2, 6973, // 2, 2 - 2, 2, 6549, 2, 3, 47953, 3, 2, 4608, 3, 3, 6426, // 2, 3 - 2, 3, 6168, 2, 4, 49147, 3, 3, 4291, 3, 4, 5930, // 2, 4 - 2, 4, 5842, 2, 5, 50165, 3, 4, 4020, 3, 5, 5509, // 2, 5 - 2, 5, 5602, 2, 6, 50935, 3, 5, 3815, 3, 6, 5184, // 2, 6 - 2, 6, 5478, 2, 7, 51387, 3, 6, 3693, 3, 7, 4978, // 2, 7 - 1, 7, 3691, 1, 8, 4970, 2, 7, 5480, 2, 8, 51395, // 2, 8 - 1, 8, 3813, 1, 9, 5175, 2, 8, 5606, 2, 9, 50942, // 2, 9 - 1, 9, 4019, 1, 10, 5499, 2, 9, 5848, 2, 10, 50170, // 2,10 - 1, 10, 4290, 1, 11, 5920, 2, 10, 6176, 2, 11, 49150, // 2,11 - 1, 11, 4607, 1, 12, 6414, 2, 11, 6560, 2, 12, 47955, // 2,12 - 1, 12, 4954, 1, 13, 6959, 2, 12, 6973, 2, 13, 46650, // 2,13 - 1, 13, 5316, 1, 14, 7539, 2, 13, 7395, 2, 14, 45286, // 2,14 - 1, 14, 5684, 1, 15, 8141, 2, 14, 7812, 2, 15, 43899, // 2,15 - 3, -1, 7356, 3, 0, 44907, 4, -1, 5410, 4, 0, 7863, // 3, 0 - 3, 0, 6892, 3, 1, 46430, 4, 0, 5009, 4, 1, 7205, // 3, 1 - 3, 1, 6414, 3, 2, 47955, 4, 1, 4607, 4, 2, 6560, // 3, 2 - 3, 2, 5934, 3, 3, 49445, 4, 2, 4214, 4, 3, 5943, // 3, 3 - 3, 3, 5474, 3, 4, 50843, 4, 3, 3846, 4, 4, 5373, // 3, 4 - 3, 4, 5069, 3, 5, 52066, 4, 4, 3523, 4, 5, 4878, // 3, 5 - 3, 5, 4759, 3, 6, 53008, 4, 5, 3274, 4, 6, 4495, // 3, 6 - 3, 6, 4592, 3, 7, 53557, 4, 6, 3128, 4, 7, 4259, // 3, 7 - 2, 7, 3126, 2, 8, 4254, 3, 7, 4594, 3, 8, 53562, // 3, 8 - 2, 8, 3273, 2, 9, 4489, 3, 8, 4762, 3, 9, 53012, // 3, 9 - 2, 9, 3522, 2, 10, 4872, 3, 9, 5073, 3, 10, 52069, // 3,10 - 2, 10, 3845, 2, 11, 5365, 3, 10, 5481, 3, 11, 50845, // 3,11 - 2, 11, 4214, 2, 12, 5934, 3, 11, 5943, 3, 12, 49445, // 3,12 - 2, 12, 4608, 2, 13, 6549, 3, 12, 6426, 3, 13, 47953, // 3,13 - 2, 13, 5011, 2, 14, 7191, 3, 13, 6908, 3, 14, 46426, // 3,14 - 2, 14, 5413, 2, 15, 7848, 3, 14, 7374, 3, 15, 44901, // 3,15 - 4, -1, 6970, 4, 0, 45799, 5, -1, 5169, 5, 0, 7598, // 4, 0 - 4, 0, 6458, 4, 1, 47458, 5, 0, 4734, 5, 1, 6886, // 4, 1 - 4, 1, 5920, 4, 2, 49150, 5, 1, 4290, 5, 2, 6176, // 4, 2 - 4, 2, 5365, 4, 3, 50844, 5, 2, 3845, 5, 3, 5482, // 4, 3 - 4, 3, 4816, 4, 4, 52484, 5, 3, 3415, 5, 4, 4821, // 4, 4 - 4, 4, 4309, 4, 5, 53973, 5, 4, 3023, 5, 5, 4231, // 4, 5 - 4, 5, 3902, 4, 6, 55164, 5, 5, 2711, 5, 6, 3759, // 4, 6 - 4, 6, 3671, 4, 7, 55867, 5, 6, 2525, 5, 7, 3473, // 4, 7 - 3, 7, 2524, 3, 8, 3469, 4, 7, 3672, 4, 8, 55871, // 4, 8 - 3, 8, 2710, 3, 9, 3755, 4, 8, 3904, 4, 9, 55167, // 4, 9 - 3, 9, 3023, 3, 10, 4226, 4, 9, 4313, 4, 10, 53974, // 4,10 - 3, 10, 3415, 3, 11, 4816, 4, 10, 4822, 4, 11, 52483, // 4,11 - 3, 11, 3846, 3, 12, 5474, 4, 11, 5373, 4, 12, 50843, // 4,12 - 3, 12, 4291, 3, 13, 6168, 4, 12, 5930, 4, 13, 49147, // 4,13 - 3, 13, 4736, 3, 14, 6875, 4, 13, 6472, 4, 14, 47453, // 4,14 - 3, 14, 5172, 3, 15, 7587, 4, 14, 6986, 4, 15, 45791, // 4,15 - 5, -1, 6644, 5, 0, 46541, 6, -1, 4967, 6, 0, 7384, // 5, 0 - 5, 0, 6092, 5, 1, 48322, 6, 0, 4502, 6, 1, 6620, // 5, 1 - 5, 1, 5499, 5, 2, 50171, 6, 1, 4019, 6, 2, 5847, // 5, 2 - 5, 2, 4872, 5, 3, 52069, 6, 2, 3522, 6, 3, 5073, // 5, 3 - 5, 3, 4226, 5, 4, 53975, 6, 3, 3023, 6, 4, 4312, // 5, 4 - 5, 4, 3595, 5, 5, 55798, 6, 4, 2546, 6, 5, 3597, // 5, 5 - 5, 5, 3050, 5, 6, 57353, 6, 5, 2138, 6, 6, 2995, // 5, 6 - 5, 6, 2713, 5, 7, 58322, 6, 6, 1884, 6, 7, 2617, // 5, 7 - 4, 7, 1884, 4, 8, 2615, 5, 7, 2714, 5, 8, 58323, // 5, 8 - 4, 8, 2138, 4, 9, 2993, 5, 8, 3051, 5, 9, 57354, // 5, 9 - 4, 9, 2546, 4, 10, 3595, 5, 9, 3598, 5, 10, 55797, // 5,10 - 4, 10, 3023, 4, 11, 4309, 5, 10, 4230, 5, 11, 53974, // 5,11 - 4, 11, 3523, 4, 12, 5069, 5, 11, 4879, 5, 12, 52065, // 5,12 - 4, 12, 4020, 4, 13, 5842, 5, 12, 5508, 5, 13, 50166, // 5,13 - 4, 13, 4505, 4, 14, 6613, 5, 13, 6104, 5, 14, 48314, // 5,14 - 4, 14, 4971, 4, 15, 7374, 5, 14, 6659, 5, 15, 46532, // 5,15 - 6, -1, 6391, 6, 0, 47098, 7, -1, 4814, 7, 0, 7233, // 6, 0 - 6, 0, 5809, 6, 1, 48969, 7, 0, 4327, 7, 1, 6431, // 6, 1 - 6, 1, 5175, 6, 2, 50942, 7, 1, 3813, 7, 2, 5606, // 6, 2 - 6, 2, 4489, 6, 3, 53012, 7, 2, 3273, 7, 3, 4762, // 6, 3 - 6, 3, 3755, 6, 4, 55166, 7, 3, 2710, 7, 4, 3905, // 6, 4 - 6, 4, 2993, 6, 5, 57354, 7, 4, 2138, 7, 5, 3051, // 6, 5 - 6, 5, 2258, 6, 6, 59422, 7, 5, 1597, 7, 6, 2259, // 6, 6 - 6, 6, 1726, 6, 7, 60905, 7, 6, 1210, 7, 7, 1695, // 6, 7 - 5, 7, 1209, 5, 8, 1695, 6, 7, 1726, 6, 8, 60906, // 6, 8 - 5, 8, 1597, 5, 9, 2258, 6, 8, 2259, 6, 9, 59422, // 6, 9 - 5, 9, 2138, 5, 10, 3050, 6, 9, 2995, 6, 10, 57353, // 6,10 - 5, 10, 2711, 5, 11, 3902, 6, 10, 3759, 6, 11, 55164, // 6,11 - 5, 11, 3274, 5, 12, 4759, 6, 11, 4495, 6, 12, 53008, // 6,12 - 5, 12, 3815, 5, 13, 5602, 6, 12, 5184, 6, 13, 50935, // 6,13 - 5, 13, 4330, 5, 14, 6425, 6, 13, 5820, 6, 14, 48961, // 6,14 - 5, 14, 4818, 5, 15, 7227, 6, 14, 6405, 6, 15, 47086, // 6,15 - 7, -1, 6217, 7, 0, 47440, 8, -1, 4718, 8, 0, 7161, // 7, 0 - 7, 0, 5623, 7, 1, 49358, 8, 0, 4221, 8, 1, 6334, // 7, 1 - 7, 1, 4970, 7, 2, 51395, 8, 1, 3691, 8, 2, 5480, // 7, 2 - 7, 2, 4254, 7, 3, 53562, 8, 2, 3126, 8, 3, 4594, // 7, 3 - 7, 3, 3469, 7, 4, 55870, 8, 3, 2524, 8, 4, 3673, // 7, 4 - 7, 4, 2615, 7, 5, 58324, 8, 4, 1884, 8, 5, 2713, // 7, 5 - 7, 5, 1695, 7, 6, 60906, 8, 5, 1209, 8, 6, 1726, // 7, 6 - 7, 6, 789, 7, 7, 63399, 8, 6, 558, 8, 7, 790, // 7, 7 - 6, 7, 558, 6, 8, 789, 7, 7, 789, 7, 8, 63400, // 7, 8 - 6, 8, 1210, 6, 9, 1726, 7, 8, 1695, 7, 9, 60905, // 7, 9 - 6, 9, 1884, 6, 10, 2713, 7, 9, 2616, 7, 10, 58323, // 7,10 - 6, 10, 2525, 6, 11, 3671, 7, 10, 3473, 7, 11, 55867, // 7,11 - 6, 11, 3128, 6, 12, 4592, 7, 11, 4259, 7, 12, 53557, // 7,12 - 6, 12, 3693, 6, 13, 5478, 7, 12, 4978, 7, 13, 51387, // 7,13 - 6, 13, 4224, 6, 14, 6332, 7, 13, 5633, 7, 14, 49347, // 7,14 - 6, 14, 4722, 6, 15, 7158, 7, 14, 6230, 7, 15, 47426, // 7,15 - 8, 0, 47426, 8, 1, 6230, 9, 0, 7158, 9, 1, 4722, // 8, 0 - 8, 1, 49347, 8, 2, 5633, 9, 1, 6332, 9, 2, 4224, // 8, 1 - 8, 2, 51387, 8, 3, 4978, 9, 2, 5478, 9, 3, 3693, // 8, 2 - 8, 3, 53557, 8, 4, 4259, 9, 3, 4592, 9, 4, 3128, // 8, 3 - 8, 4, 55867, 8, 5, 3473, 9, 4, 3671, 9, 5, 2525, // 8, 4 - 8, 5, 58322, 8, 6, 2616, 9, 5, 2713, 9, 6, 1885, // 8, 5 - 8, 6, 60905, 8, 7, 1695, 9, 6, 1726, 9, 7, 1210, // 8, 6 - 8, 7, 63399, 8, 8, 789, 9, 7, 789, 9, 8, 559, // 8, 7 - 7, 8, 789, 7, 9, 558, 8, 8, 63399, 8, 9, 790, // 8, 8 - 7, 9, 1726, 7, 10, 1209, 8, 9, 60906, 8, 10, 1695, // 8, 9 - 7, 10, 2714, 7, 11, 1884, 8, 10, 58324, 8, 11, 2614, // 8,10 - 7, 11, 3672, 7, 12, 2524, 8, 11, 55870, 8, 12, 3470, // 8,11 - 7, 12, 4594, 7, 13, 3126, 8, 12, 53562, 8, 13, 4254, // 8,12 - 7, 13, 5480, 7, 14, 3691, 8, 13, 51395, 8, 14, 4970, // 8,13 - 7, 14, 6335, 7, 15, 4221, 8, 14, 49358, 8, 15, 5622, // 8,14 - 7, 15, 7161, 7, 16, 4718, 8, 15, 47440, 8, 16, 6217, // 8,15 - 9, 0, 47086, 9, 1, 6405, 10, 0, 7227, 10, 1, 4818, // 9, 0 - 9, 1, 48960, 9, 2, 5820, 10, 1, 6425, 10, 2, 4331, // 9, 1 - 9, 2, 50935, 9, 3, 5184, 10, 2, 5602, 10, 3, 3815, // 9, 2 - 9, 3, 53008, 9, 4, 4495, 10, 3, 4759, 10, 4, 3274, // 9, 3 - 9, 4, 55164, 9, 5, 3759, 10, 4, 3902, 10, 5, 2711, // 9, 4 - 9, 5, 57353, 9, 6, 2995, 10, 5, 3050, 10, 6, 2138, // 9, 5 - 9, 6, 59422, 9, 7, 2259, 10, 6, 2258, 10, 7, 1597, // 9, 6 - 9, 7, 60906, 9, 8, 1726, 10, 7, 1695, 10, 8, 1209, // 9, 7 - 8, 8, 1695, 8, 9, 1210, 9, 8, 60905, 9, 9, 1726, // 9, 8 - 8, 9, 2259, 8, 10, 1597, 9, 9, 59422, 9, 10, 2258, // 9, 9 - 8, 10, 3051, 8, 11, 2138, 9, 10, 57354, 9, 11, 2993, // 9,10 - 8, 11, 3904, 8, 12, 2710, 9, 11, 55166, 9, 12, 3756, // 9,11 - 8, 12, 4762, 8, 13, 3273, 9, 12, 53012, 9, 13, 4489, // 9,12 - 8, 13, 5606, 8, 14, 3813, 9, 13, 50942, 9, 14, 5175, // 9,13 - 8, 14, 6430, 8, 15, 4327, 9, 14, 48969, 9, 15, 5810, // 9,14 - 8, 15, 7233, 8, 16, 4814, 9, 15, 47098, 9, 16, 6391, // 9,15 - 10, 0, 46532, 10, 1, 6659, 11, 0, 7374, 11, 1, 4971, // 10, 0 - 10, 1, 48314, 10, 2, 6104, 11, 1, 6613, 11, 2, 4505, // 10, 1 - 10, 2, 50165, 10, 3, 5508, 11, 2, 5842, 11, 3, 4021, // 10, 2 - 10, 3, 52066, 10, 4, 4879, 11, 3, 5069, 11, 4, 3522, // 10, 3 - 10, 4, 53973, 10, 5, 4230, 11, 4, 4309, 11, 5, 3024, // 10, 4 - 10, 5, 55798, 10, 6, 3598, 11, 5, 3595, 11, 6, 2545, // 10, 5 - 10, 6, 57354, 10, 7, 3051, 11, 6, 2993, 11, 7, 2138, // 10, 6 - 10, 7, 58324, 10, 8, 2714, 11, 7, 2615, 11, 8, 1883, // 10, 7 - 9, 8, 2616, 9, 9, 1884, 10, 8, 58322, 10, 9, 2714, // 10, 8 - 9, 9, 2995, 9, 10, 2138, 10, 9, 57353, 10, 10, 3050, // 10, 9 - 9, 10, 3598, 9, 11, 2546, 10, 10, 55798, 10, 11, 3594, // 10,10 - 9, 11, 4313, 9, 12, 3023, 10, 11, 53975, 10, 12, 4225, // 10,11 - 9, 12, 5073, 9, 13, 3522, 10, 12, 52069, 10, 13, 4872, // 10,12 - 9, 13, 5848, 9, 14, 4019, 10, 13, 50171, 10, 14, 5498, // 10,13 - 9, 14, 6620, 9, 15, 4502, 10, 14, 48322, 10, 15, 6092, // 10,14 - 9, 15, 7383, 9, 16, 4967, 10, 15, 46541, 10, 16, 6645, // 10,15 - 11, 0, 45791, 11, 1, 6986, 12, 0, 7587, 12, 1, 5172, // 11, 0 - 11, 1, 47453, 11, 2, 6472, 12, 1, 6875, 12, 2, 4736, // 11, 1 - 11, 2, 49147, 11, 3, 5930, 12, 2, 6168, 12, 3, 4291, // 11, 2 - 11, 3, 50843, 11, 4, 5373, 12, 3, 5474, 12, 4, 3846, // 11, 3 - 11, 4, 52484, 11, 5, 4822, 12, 4, 4816, 12, 5, 3414, // 11, 4 - 11, 5, 53975, 11, 6, 4313, 12, 5, 4226, 12, 6, 3022, // 11, 5 - 11, 6, 55166, 11, 7, 3904, 12, 6, 3755, 12, 7, 2711, // 11, 6 - 11, 7, 55870, 11, 8, 3672, 12, 7, 3469, 12, 8, 2525, // 11, 7 - 10, 8, 3473, 10, 9, 2525, 11, 8, 55867, 11, 9, 3671, // 11, 8 - 10, 9, 3759, 10, 10, 2711, 11, 9, 55164, 11, 10, 3902, // 11, 9 - 10, 10, 4230, 10, 11, 3023, 11, 10, 53973, 11, 11, 4310, // 11,10 - 10, 11, 4822, 10, 12, 3415, 11, 11, 52484, 11, 12, 4815, // 11,11 - 10, 12, 5481, 10, 13, 3845, 11, 12, 50844, 11, 13, 5366, // 11,12 - 10, 13, 6176, 10, 14, 4290, 11, 13, 49150, 11, 14, 5920, // 11,13 - 10, 14, 6886, 10, 15, 4734, 11, 14, 47458, 11, 15, 6458, // 11,14 - 10, 15, 7599, 10, 16, 5169, 11, 15, 45799, 11, 16, 6969, // 11,15 - 12, 0, 44901, 12, 1, 7374, 13, 0, 7848, 13, 1, 5413, // 12, 0 - 12, 1, 46427, 12, 2, 6908, 13, 1, 7191, 13, 2, 5010, // 12, 1 - 12, 2, 47953, 12, 3, 6426, 13, 2, 6549, 13, 3, 4608, // 12, 2 - 12, 3, 49445, 12, 4, 5943, 13, 3, 5934, 13, 4, 4214, // 12, 3 - 12, 4, 50844, 12, 5, 5481, 13, 4, 5365, 13, 5, 3846, // 12, 4 - 12, 5, 52069, 12, 6, 5073, 13, 5, 4872, 13, 6, 3522, // 12, 5 - 12, 6, 53012, 12, 7, 4762, 13, 6, 4489, 13, 7, 3273, // 12, 6 - 12, 7, 53562, 12, 8, 4594, 13, 7, 4254, 13, 8, 3126, // 12, 7 - 11, 8, 4259, 11, 9, 3128, 12, 8, 53557, 12, 9, 4592, // 12, 8 - 11, 9, 4495, 11, 10, 3274, 12, 9, 53008, 12, 10, 4759, // 12, 9 - 11, 10, 4879, 11, 11, 3523, 12, 10, 52066, 12, 11, 5068, // 12,10 - 11, 11, 5373, 11, 12, 3846, 12, 11, 50843, 12, 12, 5474, // 12,11 - 11, 12, 5943, 11, 13, 4214, 12, 12, 49445, 12, 13, 5934, // 12,12 - 11, 13, 6560, 11, 14, 4607, 12, 13, 47955, 12, 14, 6414, // 12,13 - 11, 14, 7204, 11, 15, 5009, 12, 14, 46430, 12, 15, 6893, // 12,14 - 11, 15, 7863, 11, 16, 5410, 12, 15, 44907, 12, 16, 7356, // 12,15 - 13, 0, 43900, 13, 1, 7812, 14, 0, 8141, 14, 1, 5683, // 13, 0 - 13, 1, 45286, 13, 2, 7395, 14, 1, 7539, 14, 2, 5316, // 13, 1 - 13, 2, 46650, 13, 3, 6973, 14, 2, 6959, 14, 3, 4954, // 13, 2 - 13, 3, 47955, 13, 4, 6560, 14, 3, 6414, 14, 4, 4607, // 13, 3 - 13, 4, 49150, 13, 5, 6176, 14, 4, 5920, 14, 5, 4290, // 13, 4 - 13, 5, 50171, 13, 6, 5848, 14, 5, 5499, 14, 6, 4018, // 13, 5 - 13, 6, 50942, 13, 7, 5606, 14, 6, 5175, 14, 7, 3813, // 13, 6 - 13, 7, 51395, 13, 8, 5480, 14, 7, 4970, 14, 8, 3691, // 13, 7 - 12, 8, 4978, 12, 9, 3693, 13, 8, 51387, 13, 9, 5478, // 13, 8 - 12, 9, 5184, 12, 10, 3815, 13, 9, 50935, 13, 10, 5602, // 13, 9 - 12, 10, 5508, 12, 11, 4020, 13, 10, 50165, 13, 11, 5843, // 13,10 - 12, 11, 5930, 12, 12, 4291, 13, 11, 49147, 13, 12, 6168, // 13,11 - 12, 12, 6426, 12, 13, 4608, 13, 12, 47953, 13, 13, 6549, // 13,12 - 12, 13, 6973, 12, 14, 4954, 13, 13, 46650, 13, 14, 6959, // 13,13 - 12, 14, 7555, 12, 15, 5315, 13, 14, 45288, 13, 15, 7378, // 13,14 - 12, 15, 8159, 12, 16, 5682, 13, 15, 43904, 13, 16, 7791, // 13,15 - 14, 0, 42821, 14, 1, 8288, 15, 0, 8452, 15, 1, 5975, // 14, 0 - 14, 1, 44074, 14, 2, 7921, 15, 1, 7901, 15, 2, 5640, // 14, 1 - 14, 2, 45288, 14, 3, 7555, 15, 2, 7378, 15, 3, 5315, // 14, 2 - 14, 3, 46430, 14, 4, 7204, 15, 3, 6892, 15, 4, 5010, // 14, 3 - 14, 4, 47458, 14, 5, 6886, 15, 4, 6458, 15, 5, 4734, // 14, 4 - 14, 5, 48322, 14, 6, 6620, 15, 5, 6092, 15, 6, 4502, // 14, 5 - 14, 6, 48969, 14, 7, 6430, 15, 6, 5809, 15, 7, 4328, // 14, 6 - 14, 7, 49358, 14, 8, 6335, 15, 7, 5623, 15, 8, 4220, // 14, 7 - 13, 8, 5633, 13, 9, 4224, 14, 8, 49347, 14, 9, 6332, // 14, 8 - 13, 9, 5820, 13, 10, 4330, 14, 9, 48960, 14, 10, 6426, // 14, 9 - 13, 10, 6104, 13, 11, 4505, 14, 10, 48314, 14, 11, 6613, // 14,10 - 13, 11, 6472, 13, 12, 4736, 14, 11, 47453, 14, 12, 6875, // 14,11 - 13, 12, 6908, 13, 13, 5011, 14, 12, 46427, 14, 13, 7190, // 14,12 - 13, 13, 7395, 13, 14, 5316, 14, 13, 45286, 14, 14, 7539, // 14,13 - 13, 14, 7921, 13, 15, 5640, 14, 14, 44074, 14, 15, 7901, // 14,14 - 13, 15, 8474, 13, 16, 5974, 14, 15, 42823, 14, 16, 8265, // 14,15 - 15, 0, 41693, 15, 1, 8795, 16, 0, 8769, 16, 1, 6279, // 15, 0 - 15, 1, 42823, 15, 2, 8474, 16, 1, 8265, 16, 2, 5974, // 15, 1 - 15, 2, 43904, 15, 3, 8159, 16, 2, 7791, 16, 3, 5682, // 15, 2 - 15, 3, 44907, 15, 4, 7863, 16, 3, 7356, 16, 4, 5410, // 15, 3 - 15, 4, 45799, 15, 5, 7599, 16, 4, 6970, 16, 5, 5168, // 15, 4 - 15, 5, 46541, 15, 6, 7383, 16, 5, 6644, 16, 6, 4968, // 15, 5 - 15, 6, 47098, 15, 7, 7233, 16, 6, 6391, 16, 7, 4814, // 15, 6 - 15, 7, 47440, 15, 8, 7161, 16, 7, 6217, 16, 8, 4718, // 15, 7 - 14, 8, 6230, 14, 9, 4722, 15, 8, 47426, 15, 9, 7158, // 15, 8 - 14, 9, 6405, 14, 10, 4818, 15, 9, 47086, 15, 10, 7227, // 15, 9 - 14, 10, 6659, 14, 11, 4971, 15, 10, 46532, 15, 11, 7374, // 15,10 - 14, 11, 6986, 14, 12, 5172, 15, 11, 45791, 15, 12, 7587, // 15,11 - 14, 12, 7374, 14, 13, 5413, 15, 12, 44901, 15, 13, 7848, // 15,12 - 14, 13, 7812, 14, 14, 5684, 15, 13, 43900, 15, 14, 8140, // 15,13 - 14, 14, 8288, 14, 15, 5975, 15, 14, 42821, 15, 15, 8452, // 15,14 - 14, 15, 8795, 14, 16, 6280, 15, 15, 41693, 15, 16, 8768, // 15,15 - // angle of 1.5 degrees - 0, -1, 11440, 0, 0, 34212, 1, -1, 8358, 1, 0, 11526, // 0, 0 - 0, 0, 11192, 0, 1, 35502, 1, 0, 7987, 1, 1, 10855, // 0, 1 - 0, 1, 10930, 0, 2, 36756, 1, 1, 7626, 1, 2, 10224, // 0, 2 - 0, 2, 10670, 0, 3, 37939, 1, 2, 7285, 1, 3, 9642, // 0, 3 - 0, 3, 10430, 0, 4, 39009, 1, 3, 6975, 1, 4, 9122, // 0, 4 - 0, 4, 10232, 0, 5, 39918, 1, 4, 6710, 1, 5, 8676, // 0, 5 - 0, 5, 10100, 0, 6, 40618, 1, 5, 6502, 1, 6, 8316, // 0, 6 - 0, 6, 10052, 0, 7, 41072, 1, 6, 6360, 1, 7, 8052, // 0, 7 - -1, 7, 6346, -1, 8, 8018, 0, 7, 10066, 0, 8, 41106, // 0, 8 - -1, 8, 6489, -1, 9, 8278, 0, 8, 10123, 0, 9, 40646, // 0, 9 - -1, 9, 6699, -1, 10, 8632, 0, 9, 10265, 0, 10, 39940, // 0,10 - -1, 10, 6965, -1, 11, 9072, 0, 10, 10473, 0, 11, 39026, // 0,11 - -1, 11, 7276, -1, 12, 9585, 0, 11, 10723, 0, 12, 37952, // 0,12 - -1, 12, 7620, -1, 13, 10158, 0, 12, 10994, 0, 13, 36764, // 0,13 - -1, 13, 7983, -1, 14, 10780, 0, 13, 11267, 0, 14, 35506, // 0,14 - -1, 14, 8358, -1, 15, 11440, 0, 14, 11526, 0, 15, 34212, // 0,15 - 1, -1, 10780, 1, 0, 35506, 2, -1, 7983, 2, 0, 11267, // 1, 0 - 1, 0, 10467, 1, 1, 36959, 2, 0, 7579, 2, 1, 10531, // 1, 1 - 1, 1, 10133, 1, 2, 38390, 2, 1, 7179, 2, 2, 9834, // 1, 2 - 1, 2, 9796, 1, 3, 39759, 2, 2, 6797, 2, 3, 9184, // 1, 3 - 1, 3, 9478, 1, 4, 41013, 2, 3, 6447, 2, 4, 8598, // 1, 4 - 1, 4, 9206, 1, 5, 42087, 2, 4, 6145, 2, 5, 8098, // 1, 5 - 1, 5, 9014, 1, 6, 42913, 2, 5, 5910, 2, 6, 7699, // 1, 6 - 1, 6, 8929, 1, 7, 43433, 2, 6, 5756, 2, 7, 7418, // 1, 7 - 0, 7, 5745, 0, 8, 7390, 1, 7, 8939, 1, 8, 43462, // 1, 8 - 0, 8, 5900, 0, 9, 7667, 1, 8, 9032, 1, 9, 42937, // 1, 9 - 0, 9, 6137, 0, 10, 8061, 1, 9, 9233, 1, 10, 42105, // 1,10 - 0, 10, 6440, 0, 11, 8557, 1, 10, 9513, 1, 11, 41026, // 1,11 - 0, 11, 6792, 0, 12, 9135, 1, 11, 9841, 1, 12, 39768, // 1,12 - 0, 12, 7177, 0, 13, 9777, 1, 12, 10188, 1, 13, 38394, // 1,13 - 0, 13, 7579, 0, 14, 10467, 1, 13, 10532, 1, 14, 36958, // 1,14 - 0, 14, 7987, 0, 15, 11192, 1, 14, 10855, 1, 15, 35502, // 1,15 - 2, -1, 10158, 2, 0, 36764, 3, -1, 7620, 3, 0, 10994, // 2, 0 - 2, 0, 9777, 2, 1, 38394, 3, 0, 7177, 3, 1, 10188, // 2, 1 - 2, 1, 9366, 2, 2, 40025, 3, 1, 6732, 3, 2, 9413, // 2, 2 - 2, 2, 8941, 2, 3, 41614, 3, 2, 6299, 3, 3, 8682, // 2, 3 - 2, 3, 8530, 2, 4, 43096, 3, 3, 5895, 3, 4, 8015, // 2, 4 - 2, 4, 8167, 2, 5, 44386, 3, 4, 5543, 3, 5, 7440, // 2, 5 - 2, 5, 7899, 2, 6, 45383, 3, 5, 5268, 3, 6, 6986, // 2, 6 - 2, 6, 7766, 2, 7, 45995, 3, 6, 5095, 3, 7, 6680, // 2, 7 - 1, 7, 5087, 1, 8, 6658, 2, 7, 7773, 2, 8, 46018, // 2, 8 - 1, 8, 5261, 1, 9, 6961, 2, 8, 7913, 2, 9, 45401, // 2, 9 - 1, 9, 5537, 1, 10, 7411, 2, 9, 8189, 2, 10, 44399, // 2,10 - 1, 10, 5891, 1, 11, 7981, 2, 10, 8559, 2, 11, 43105, // 2,11 - 1, 11, 6297, 1, 12, 8641, 2, 11, 8979, 2, 12, 41619, // 2,12 - 1, 12, 6732, 1, 13, 9366, 2, 12, 9413, 2, 13, 40025, // 2,13 - 1, 13, 7179, 1, 14, 10133, 2, 13, 9834, 2, 14, 38390, // 2,14 - 1, 14, 7626, 1, 15, 10930, 2, 14, 10224, 2, 15, 36756, // 2,15 - 3, -1, 9585, 3, 0, 37951, 4, -1, 7276, 4, 0, 10724, // 3, 0 - 3, 0, 9135, 3, 1, 39767, 4, 0, 6792, 4, 1, 9842, // 3, 1 - 3, 1, 8641, 3, 2, 41618, 4, 1, 6297, 4, 2, 8980, // 3, 2 - 3, 2, 8120, 3, 3, 43461, 4, 2, 5804, 4, 3, 8151, // 3, 3 - 3, 3, 7598, 3, 4, 45224, 4, 3, 5331, 4, 4, 7383, // 3, 4 - 3, 4, 7121, 3, 5, 46798, 4, 4, 4909, 4, 5, 6708, // 3, 5 - 3, 5, 6750, 3, 6, 48037, 4, 5, 4576, 4, 6, 6173, // 3, 6 - 3, 6, 6552, 3, 7, 48785, 4, 6, 4372, 4, 7, 5827, // 3, 7 - 2, 7, 4366, 2, 8, 5811, 3, 7, 6558, 3, 8, 48801, // 3, 8 - 2, 8, 4572, 2, 9, 6154, 3, 8, 6761, 3, 9, 48049, // 3, 9 - 2, 9, 4906, 2, 10, 6685, 3, 9, 7138, 3, 10, 46807, // 3,10 - 2, 10, 5330, 2, 11, 7356, 3, 10, 7622, 3, 11, 45228, // 3,11 - 2, 11, 5804, 2, 12, 8120, 3, 11, 8151, 3, 12, 43461, // 3,12 - 2, 12, 6299, 2, 13, 8941, 3, 12, 8681, 3, 13, 41615, // 3,13 - 2, 13, 6797, 2, 14, 9796, 3, 13, 9184, 3, 14, 39759, // 3,14 - 2, 14, 7285, 2, 15, 10670, 3, 14, 9642, 3, 15, 37939, // 3,15 - 4, -1, 9072, 4, 0, 39026, 5, -1, 6965, 5, 0, 10473, // 4, 0 - 4, 0, 8557, 4, 1, 41026, 5, 0, 6440, 5, 1, 9513, // 4, 1 - 4, 1, 7981, 4, 2, 43105, 5, 1, 5891, 5, 2, 8559, // 4, 2 - 4, 2, 7356, 4, 3, 45229, 5, 2, 5330, 5, 3, 7621, // 4, 3 - 4, 3, 6708, 4, 4, 47328, 5, 3, 4774, 5, 4, 6726, // 4, 4 - 4, 4, 6086, 4, 5, 49275, 5, 4, 4258, 5, 5, 5917, // 4, 5 - 4, 5, 5573, 4, 6, 50865, 5, 5, 3837, 5, 6, 5261, // 4, 6 - 4, 6, 5280, 4, 7, 51832, 5, 6, 3579, 5, 7, 4845, // 4, 7 - 3, 7, 3575, 3, 8, 4835, 4, 7, 5283, 4, 8, 51843, // 4, 8 - 3, 8, 3834, 3, 9, 5248, 4, 8, 5581, 4, 9, 50873, // 4, 9 - 3, 9, 4257, 3, 10, 5901, 4, 9, 6099, 4, 10, 49279, // 4,10 - 3, 10, 4774, 3, 11, 6708, 4, 10, 6727, 4, 11, 47327, // 4,11 - 3, 11, 5331, 3, 12, 7598, 4, 11, 7382, 4, 12, 45225, // 4,12 - 3, 12, 5895, 3, 13, 8530, 4, 12, 8015, 4, 13, 43096, // 4,13 - 3, 13, 6447, 3, 14, 9478, 4, 13, 8599, 4, 14, 41012, // 4,14 - 3, 14, 6975, 3, 15, 10430, 4, 14, 9122, 4, 15, 39009, // 4,15 - 5, -1, 8632, 5, 0, 39940, 6, -1, 6699, 6, 0, 10265, // 5, 0 - 5, 0, 8061, 5, 1, 42105, 6, 0, 6137, 6, 1, 9233, // 5, 1 - 5, 1, 7411, 5, 2, 44399, 6, 1, 5537, 6, 2, 8189, // 5, 2 - 5, 2, 6685, 5, 3, 46806, 6, 2, 4906, 6, 3, 7139, // 5, 3 - 5, 3, 5901, 5, 4, 49279, 6, 3, 4257, 6, 4, 6099, // 5, 4 - 5, 4, 5103, 5, 5, 51700, 6, 4, 3621, 6, 5, 5112, // 5, 5 - 5, 5, 4388, 5, 6, 53813, 6, 5, 3065, 6, 6, 4270, // 5, 6 - 5, 6, 3938, 5, 7, 55162, 6, 6, 2710, 6, 7, 3726, // 5, 7 - 4, 7, 2708, 4, 8, 3720, 5, 7, 3940, 5, 8, 55168, // 5, 8 - 4, 8, 3064, 4, 9, 4262, 5, 8, 4394, 5, 9, 53816, // 5, 9 - 4, 9, 3621, 4, 10, 5103, 5, 9, 5113, 5, 10, 51699, // 5,10 - 4, 10, 4258, 4, 11, 6086, 5, 10, 5917, 5, 11, 49275, // 5,11 - 4, 11, 4909, 4, 12, 7121, 5, 11, 6707, 5, 12, 46799, // 5,12 - 4, 12, 5543, 4, 13, 8167, 5, 12, 7440, 5, 13, 44386, // 5,13 - 4, 13, 6145, 4, 14, 9206, 5, 13, 8098, 5, 14, 42087, // 5,14 - 4, 14, 6710, 4, 15, 10232, 5, 14, 8676, 5, 15, 39918, // 5,15 - 6, -1, 8278, 6, 0, 40646, 7, -1, 6489, 7, 0, 10123, // 6, 0 - 6, 0, 7667, 6, 1, 42936, 7, 0, 5900, 7, 1, 9033, // 6, 1 - 6, 1, 6961, 6, 2, 45401, 7, 1, 5261, 7, 2, 7913, // 6, 2 - 6, 2, 6154, 6, 3, 48049, 7, 2, 4572, 7, 3, 6761, // 6, 3 - 6, 3, 5248, 6, 4, 50873, 7, 3, 3834, 7, 4, 5581, // 6, 4 - 6, 4, 4262, 6, 5, 53816, 7, 4, 3064, 7, 5, 4394, // 6, 5 - 6, 5, 3271, 6, 6, 56673, 7, 5, 2316, 7, 6, 3276, // 6, 6 - 6, 6, 2532, 6, 7, 58773, 7, 6, 1767, 7, 7, 2464, // 6, 7 - 5, 7, 1766, 5, 8, 2462, 6, 7, 2533, 6, 8, 58775, // 6, 8 - 5, 8, 2316, 5, 9, 3271, 6, 8, 3275, 6, 9, 56674, // 6, 9 - 5, 9, 3065, 5, 10, 4388, 6, 9, 4269, 6, 10, 53814, // 6,10 - 5, 10, 3837, 5, 11, 5573, 6, 10, 5261, 6, 11, 50865, // 6,11 - 5, 11, 4576, 5, 12, 6750, 6, 11, 6173, 6, 12, 48037, // 6,12 - 5, 12, 5268, 5, 13, 7899, 6, 12, 6986, 6, 13, 45383, // 6,13 - 5, 13, 5910, 5, 14, 9014, 6, 13, 7699, 6, 14, 42913, // 6,14 - 5, 14, 6502, 5, 15, 10100, 6, 14, 8316, 6, 15, 40618, // 6,15 - 7, -1, 8018, 7, 0, 41106, 8, -1, 6346, 8, 0, 10066, // 7, 0 - 7, 0, 7390, 7, 1, 43461, 8, 0, 5745, 8, 1, 8940, // 7, 1 - 7, 1, 6658, 7, 2, 46017, 8, 1, 5087, 8, 2, 7774, // 7, 2 - 7, 2, 5811, 7, 3, 48801, 8, 2, 4366, 8, 3, 6558, // 7, 3 - 7, 3, 4835, 7, 4, 51842, 8, 3, 3575, 8, 4, 5284, // 7, 4 - 7, 4, 3720, 7, 5, 55168, 8, 4, 2708, 8, 5, 3940, // 7, 5 - 7, 5, 2462, 7, 6, 58775, 8, 5, 1766, 8, 6, 2533, // 7, 6 - 7, 6, 1170, 7, 7, 62369, 8, 6, 827, 8, 7, 1170, // 7, 7 - 6, 7, 827, 6, 8, 1170, 7, 7, 1170, 7, 8, 62369, // 7, 8 - 6, 8, 1767, 6, 9, 2532, 7, 8, 2464, 7, 9, 58773, // 7, 9 - 6, 9, 2710, 6, 10, 3938, 7, 9, 3726, 7, 10, 55162, // 7,10 - 6, 10, 3579, 6, 11, 5280, 7, 10, 4846, 7, 11, 51831, // 7,11 - 6, 11, 4372, 6, 12, 6552, 7, 11, 5827, 7, 12, 48785, // 7,12 - 6, 12, 5095, 6, 13, 7766, 7, 12, 6680, 7, 13, 45995, // 7,13 - 6, 13, 5756, 6, 14, 8929, 7, 13, 7418, 7, 14, 43433, // 7,14 - 6, 14, 6360, 6, 15, 10052, 7, 14, 8052, 7, 15, 41072, // 7,15 - 8, 0, 41072, 8, 1, 8052, 9, 0, 10052, 9, 1, 6360, // 8, 0 - 8, 1, 43433, 8, 2, 7418, 9, 1, 8929, 9, 2, 5756, // 8, 1 - 8, 2, 45995, 8, 3, 6680, 9, 2, 7766, 9, 3, 5095, // 8, 2 - 8, 3, 48785, 8, 4, 5827, 9, 3, 6552, 9, 4, 4372, // 8, 3 - 8, 4, 51832, 8, 5, 4846, 9, 4, 5280, 9, 5, 3578, // 8, 4 - 8, 5, 55162, 8, 6, 3726, 9, 5, 3938, 9, 6, 2710, // 8, 5 - 8, 6, 58773, 8, 7, 2464, 9, 6, 2532, 9, 7, 1767, // 8, 6 - 8, 7, 62369, 8, 8, 1170, 9, 7, 1170, 9, 8, 827, // 8, 7 - 7, 8, 1170, 7, 9, 827, 8, 8, 62369, 8, 9, 1170, // 8, 8 - 7, 9, 2533, 7, 10, 1766, 8, 9, 58775, 8, 10, 2462, // 8, 9 - 7, 10, 3940, 7, 11, 2708, 8, 10, 55168, 8, 11, 3720, // 8,10 - 7, 11, 5283, 7, 12, 3575, 8, 11, 51842, 8, 12, 4836, // 8,11 - 7, 12, 6558, 7, 13, 4366, 8, 12, 48801, 8, 13, 5811, // 8,12 - 7, 13, 7773, 7, 14, 5087, 8, 13, 46017, 8, 14, 6659, // 8,13 - 7, 14, 8939, 7, 15, 5745, 8, 14, 43461, 8, 15, 7391, // 8,14 - 7, 15, 10066, 7, 16, 6346, 8, 15, 41106, 8, 16, 8018, // 8,15 - 9, 0, 40618, 9, 1, 8316, 10, 0, 10100, 10, 1, 6502, // 9, 0 - 9, 1, 42913, 9, 2, 7699, 10, 1, 9014, 10, 2, 5910, // 9, 1 - 9, 2, 45383, 9, 3, 6986, 10, 2, 7899, 10, 3, 5268, // 9, 2 - 9, 3, 48037, 9, 4, 6173, 10, 3, 6750, 10, 4, 4576, // 9, 3 - 9, 4, 50865, 9, 5, 5261, 10, 4, 5573, 10, 5, 3837, // 9, 4 - 9, 5, 53813, 9, 6, 4269, 10, 5, 4388, 10, 6, 3066, // 9, 5 - 9, 6, 56673, 9, 7, 3275, 10, 6, 3271, 10, 7, 2317, // 9, 6 - 9, 7, 58775, 9, 8, 2533, 10, 7, 2462, 10, 8, 1766, // 9, 7 - 8, 8, 2464, 8, 9, 1767, 9, 8, 58773, 9, 9, 2532, // 9, 8 - 8, 9, 3275, 8, 10, 2316, 9, 9, 56673, 9, 10, 3272, // 9, 9 - 8, 10, 4394, 8, 11, 3064, 9, 10, 53816, 9, 11, 4262, // 9,10 - 8, 11, 5581, 8, 12, 3834, 9, 11, 50873, 9, 12, 5248, // 9,11 - 8, 12, 6761, 8, 13, 4572, 9, 12, 48049, 9, 13, 6154, // 9,12 - 8, 13, 7913, 8, 14, 5261, 9, 13, 45401, 9, 14, 6961, // 9,13 - 8, 14, 9032, 8, 15, 5900, 9, 14, 42936, 9, 15, 7668, // 9,14 - 8, 15, 10123, 8, 16, 6489, 9, 15, 40646, 9, 16, 8278, // 9,15 - 10, 0, 39918, 10, 1, 8676, 11, 0, 10232, 11, 1, 6710, // 10, 0 - 10, 1, 42087, 10, 2, 8098, 11, 1, 9206, 11, 2, 6145, // 10, 1 - 10, 2, 44386, 10, 3, 7440, 11, 2, 8167, 11, 3, 5543, // 10, 2 - 10, 3, 46798, 10, 4, 6707, 11, 3, 7121, 11, 4, 4910, // 10, 3 - 10, 4, 49275, 10, 5, 5917, 11, 4, 6086, 11, 5, 4258, // 10, 4 - 10, 5, 51700, 10, 6, 5113, 11, 5, 5103, 11, 6, 3620, // 10, 5 - 10, 6, 53816, 10, 7, 4394, 11, 6, 4262, 11, 7, 3064, // 10, 6 - 10, 7, 55168, 10, 8, 3940, 11, 7, 3720, 11, 8, 2708, // 10, 7 - 9, 8, 3726, 9, 9, 2710, 10, 8, 55162, 10, 9, 3938, // 10, 8 - 9, 9, 4269, 9, 10, 3065, 10, 9, 53813, 10, 10, 4389, // 10, 9 - 9, 10, 5113, 9, 11, 3621, 10, 10, 51700, 10, 11, 5102, // 10,10 - 9, 11, 6099, 9, 12, 4257, 10, 11, 49279, 10, 12, 5901, // 10,11 - 9, 12, 7138, 9, 13, 4906, 10, 12, 46806, 10, 13, 6686, // 10,12 - 9, 13, 8189, 9, 14, 5537, 10, 13, 44399, 10, 14, 7411, // 10,13 - 9, 14, 9233, 9, 15, 6137, 10, 14, 42105, 10, 15, 8061, // 10,14 - 9, 15, 10265, 9, 16, 6699, 10, 15, 39940, 10, 16, 8632, // 10,15 - 11, 0, 39009, 11, 1, 9122, 12, 0, 10430, 12, 1, 6975, // 11, 0 - 11, 1, 41013, 11, 2, 8599, 12, 1, 9478, 12, 2, 6446, // 11, 1 - 11, 2, 43096, 11, 3, 8015, 12, 2, 8530, 12, 3, 5895, // 11, 2 - 11, 3, 45224, 11, 4, 7382, 12, 3, 7598, 12, 4, 5332, // 11, 3 - 11, 4, 47328, 11, 5, 6727, 12, 4, 6708, 12, 5, 4773, // 11, 4 - 11, 5, 49279, 11, 6, 6099, 12, 5, 5901, 12, 6, 4257, // 11, 5 - 11, 6, 50873, 11, 7, 5581, 12, 6, 5248, 12, 7, 3834, // 11, 6 - 11, 7, 51842, 11, 8, 5283, 12, 7, 4835, 12, 8, 3576, // 11, 7 - 10, 8, 4846, 10, 9, 3579, 11, 8, 51832, 11, 9, 5279, // 11, 8 - 10, 9, 5261, 10, 10, 3837, 11, 9, 50865, 11, 10, 5573, // 11, 9 - 10, 10, 5917, 10, 11, 4258, 11, 10, 49275, 11, 11, 6086, // 11,10 - 10, 11, 6727, 10, 12, 4774, 11, 11, 47328, 11, 12, 6707, // 11,11 - 10, 12, 7622, 10, 13, 5330, 11, 12, 45229, 11, 13, 7355, // 11,12 - 10, 13, 8559, 10, 14, 5891, 11, 13, 43105, 11, 14, 7981, // 11,13 - 10, 14, 9513, 10, 15, 6440, 11, 14, 41026, 11, 15, 8557, // 11,14 - 10, 15, 10473, 10, 16, 6965, 11, 15, 39026, 11, 16, 9072, // 11,15 - 12, 0, 37939, 12, 1, 9642, 13, 0, 10670, 13, 1, 7285, // 12, 0 - 12, 1, 39759, 12, 2, 9184, 13, 1, 9796, 13, 2, 6797, // 12, 1 - 12, 2, 41614, 12, 3, 8681, 13, 2, 8941, 13, 3, 6300, // 12, 2 - 12, 3, 43461, 12, 4, 8151, 13, 3, 8120, 13, 4, 5804, // 12, 3 - 12, 4, 45229, 12, 5, 7622, 13, 4, 7356, 13, 5, 5329, // 12, 4 - 12, 5, 46806, 12, 6, 7138, 13, 5, 6685, 13, 6, 4907, // 12, 5 - 12, 6, 48049, 12, 7, 6761, 13, 6, 6154, 13, 7, 4572, // 12, 6 - 12, 7, 48801, 12, 8, 6558, 13, 7, 5811, 13, 8, 4366, // 12, 7 - 11, 8, 5827, 11, 9, 4372, 12, 8, 48785, 12, 9, 6552, // 12, 8 - 11, 9, 6173, 11, 10, 4576, 12, 9, 48037, 12, 10, 6750, // 12, 9 - 11, 10, 6707, 11, 11, 4909, 12, 10, 46798, 12, 11, 7122, // 12,10 - 11, 11, 7382, 11, 12, 5331, 12, 11, 45224, 12, 12, 7599, // 12,11 - 11, 12, 8151, 11, 13, 5804, 12, 12, 43461, 12, 13, 8120, // 12,12 - 11, 13, 8979, 11, 14, 6297, 12, 13, 41618, 12, 14, 8642, // 12,13 - 11, 14, 9841, 11, 15, 6792, 12, 14, 39767, 12, 15, 9136, // 12,14 - 11, 15, 10723, 11, 16, 7276, 12, 15, 37951, 12, 16, 9586, // 12,15 - 13, 0, 36756, 13, 1, 10224, 14, 0, 10930, 14, 1, 7626, // 13, 0 - 13, 1, 38390, 13, 2, 9834, 14, 1, 10133, 14, 2, 7179, // 13, 1 - 13, 2, 40025, 13, 3, 9413, 14, 2, 9366, 14, 3, 6732, // 13, 2 - 13, 3, 41618, 13, 4, 8979, 14, 3, 8641, 14, 4, 6298, // 13, 3 - 13, 4, 43105, 13, 5, 8559, 14, 4, 7981, 14, 5, 5891, // 13, 4 - 13, 5, 44399, 13, 6, 8189, 14, 5, 7411, 14, 6, 5537, // 13, 5 - 13, 6, 45401, 13, 7, 7913, 14, 6, 6961, 14, 7, 5261, // 13, 6 - 13, 7, 46017, 13, 8, 7773, 14, 7, 6658, 14, 8, 5088, // 13, 7 - 12, 8, 6680, 12, 9, 5095, 13, 8, 45995, 13, 9, 7766, // 13, 8 - 12, 9, 6986, 12, 10, 5268, 13, 9, 45383, 13, 10, 7899, // 13, 9 - 12, 10, 7440, 12, 11, 5543, 13, 10, 44386, 13, 11, 8167, // 13,10 - 12, 11, 8015, 12, 12, 5895, 13, 11, 43096, 13, 12, 8530, // 13,11 - 12, 12, 8681, 12, 13, 6299, 13, 12, 41614, 13, 13, 8942, // 13,12 - 12, 13, 9413, 12, 14, 6732, 13, 13, 40025, 13, 14, 9366, // 13,13 - 12, 14, 10188, 12, 15, 7177, 13, 14, 38394, 13, 15, 9777, // 13,14 - 12, 15, 10994, 12, 16, 7620, 13, 15, 36764, 13, 16, 10158, // 13,15 - 14, 0, 35502, 14, 1, 10855, 15, 0, 11192, 15, 1, 7987, // 14, 0 - 14, 1, 36959, 14, 2, 10532, 15, 1, 10467, 15, 2, 7578, // 14, 1 - 14, 2, 38394, 14, 3, 10188, 15, 2, 9777, 15, 3, 7177, // 14, 2 - 14, 3, 39767, 14, 4, 9841, 15, 3, 9135, 15, 4, 6793, // 14, 3 - 14, 4, 41026, 14, 5, 9513, 15, 4, 8557, 15, 5, 6440, // 14, 4 - 14, 5, 42105, 14, 6, 9233, 15, 5, 8061, 15, 6, 6137, // 14, 5 - 14, 6, 42936, 14, 7, 9032, 15, 6, 7667, 15, 7, 5901, // 14, 6 - 14, 7, 43461, 14, 8, 8939, 15, 7, 7390, 15, 8, 5746, // 14, 7 - 13, 8, 7418, 13, 9, 5756, 14, 8, 43433, 14, 9, 8929, // 14, 8 - 13, 9, 7699, 13, 10, 5910, 14, 9, 42913, 14, 10, 9014, // 14, 9 - 13, 10, 8098, 13, 11, 6145, 14, 10, 42087, 14, 11, 9206, // 14,10 - 13, 11, 8599, 13, 12, 6447, 14, 11, 41013, 14, 12, 9477, // 14,11 - 13, 12, 9184, 13, 13, 6797, 14, 12, 39759, 14, 13, 9796, // 14,12 - 13, 13, 9834, 13, 14, 7179, 14, 13, 38390, 14, 14, 10133, // 14,13 - 13, 14, 10532, 13, 15, 7579, 14, 14, 36959, 14, 15, 10466, // 14,14 - 13, 15, 11267, 13, 16, 7983, 14, 15, 35506, 14, 16, 10780, // 14,15 - 15, 0, 34212, 15, 1, 11526, 16, 0, 11440, 16, 1, 8358, // 15, 0 - 15, 1, 35506, 15, 2, 11267, 16, 1, 10780, 16, 2, 7983, // 15, 1 - 15, 2, 36764, 15, 3, 10994, 16, 2, 10158, 16, 3, 7620, // 15, 2 - 15, 3, 37951, 15, 4, 10723, 16, 3, 9585, 16, 4, 7277, // 15, 3 - 15, 4, 39026, 15, 5, 10473, 16, 4, 9072, 16, 5, 6965, // 15, 4 - 15, 5, 39940, 15, 6, 10265, 16, 5, 8632, 16, 6, 6699, // 15, 5 - 15, 6, 40646, 15, 7, 10123, 16, 6, 8278, 16, 7, 6489, // 15, 6 - 15, 7, 41106, 15, 8, 10066, 16, 7, 8018, 16, 8, 6346, // 15, 7 - 14, 8, 8052, 14, 9, 6360, 15, 8, 41072, 15, 9, 10052, // 15, 8 - 14, 9, 8316, 14, 10, 6502, 15, 9, 40618, 15, 10, 10100, // 15, 9 - 14, 10, 8676, 14, 11, 6710, 15, 10, 39918, 15, 11, 10232, // 15,10 - 14, 11, 9122, 14, 12, 6975, 15, 11, 39009, 15, 12, 10430, // 15,11 - 14, 12, 9642, 14, 13, 7285, 15, 12, 37939, 15, 13, 10670, // 15,12 - 14, 13, 10224, 14, 14, 7626, 15, 13, 36756, 15, 14, 10930, // 15,13 - 14, 14, 10855, 14, 15, 7987, 15, 14, 35502, 15, 15, 11192, // 15,14 - 14, 15, 11526, 14, 16, 8358, 15, 15, 34212, 15, 16, 11440, // 15,15 - // angle of 2.0 degrees - 0, -1, 13368, 0, 0, 28495, 1, -1, 10104, 1, 0, 13569, // 0, 0 - 0, 0, 13291, 0, 1, 29828, 1, 0, 9671, 1, 1, 12746, // 0, 1 - 0, 1, 13176, 0, 2, 31138, 1, 1, 9245, 1, 2, 11977, // 0, 2 - 0, 2, 13038, 0, 3, 32391, 1, 2, 8838, 1, 3, 11269, // 0, 3 - 0, 3, 12899, 0, 4, 33539, 1, 3, 8463, 1, 4, 10635, // 0, 4 - 0, 4, 12783, 0, 5, 34532, 1, 4, 8135, 1, 5, 10086, // 0, 5 - 0, 5, 12717, 0, 6, 35315, 1, 5, 7868, 1, 6, 9636, // 0, 6 - 0, 6, 12728, 0, 7, 35844, 1, 6, 7674, 1, 7, 9290, // 0, 7 - -1, 7, 7643, -1, 8, 9224, 0, 7, 12764, 0, 8, 35905, // 0, 8 - -1, 8, 7839, -1, 9, 9558, 0, 8, 12777, 0, 9, 35362, // 0, 9 - -1, 9, 8107, -1, 10, 9995, 0, 9, 12867, 0, 10, 34567, // 0,10 - -1, 10, 8438, -1, 11, 10528, 0, 10, 13007, 0, 11, 33563, // 0,11 - -1, 11, 8816, -1, 12, 11143, 0, 11, 13171, 0, 12, 32406, // 0,12 - -1, 12, 9229, -1, 13, 11829, 0, 12, 13332, 0, 13, 31146, // 0,13 - -1, 13, 9662, -1, 14, 12574, 0, 13, 13470, 0, 14, 29830, // 0,14 - -1, 14, 10104, -1, 15, 13368, 0, 14, 13569, 0, 15, 28495, // 0,15 - 1, -1, 12574, 1, 0, 29831, 2, -1, 9662, 2, 0, 13469, // 1, 0 - 1, 0, 12412, 1, 1, 31358, 2, 0, 9202, 2, 1, 12564, // 1, 1 - 1, 1, 12203, 1, 2, 32881, 2, 1, 8742, 2, 2, 11710, // 1, 2 - 1, 2, 11964, 1, 3, 34358, 2, 2, 8296, 2, 3, 10918, // 1, 3 - 1, 3, 11721, 1, 4, 35730, 2, 3, 7881, 2, 4, 10204, // 1, 4 - 1, 4, 11507, 1, 5, 36926, 2, 4, 7517, 2, 5, 9586, // 1, 5 - 1, 5, 11360, 1, 6, 37866, 2, 5, 7224, 2, 6, 9086, // 1, 6 - 1, 6, 11317, 1, 7, 38481, 2, 6, 7020, 2, 7, 8718, // 1, 7 - 0, 7, 6997, 0, 8, 8662, 1, 7, 11344, 1, 8, 38533, // 1, 8 - 0, 8, 7202, 0, 9, 9020, 1, 8, 11407, 1, 9, 37907, // 1, 9 - 0, 9, 7497, 0, 10, 9509, 1, 9, 11575, 1, 10, 36955, // 1,10 - 0, 10, 7865, 0, 11, 10111, 1, 10, 11810, 1, 11, 35750, // 1,11 - 0, 11, 8284, 0, 12, 10808, 1, 11, 12074, 1, 12, 34370, // 1,12 - 0, 12, 8735, 0, 13, 11580, 1, 12, 12334, 1, 13, 32887, // 1,13 - 0, 13, 9202, 0, 14, 12412, 1, 13, 12564, 1, 14, 31358, // 1,14 - 0, 14, 9671, 0, 15, 13291, 1, 14, 12746, 1, 15, 29828, // 1,15 - 2, -1, 11829, 2, 0, 31146, 3, -1, 9229, 3, 0, 13332, // 2, 0 - 2, 0, 11580, 2, 1, 32886, 3, 0, 8735, 3, 1, 12335, // 2, 1 - 2, 1, 11272, 2, 2, 34650, 3, 1, 8232, 3, 2, 11382, // 2, 2 - 2, 2, 10922, 2, 3, 36392, 3, 2, 7734, 3, 3, 10488, // 2, 3 - 2, 3, 10559, 2, 4, 38042, 3, 3, 7261, 3, 4, 9674, // 2, 4 - 2, 4, 10226, 2, 5, 39503, 3, 4, 6842, 3, 5, 8965, // 2, 5 - 2, 5, 9977, 2, 6, 40656, 3, 5, 6506, 3, 6, 8397, // 2, 6 - 2, 6, 9867, 2, 7, 41389, 3, 6, 6284, 3, 7, 7996, // 2, 7 - 1, 7, 6266, 1, 8, 7951, 2, 7, 9886, 2, 8, 41433, // 2, 8 - 1, 8, 6491, 1, 9, 8344, 2, 8, 10013, 2, 9, 40688, // 2, 9 - 1, 9, 6829, 1, 10, 8902, 2, 9, 10279, 2, 10, 39526, // 2,10 - 1, 10, 7252, 1, 11, 9597, 2, 10, 10630, 2, 11, 38057, // 2,11 - 1, 11, 7728, 1, 12, 10397, 2, 11, 11012, 2, 12, 36399, // 2,12 - 1, 12, 8232, 1, 13, 11272, 2, 12, 11382, 2, 13, 34650, // 2,13 - 1, 13, 8742, 1, 14, 12203, 2, 13, 11709, 2, 14, 32882, // 2,14 - 1, 14, 9245, 1, 15, 13176, 2, 14, 11977, 2, 15, 31138, // 2,15 - 3, -1, 11143, 3, 0, 32406, 4, -1, 8816, 4, 0, 13171, // 3, 0 - 3, 0, 10808, 3, 1, 34369, 4, 0, 8284, 4, 1, 12075, // 3, 1 - 3, 1, 10397, 3, 2, 36399, 4, 1, 7728, 4, 2, 11012, // 3, 2 - 3, 2, 9924, 3, 3, 38450, 4, 2, 7164, 4, 3, 9998, // 3, 3 - 3, 3, 9421, 3, 4, 40444, 4, 3, 6615, 4, 4, 9056, // 3, 4 - 3, 4, 8940, 3, 5, 42256, 4, 4, 6116, 4, 5, 8224, // 3, 5 - 3, 5, 8558, 3, 6, 43710, 4, 5, 5712, 4, 6, 7556, // 3, 6 - 3, 6, 8359, 3, 7, 44616, 4, 6, 5454, 4, 7, 7107, // 3, 7 - 2, 7, 5443, 2, 8, 7072, 3, 7, 8373, 3, 8, 44648, // 3, 8 - 2, 8, 5703, 2, 9, 7516, 3, 8, 8584, 3, 9, 43733, // 3, 9 - 2, 9, 6108, 2, 10, 8175, 3, 9, 8982, 3, 10, 42271, // 3,10 - 2, 10, 6611, 2, 11, 8995, 3, 10, 9478, 3, 11, 40452, // 3,11 - 2, 11, 7164, 2, 12, 9924, 3, 11, 9998, 3, 12, 38450, // 3,12 - 2, 12, 7734, 2, 13, 10922, 3, 12, 10488, 3, 13, 36392, // 3,13 - 2, 13, 8296, 2, 14, 11964, 3, 13, 10918, 3, 14, 34358, // 3,14 - 2, 14, 8838, 2, 15, 13038, 3, 14, 11269, 3, 15, 32391, // 3,15 - 4, -1, 10528, 4, 0, 33564, 5, -1, 8438, 5, 0, 13006, // 4, 0 - 4, 0, 10111, 4, 1, 35750, 5, 0, 7865, 5, 1, 11810, // 4, 1 - 4, 1, 9597, 4, 2, 38057, 5, 1, 7252, 5, 2, 10630, // 4, 2 - 4, 2, 8995, 4, 3, 40452, 5, 2, 6611, 5, 3, 9478, // 4, 3 - 4, 3, 8332, 4, 4, 42861, 5, 3, 5965, 5, 4, 8378, // 4, 4 - 4, 4, 7667, 4, 5, 45139, 5, 4, 5353, 5, 5, 7377, // 4, 5 - 4, 5, 7100, 4, 6, 47035, 5, 5, 4843, 5, 6, 6558, // 4, 6 - 4, 6, 6774, 4, 7, 48218, 5, 6, 4521, 5, 7, 6023, // 4, 7 - 3, 7, 4513, 3, 8, 6000, 4, 7, 6783, 4, 8, 48240, // 4, 8 - 3, 8, 4838, 3, 9, 6530, 4, 8, 7119, 4, 9, 47049, // 4, 9 - 3, 9, 5350, 3, 10, 7342, 4, 9, 7698, 4, 10, 45146, // 4,10 - 3, 10, 5965, 3, 11, 8332, 4, 10, 8378, 4, 11, 42861, // 4,11 - 3, 11, 6615, 3, 12, 9421, 4, 11, 9056, 4, 12, 40444, // 4,12 - 3, 12, 7261, 3, 13, 10559, 4, 12, 9674, 4, 13, 38042, // 4,13 - 3, 13, 7881, 3, 14, 11721, 4, 13, 10204, 4, 14, 35730, // 4,14 - 3, 14, 8463, 3, 15, 12899, 4, 14, 10635, 4, 15, 33539, // 4,15 - 5, -1, 9995, 5, 0, 34567, 6, -1, 8107, 6, 0, 12867, // 5, 0 - 5, 0, 9509, 5, 1, 36955, 6, 0, 7497, 6, 1, 11575, // 5, 1 - 5, 1, 8902, 5, 2, 39526, 6, 1, 6829, 6, 2, 10279, // 5, 2 - 5, 2, 8175, 5, 3, 42271, 6, 2, 6108, 6, 3, 8982, // 5, 3 - 5, 3, 7342, 5, 4, 45146, 6, 3, 5350, 6, 4, 7698, // 5, 4 - 5, 4, 6451, 5, 5, 48019, 6, 4, 4591, 6, 5, 6475, // 5, 5 - 5, 5, 5624, 5, 6, 50581, 6, 5, 3913, 6, 6, 5418, // 5, 6 - 5, 6, 5092, 5, 7, 52253, 6, 6, 3470, 6, 7, 4721, // 5, 7 - 4, 7, 3466, 4, 8, 4708, 5, 7, 5097, 5, 8, 52265, // 5, 8 - 4, 8, 3911, 4, 9, 5400, 5, 8, 5637, 5, 9, 50588, // 5, 9 - 4, 9, 4591, 4, 10, 6451, 5, 9, 6475, 5, 10, 48019, // 5,10 - 4, 10, 5353, 4, 11, 7667, 5, 10, 7377, 5, 11, 45139, // 5,11 - 4, 11, 6116, 4, 12, 8940, 5, 11, 8224, 5, 12, 42256, // 5,12 - 4, 12, 6842, 4, 13, 10226, 5, 12, 8966, 5, 13, 39502, // 5,13 - 4, 13, 7517, 4, 14, 11507, 5, 13, 9587, 5, 14, 36925, // 5,14 - 4, 14, 8135, 4, 15, 12783, 5, 14, 10086, 5, 15, 34532, // 5,15 - 6, -1, 9558, 6, 0, 35362, 7, -1, 7839, 7, 0, 12777, // 6, 0 - 6, 0, 9020, 6, 1, 37906, 7, 0, 7202, 7, 1, 11408, // 6, 1 - 6, 1, 8344, 6, 2, 40688, 7, 1, 6491, 7, 2, 10013, // 6, 2 - 6, 2, 7516, 6, 3, 43733, 7, 2, 5703, 7, 3, 8584, // 6, 3 - 6, 3, 6530, 6, 4, 47049, 7, 3, 4838, 7, 4, 7119, // 6, 4 - 6, 4, 5400, 6, 5, 50587, 7, 4, 3911, 7, 5, 5638, // 6, 5 - 6, 5, 4217, 6, 6, 54105, 7, 5, 2989, 7, 6, 4225, // 6, 6 - 6, 6, 3303, 6, 7, 56751, 7, 6, 2295, 7, 7, 3187, // 6, 7 - 5, 7, 2294, 5, 8, 3180, 6, 7, 3306, 6, 8, 56756, // 6, 8 - 5, 8, 2989, 5, 9, 4217, 6, 8, 4225, 6, 9, 54105, // 6, 9 - 5, 9, 3913, 5, 10, 5624, 6, 9, 5418, 6, 10, 50581, // 6,10 - 5, 10, 4843, 5, 11, 7100, 6, 10, 6558, 6, 11, 47035, // 6,11 - 5, 11, 5712, 5, 12, 8558, 6, 11, 7556, 6, 12, 43710, // 6,12 - 5, 12, 6506, 5, 13, 9977, 6, 12, 8397, 6, 13, 40656, // 6,13 - 5, 13, 7224, 5, 14, 11360, 6, 13, 9086, 6, 14, 37866, // 6,14 - 5, 14, 7868, 5, 15, 12717, 6, 14, 9635, 6, 15, 35316, // 6,15 - 7, -1, 9224, 7, 0, 35905, 8, -1, 7643, 8, 0, 12764, // 7, 0 - 7, 0, 8662, 7, 1, 38534, 8, 0, 6997, 8, 1, 11343, // 7, 1 - 7, 1, 7951, 7, 2, 41432, 8, 1, 6266, 8, 2, 9887, // 7, 2 - 7, 2, 7072, 7, 3, 44649, 8, 2, 5443, 8, 3, 8372, // 7, 3 - 7, 3, 6000, 7, 4, 48240, 8, 3, 4513, 8, 4, 6783, // 7, 4 - 7, 4, 4708, 7, 5, 52266, 8, 4, 3466, 8, 5, 5096, // 7, 5 - 7, 5, 3180, 7, 6, 56756, 8, 5, 2294, 8, 6, 3306, // 7, 6 - 7, 6, 1541, 7, 7, 61364, 8, 6, 1090, 8, 7, 1541, // 7, 7 - 6, 7, 1090, 6, 8, 1541, 7, 7, 1542, 7, 8, 61363, // 7, 8 - 6, 8, 2295, 6, 9, 3303, 7, 8, 3186, 7, 9, 56752, // 7, 9 - 6, 9, 3470, 6, 10, 5092, 7, 9, 4721, 7, 10, 52253, // 7,10 - 6, 10, 4521, 6, 11, 6774, 7, 10, 6023, 7, 11, 48218, // 7,11 - 6, 11, 5454, 6, 12, 8359, 7, 11, 7106, 7, 12, 44617, // 7,12 - 6, 12, 6284, 6, 13, 9867, 7, 12, 7996, 7, 13, 41389, // 7,13 - 6, 13, 7020, 6, 14, 11317, 7, 13, 8718, 7, 14, 38481, // 7,14 - 6, 14, 7674, 6, 15, 12728, 7, 14, 9290, 7, 15, 35844, // 7,15 - 8, 0, 35844, 8, 1, 9290, 9, 0, 12728, 9, 1, 7674, // 8, 0 - 8, 1, 38481, 8, 2, 8718, 9, 1, 11317, 9, 2, 7020, // 8, 1 - 8, 2, 41389, 8, 3, 7996, 9, 2, 9867, 9, 3, 6284, // 8, 2 - 8, 3, 44616, 8, 4, 7106, 9, 3, 8359, 9, 4, 5455, // 8, 3 - 8, 4, 48218, 8, 5, 6023, 9, 4, 6774, 9, 5, 4521, // 8, 4 - 8, 5, 52253, 8, 6, 4721, 9, 5, 5092, 9, 6, 3470, // 8, 5 - 8, 6, 56751, 8, 7, 3186, 9, 6, 3303, 9, 7, 2296, // 8, 6 - 8, 7, 61364, 8, 8, 1542, 9, 7, 1541, 9, 8, 1089, // 8, 7 - 7, 8, 1542, 7, 9, 1090, 8, 8, 61364, 8, 9, 1540, // 8, 8 - 7, 9, 3306, 7, 10, 2294, 8, 9, 56756, 8, 10, 3180, // 8, 9 - 7, 10, 5097, 7, 11, 3466, 8, 10, 52266, 8, 11, 4707, // 8,10 - 7, 11, 6783, 7, 12, 4513, 8, 11, 48240, 8, 12, 6000, // 8,11 - 7, 12, 8373, 7, 13, 5443, 8, 12, 44649, 8, 13, 7071, // 8,12 - 7, 13, 9886, 7, 14, 6266, 8, 13, 41432, 8, 14, 7952, // 8,13 - 7, 14, 11344, 7, 15, 6997, 8, 14, 38534, 8, 15, 8661, // 8,14 - 7, 15, 12764, 7, 16, 7643, 8, 15, 35905, 8, 16, 9224, // 8,15 - 9, 0, 35315, 9, 1, 9635, 10, 0, 12717, 10, 1, 7869, // 9, 0 - 9, 1, 37866, 9, 2, 9086, 10, 1, 11360, 10, 2, 7224, // 9, 1 - 9, 2, 40656, 9, 3, 8397, 10, 2, 9977, 10, 3, 6506, // 9, 2 - 9, 3, 43710, 9, 4, 7556, 10, 3, 8558, 10, 4, 5712, // 9, 3 - 9, 4, 47035, 9, 5, 6558, 10, 4, 7100, 10, 5, 4843, // 9, 4 - 9, 5, 50581, 9, 6, 5418, 10, 5, 5624, 10, 6, 3913, // 9, 5 - 9, 6, 54105, 9, 7, 4225, 10, 6, 4217, 10, 7, 2989, // 9, 6 - 9, 7, 56756, 9, 8, 3306, 10, 7, 3180, 10, 8, 2294, // 9, 7 - 8, 8, 3186, 8, 9, 2295, 9, 8, 56751, 9, 9, 3304, // 9, 8 - 8, 9, 4225, 8, 10, 2989, 9, 9, 54105, 9, 10, 4217, // 9, 9 - 8, 10, 5637, 8, 11, 3911, 9, 10, 50587, 9, 11, 5401, // 9,10 - 8, 11, 7119, 8, 12, 4838, 9, 11, 47049, 9, 12, 6530, // 9,11 - 8, 12, 8584, 8, 13, 5703, 9, 12, 43733, 9, 13, 7516, // 9,12 - 8, 13, 10013, 8, 14, 6491, 9, 13, 40688, 9, 14, 8344, // 9,13 - 8, 14, 11407, 8, 15, 7202, 9, 14, 37906, 9, 15, 9021, // 9,14 - 8, 15, 12777, 8, 16, 7839, 9, 15, 35362, 9, 16, 9558, // 9,15 - 10, 0, 34532, 10, 1, 10086, 11, 0, 12783, 11, 1, 8135, // 10, 0 - 10, 1, 36926, 10, 2, 9587, 11, 1, 11507, 11, 2, 7516, // 10, 1 - 10, 2, 39503, 10, 3, 8966, 11, 2, 10226, 11, 3, 6841, // 10, 2 - 10, 3, 42256, 10, 4, 8224, 11, 3, 8940, 11, 4, 6116, // 10, 3 - 10, 4, 45139, 10, 5, 7377, 11, 4, 7667, 11, 5, 5353, // 10, 4 - 10, 5, 48019, 10, 6, 6475, 11, 5, 6451, 11, 6, 4591, // 10, 5 - 10, 6, 50587, 10, 7, 5637, 11, 6, 5400, 11, 7, 3912, // 10, 6 - 10, 7, 52266, 10, 8, 5097, 11, 7, 4708, 11, 8, 3465, // 10, 7 - 9, 8, 4721, 9, 9, 3470, 10, 8, 52253, 10, 9, 5092, // 10, 8 - 9, 9, 5418, 9, 10, 3913, 10, 9, 50581, 10, 10, 5624, // 10, 9 - 9, 10, 6475, 9, 11, 4591, 10, 10, 48019, 10, 11, 6451, // 10,10 - 9, 11, 7698, 9, 12, 5350, 10, 11, 45146, 10, 12, 7342, // 10,11 - 9, 12, 8982, 9, 13, 6108, 10, 12, 42271, 10, 13, 8175, // 10,12 - 9, 13, 10279, 9, 14, 6829, 10, 13, 39526, 10, 14, 8902, // 10,13 - 9, 14, 11575, 9, 15, 7497, 10, 14, 36955, 10, 15, 9509, // 10,14 - 9, 15, 12867, 9, 16, 8107, 10, 15, 34567, 10, 16, 9995, // 10,15 - 11, 0, 33539, 11, 1, 10635, 12, 0, 12899, 12, 1, 8463, // 11, 0 - 11, 1, 35730, 11, 2, 10204, 12, 1, 11721, 12, 2, 7881, // 11, 1 - 11, 2, 38042, 11, 3, 9674, 12, 2, 10559, 12, 3, 7261, // 11, 2 - 11, 3, 40444, 11, 4, 9056, 12, 3, 9421, 12, 4, 6615, // 11, 3 - 11, 4, 42861, 11, 5, 8378, 12, 4, 8332, 12, 5, 5965, // 11, 4 - 11, 5, 45146, 11, 6, 7698, 12, 5, 7342, 12, 6, 5350, // 11, 5 - 11, 6, 47049, 11, 7, 7119, 12, 6, 6530, 12, 7, 4838, // 11, 6 - 11, 7, 48240, 11, 8, 6783, 12, 7, 6000, 12, 8, 4513, // 11, 7 - 10, 8, 6023, 10, 9, 4521, 11, 8, 48218, 11, 9, 6774, // 11, 8 - 10, 9, 6558, 10, 10, 4843, 11, 9, 47035, 11, 10, 7100, // 11, 9 - 10, 10, 7377, 10, 11, 5353, 11, 10, 45139, 11, 11, 7667, // 11,10 - 10, 11, 8378, 10, 12, 5965, 11, 11, 42861, 11, 12, 8332, // 11,11 - 10, 12, 9478, 10, 13, 6611, 11, 12, 40452, 11, 13, 8995, // 11,12 - 10, 13, 10630, 10, 14, 7252, 11, 13, 38057, 11, 14, 9597, // 11,13 - 10, 14, 11810, 10, 15, 7865, 11, 14, 35750, 11, 15, 10111, // 11,14 - 10, 15, 13007, 10, 16, 8438, 11, 15, 33564, 11, 16, 10527, // 11,15 - 12, 0, 32391, 12, 1, 11269, 13, 0, 13038, 13, 1, 8838, // 12, 0 - 12, 1, 34358, 12, 2, 10918, 13, 1, 11964, 13, 2, 8296, // 12, 1 - 12, 2, 36392, 12, 3, 10488, 13, 2, 10922, 13, 3, 7734, // 12, 2 - 12, 3, 38450, 12, 4, 9998, 13, 3, 9924, 13, 4, 7164, // 12, 3 - 12, 4, 40452, 12, 5, 9478, 13, 4, 8995, 13, 5, 6611, // 12, 4 - 12, 5, 42271, 12, 6, 8982, 13, 5, 8175, 13, 6, 6108, // 12, 5 - 12, 6, 43733, 12, 7, 8584, 13, 6, 7516, 13, 7, 5703, // 12, 6 - 12, 7, 44649, 12, 8, 8373, 13, 7, 7072, 13, 8, 5442, // 12, 7 - 11, 8, 7106, 11, 9, 5454, 12, 8, 44616, 12, 9, 8360, // 12, 8 - 11, 9, 7556, 11, 10, 5712, 12, 9, 43710, 12, 10, 8558, // 12, 9 - 11, 10, 8224, 11, 11, 6116, 12, 10, 42256, 12, 11, 8940, // 12,10 - 11, 11, 9056, 11, 12, 6615, 12, 11, 40444, 12, 12, 9421, // 12,11 - 11, 12, 9998, 11, 13, 7164, 12, 12, 38450, 12, 13, 9924, // 12,12 - 11, 13, 11012, 11, 14, 7728, 12, 13, 36399, 12, 14, 10397, // 12,13 - 11, 14, 12074, 11, 15, 8284, 12, 14, 34369, 12, 15, 10809, // 12,14 - 11, 15, 13171, 11, 16, 8816, 12, 15, 32406, 12, 16, 11143, // 12,15 - 13, 0, 31138, 13, 1, 11977, 14, 0, 13176, 14, 1, 9245, // 13, 0 - 13, 1, 32881, 13, 2, 11709, 14, 1, 12203, 14, 2, 8743, // 13, 1 - 13, 2, 34650, 13, 3, 11382, 14, 2, 11272, 14, 3, 8232, // 13, 2 - 13, 3, 36399, 13, 4, 11012, 14, 3, 10397, 14, 4, 7728, // 13, 3 - 13, 4, 38057, 13, 5, 10630, 14, 4, 9597, 14, 5, 7252, // 13, 4 - 13, 5, 39526, 13, 6, 10279, 14, 5, 8902, 14, 6, 6829, // 13, 5 - 13, 6, 40688, 13, 7, 10013, 14, 6, 8344, 14, 7, 6491, // 13, 6 - 13, 7, 41432, 13, 8, 9886, 14, 7, 7951, 14, 8, 6267, // 13, 7 - 12, 8, 7996, 12, 9, 6284, 13, 8, 41389, 13, 9, 9867, // 13, 8 - 12, 9, 8397, 12, 10, 6506, 13, 9, 40656, 13, 10, 9977, // 13, 9 - 12, 10, 8966, 12, 11, 6842, 13, 10, 39503, 13, 11, 10225, // 13,10 - 12, 11, 9674, 12, 12, 7261, 13, 11, 38042, 13, 12, 10559, // 13,11 - 12, 12, 10488, 12, 13, 7734, 13, 12, 36392, 13, 13, 10922, // 13,12 - 12, 13, 11382, 12, 14, 8232, 13, 13, 34650, 13, 14, 11272, // 13,13 - 12, 14, 12334, 12, 15, 8735, 13, 14, 32886, 13, 15, 11581, // 13,14 - 12, 15, 13332, 12, 16, 9229, 13, 15, 31146, 13, 16, 11829, // 13,15 - 14, 0, 29828, 14, 1, 12746, 15, 0, 13291, 15, 1, 9671, // 14, 0 - 14, 1, 31358, 14, 2, 12564, 15, 1, 12412, 15, 2, 9202, // 14, 1 - 14, 2, 32886, 14, 3, 12334, 15, 2, 11580, 15, 3, 8736, // 14, 2 - 14, 3, 34369, 14, 4, 12074, 15, 3, 10808, 15, 4, 8285, // 14, 3 - 14, 4, 35750, 14, 5, 11810, 15, 4, 10111, 15, 5, 7865, // 14, 4 - 14, 5, 36955, 14, 6, 11575, 15, 5, 9509, 15, 6, 7497, // 14, 5 - 14, 6, 37906, 14, 7, 11407, 15, 6, 9020, 15, 7, 7203, // 14, 6 - 14, 7, 38534, 14, 8, 11344, 15, 7, 8662, 15, 8, 6996, // 14, 7 - 13, 8, 8718, 13, 9, 7020, 14, 8, 38481, 14, 9, 11317, // 14, 8 - 13, 9, 9086, 13, 10, 7224, 14, 9, 37866, 14, 10, 11360, // 14, 9 - 13, 10, 9587, 13, 11, 7517, 14, 10, 36926, 14, 11, 11506, // 14,10 - 13, 11, 10204, 13, 12, 7881, 14, 11, 35730, 14, 12, 11721, // 14,11 - 13, 12, 10918, 13, 13, 8296, 14, 12, 34358, 14, 13, 11964, // 14,12 - 13, 13, 11709, 13, 14, 8742, 14, 13, 32881, 14, 14, 12204, // 14,13 - 13, 14, 12564, 13, 15, 9202, 14, 14, 31358, 14, 15, 12412, // 14,14 - 13, 15, 13470, 13, 16, 9662, 14, 15, 29831, 14, 16, 12573, // 14,15 - 15, 0, 28495, 15, 1, 13569, 16, 0, 13368, 16, 1, 10104, // 15, 0 - 15, 1, 29831, 15, 2, 13470, 16, 1, 12574, 16, 2, 9661, // 15, 1 - 15, 2, 31146, 15, 3, 13332, 16, 2, 11829, 16, 3, 9229, // 15, 2 - 15, 3, 32406, 15, 4, 13171, 16, 3, 11143, 16, 4, 8816, // 15, 3 - 15, 4, 33564, 15, 5, 13007, 16, 4, 10528, 16, 5, 8437, // 15, 4 - 15, 5, 34567, 15, 6, 12867, 16, 5, 9995, 16, 6, 8107, // 15, 5 - 15, 6, 35362, 15, 7, 12777, 16, 6, 9558, 16, 7, 7839, // 15, 6 - 15, 7, 35905, 15, 8, 12764, 16, 7, 9224, 16, 8, 7643, // 15, 7 - 14, 8, 9290, 14, 9, 7674, 15, 8, 35844, 15, 9, 12728, // 15, 8 - 14, 9, 9635, 14, 10, 7868, 15, 9, 35315, 15, 10, 12718, // 15, 9 - 14, 10, 10086, 14, 11, 8135, 15, 10, 34532, 15, 11, 12783, // 15,10 - 14, 11, 10635, 14, 12, 8463, 15, 11, 33539, 15, 12, 12899, // 15,11 - 14, 12, 11269, 14, 13, 8838, 15, 12, 32391, 15, 13, 13038, // 15,12 - 14, 13, 11977, 14, 14, 9245, 15, 13, 31138, 15, 14, 13176, // 15,13 - 14, 14, 12746, 14, 15, 9671, 15, 14, 29828, 15, 15, 13291, // 15,14 - 14, 15, 13569, 14, 16, 10104, 15, 15, 28495, 15, 16, 13368, // 15,15 - // angle of 2.5 degrees - 0, -1, 14696, 0, 0, 24063, 1, -1, 11702, 1, 0, 15075, // 0, 0 - 0, 0, 14872, 0, 1, 25368, 1, 0, 11187, 1, 1, 14109, // 0, 1 - 0, 1, 14990, 0, 2, 26660, 1, 1, 10676, 1, 2, 13210, // 0, 2 - 0, 2, 15060, 0, 3, 27903, 1, 2, 10185, 1, 3, 12388, // 0, 3 - 0, 3, 15100, 0, 4, 29055, 1, 3, 9728, 1, 4, 11653, // 0, 4 - 0, 4, 15135, 0, 5, 30064, 1, 4, 9323, 1, 5, 11014, // 0, 5 - 0, 5, 15193, 0, 6, 30876, 1, 5, 8986, 1, 6, 10481, // 0, 6 - 0, 6, 15301, 0, 7, 31444, 1, 6, 8727, 1, 7, 10064, // 0, 7 - -1, 7, 8669, -1, 8, 9959, 0, 7, 15376, 0, 8, 31532, // 0, 8 - -1, 8, 8927, -1, 9, 10351, 0, 8, 15319, 0, 9, 30939, // 0, 9 - -1, 9, 9265, -1, 10, 10855, 0, 9, 15311, 0, 10, 30105, // 0,10 - -1, 10, 9673, -1, 11, 11461, 0, 10, 15325, 0, 11, 29077, // 0,11 - -1, 11, 10135, -1, 12, 12159, 0, 11, 15330, 0, 12, 27912, // 0,12 - -1, 12, 10637, -1, 13, 12938, 0, 12, 15301, 0, 13, 26660, // 0,13 - -1, 13, 11164, -1, 14, 13787, 0, 13, 15220, 0, 14, 25365, // 0,14 - -1, 14, 11702, -1, 15, 14696, 0, 14, 15076, 0, 15, 24062, // 0,15 - 1, -1, 13787, 1, 0, 25366, 2, -1, 11164, 2, 0, 15219, // 1, 0 - 1, 0, 13853, 1, 1, 26893, 2, 0, 10644, 2, 1, 14146, // 1, 1 - 1, 1, 13850, 1, 2, 28427, 2, 1, 10119, 2, 2, 13140, // 1, 2 - 1, 2, 13789, 1, 3, 29928, 2, 2, 9603, 2, 3, 12216, // 1, 3 - 1, 3, 13694, 1, 4, 31339, 2, 3, 9118, 2, 4, 11385, // 1, 4 - 1, 4, 13600, 1, 5, 32586, 2, 4, 8685, 2, 5, 10665, // 1, 5 - 1, 5, 13548, 1, 6, 33585, 2, 5, 8329, 2, 6, 10074, // 1, 6 - 1, 6, 13582, 1, 7, 34261, 2, 6, 8068, 2, 7, 9625, // 1, 7 - 0, 7, 8024, 0, 8, 9534, 1, 7, 13638, 1, 8, 34340, // 1, 8 - 0, 8, 8286, 0, 9, 9961, 1, 8, 13647, 1, 9, 33642, // 1, 9 - 0, 9, 8645, 0, 10, 10528, 1, 9, 13740, 1, 10, 32623, // 1,10 - 0, 10, 9082, 0, 11, 11218, 1, 10, 13875, 1, 11, 31361, // 1,11 - 0, 11, 9575, 0, 12, 12014, 1, 11, 14009, 1, 12, 29938, // 1,12 - 0, 12, 10102, 0, 13, 12897, 1, 12, 14107, 1, 13, 28430, // 1,13 - 0, 13, 10644, 0, 14, 13853, 1, 13, 14145, 1, 14, 26894, // 1,14 - 0, 14, 11187, 0, 15, 14872, 1, 14, 14109, 1, 15, 25368, // 1,15 - 2, -1, 12938, 2, 0, 26660, 3, -1, 10637, 3, 0, 15301, // 2, 0 - 2, 0, 12897, 2, 1, 28430, 3, 0, 10102, 3, 1, 14107, // 2, 1 - 2, 1, 12769, 2, 2, 30239, 3, 1, 9546, 3, 2, 12982, // 2, 2 - 2, 2, 12569, 2, 3, 32045, 3, 2, 8988, 3, 3, 11934, // 2, 3 - 2, 3, 12323, 2, 4, 33777, 3, 3, 8452, 3, 4, 10984, // 2, 4 - 2, 4, 12079, 2, 5, 35332, 3, 4, 7969, 3, 5, 10156, // 2, 5 - 2, 5, 11897, 2, 6, 36582, 3, 5, 7573, 3, 6, 9484, // 2, 6 - 2, 6, 11842, 2, 7, 37402, 3, 6, 7298, 3, 7, 8994, // 2, 7 - 1, 7, 7266, 1, 8, 8918, 2, 7, 11883, 2, 8, 37469, // 2, 8 - 1, 8, 7543, 1, 9, 9390, 2, 8, 11972, 2, 9, 36631, // 2, 9 - 1, 9, 7943, 1, 10, 10041, 2, 9, 12188, 2, 10, 35364, // 2,10 - 1, 10, 8432, 1, 11, 10842, 2, 10, 12467, 2, 11, 33795, // 2,11 - 1, 11, 8976, 1, 12, 11760, 2, 11, 12747, 2, 12, 32053, // 2,12 - 1, 12, 9546, 1, 13, 12769, 2, 12, 12982, 2, 13, 30239, // 2,13 - 1, 13, 10119, 1, 14, 13850, 2, 13, 13141, 2, 14, 28426, // 2,14 - 1, 14, 10676, 1, 15, 14990, 2, 14, 13211, 2, 15, 26659, // 2,15 - 3, -1, 12159, 3, 0, 27912, 4, -1, 10135, 4, 0, 15330, // 3, 0 - 3, 0, 12014, 3, 1, 29938, 4, 0, 9575, 4, 1, 14009, // 3, 1 - 3, 1, 11760, 3, 2, 32052, 4, 1, 8976, 4, 2, 12748, // 3, 2 - 3, 2, 11411, 3, 3, 34213, 4, 2, 8358, 4, 3, 11554, // 3, 3 - 3, 3, 10995, 3, 4, 36343, 4, 3, 7746, 4, 4, 10452, // 3, 4 - 3, 4, 10569, 3, 5, 38307, 4, 4, 7180, 4, 5, 9480, // 3, 5 - 3, 5, 10221, 3, 6, 39912, 4, 5, 6714, 4, 6, 8689, // 3, 6 - 3, 6, 10051, 3, 7, 40940, 4, 6, 6403, 4, 7, 8142, // 3, 7 - 2, 7, 6381, 2, 8, 8082, 3, 7, 10079, 3, 8, 40994, // 3, 8 - 2, 8, 6695, 2, 9, 8617, 3, 8, 10275, 3, 9, 39949, // 3, 9 - 2, 9, 7165, 2, 10, 9388, 3, 9, 10653, 3, 10, 38330, // 3,10 - 2, 10, 7737, 2, 11, 10337, 3, 10, 11108, 3, 11, 36354, // 3,11 - 2, 11, 8358, 2, 12, 11411, 3, 11, 11554, 3, 12, 34213, // 3,12 - 2, 12, 8988, 2, 13, 12569, 3, 12, 11934, 3, 13, 32045, // 3,13 - 2, 13, 9603, 2, 14, 13789, 3, 13, 12216, 3, 14, 29928, // 3,14 - 2, 14, 10185, 2, 15, 15060, 3, 14, 12388, 3, 15, 27903, // 3,15 - 4, -1, 11461, 4, 0, 29078, 5, -1, 9673, 5, 0, 15324, // 4, 0 - 4, 0, 11218, 4, 1, 31361, 5, 0, 9082, 5, 1, 13875, // 4, 1 - 4, 1, 10842, 4, 2, 33795, 5, 1, 8432, 5, 2, 12467, // 4, 2 - 4, 2, 10337, 4, 3, 36354, 5, 2, 7737, 5, 3, 11108, // 4, 3 - 4, 3, 9730, 4, 4, 38966, 5, 3, 7022, 5, 4, 9818, // 4, 4 - 4, 4, 9081, 4, 5, 41475, 5, 4, 6334, 5, 5, 8646, // 4, 5 - 4, 5, 8507, 4, 6, 43602, 5, 5, 5749, 5, 6, 7678, // 4, 6 - 4, 6, 8177, 4, 7, 44962, 5, 6, 5368, 5, 7, 7029, // 4, 7 - 3, 7, 5354, 3, 8, 6987, 4, 7, 8195, 4, 8, 45000, // 4, 8 - 3, 8, 5739, 3, 9, 7626, 4, 8, 8545, 4, 9, 43626, // 4, 9 - 3, 9, 6328, 3, 10, 8578, 4, 9, 9143, 4, 10, 41487, // 4,10 - 3, 10, 7022, 3, 11, 9730, 4, 10, 9818, 4, 11, 38966, // 4,11 - 3, 11, 7746, 3, 12, 10995, 4, 11, 10452, 4, 12, 36343, // 4,12 - 3, 12, 8452, 3, 13, 12323, 4, 12, 10983, 4, 13, 33778, // 4,13 - 3, 13, 9118, 3, 14, 13694, 4, 13, 11385, 4, 14, 31339, // 4,14 - 3, 14, 9728, 3, 15, 15100, 4, 14, 11652, 4, 15, 29056, // 4,15 - 5, -1, 10855, 5, 0, 30105, 6, -1, 9265, 6, 0, 15311, // 5, 0 - 5, 0, 10528, 5, 1, 32624, 6, 0, 8645, 6, 1, 13739, // 5, 1 - 5, 1, 10041, 5, 2, 35364, 6, 1, 7943, 6, 2, 12188, // 5, 2 - 5, 2, 9388, 5, 3, 38330, 6, 2, 7165, 6, 3, 10653, // 5, 3 - 5, 3, 8578, 5, 4, 41487, 6, 3, 6328, 6, 4, 9143, // 5, 4 - 5, 4, 7659, 5, 5, 44700, 6, 4, 5472, 6, 5, 7705, // 5, 5 - 5, 5, 6768, 5, 6, 47619, 6, 5, 4694, 6, 6, 6455, // 5, 6 - 5, 6, 6183, 5, 7, 49566, 6, 6, 4172, 6, 7, 5615, // 5, 7 - 4, 7, 4164, 4, 8, 5590, 5, 7, 6193, 5, 8, 49589, // 5, 8 - 4, 8, 4690, 4, 9, 6422, 5, 8, 6794, 5, 9, 47630, // 5, 9 - 4, 9, 5472, 4, 10, 7659, 5, 9, 7705, 5, 10, 44700, // 5,10 - 4, 10, 6334, 4, 11, 9081, 5, 10, 8646, 5, 11, 41475, // 5,11 - 4, 11, 7180, 4, 12, 10569, 5, 11, 9479, 5, 12, 38308, // 5,12 - 4, 12, 7969, 4, 13, 12079, 5, 12, 10156, 5, 13, 35332, // 5,13 - 4, 13, 8685, 4, 14, 13600, 5, 13, 10665, 5, 14, 32586, // 5,14 - 4, 14, 9323, 4, 15, 15135, 5, 14, 11013, 5, 15, 30065, // 5,15 - 6, -1, 10351, 6, 0, 30939, 7, -1, 8927, 7, 0, 15319, // 6, 0 - 6, 0, 9961, 6, 1, 33642, 7, 0, 8286, 7, 1, 13647, // 6, 1 - 6, 1, 9390, 6, 2, 36631, 7, 1, 7543, 7, 2, 11972, // 6, 2 - 6, 2, 8617, 6, 3, 39949, 7, 2, 6695, 7, 3, 10275, // 6, 3 - 6, 3, 7626, 6, 4, 43626, 7, 3, 5739, 7, 4, 8545, // 6, 4 - 6, 4, 6422, 6, 5, 47630, 7, 4, 4690, 7, 5, 6794, // 6, 5 - 6, 5, 5099, 6, 6, 51701, 7, 5, 3620, 7, 6, 5116, // 6, 6 - 6, 6, 4044, 6, 7, 54831, 7, 6, 2797, 7, 7, 3864, // 6, 7 - 5, 7, 2795, 5, 8, 3853, 6, 7, 4049, 6, 8, 54839, // 6, 8 - 5, 8, 3620, 5, 9, 5099, 6, 8, 5116, 6, 9, 51701, // 6, 9 - 5, 9, 4694, 5, 10, 6768, 6, 9, 6455, 6, 10, 47619, // 6,10 - 5, 10, 5749, 5, 11, 8507, 6, 10, 7678, 6, 11, 43602, // 6,11 - 5, 11, 6714, 5, 12, 10221, 6, 11, 8690, 6, 12, 39911, // 6,12 - 5, 12, 7573, 5, 13, 11897, 6, 12, 9484, 6, 13, 36582, // 6,13 - 5, 13, 8329, 5, 14, 13548, 6, 13, 10074, 6, 14, 33585, // 6,14 - 5, 14, 8986, 5, 15, 15193, 6, 14, 10482, 6, 15, 30875, // 6,15 - 7, -1, 9959, 7, 0, 31532, 8, -1, 8669, 8, 0, 15376, // 7, 0 - 7, 0, 9534, 7, 1, 34340, 8, 0, 8024, 8, 1, 13638, // 7, 1 - 7, 1, 8918, 7, 2, 37470, 8, 1, 7266, 8, 2, 11882, // 7, 2 - 7, 2, 8082, 7, 3, 40994, 8, 2, 6381, 8, 3, 10079, // 7, 3 - 7, 3, 6987, 7, 4, 44999, 8, 3, 5354, 8, 4, 8196, // 7, 4 - 7, 4, 5590, 7, 5, 49588, 8, 4, 4164, 8, 5, 6194, // 7, 5 - 7, 5, 3853, 7, 6, 54839, 8, 5, 2795, 8, 6, 4049, // 7, 6 - 7, 6, 1903, 7, 7, 60382, 8, 6, 1347, 8, 7, 1904, // 7, 7 - 6, 7, 1347, 6, 8, 1903, 7, 7, 1905, 7, 8, 60381, // 7, 8 - 6, 8, 2797, 6, 9, 4044, 7, 8, 3864, 7, 9, 54831, // 7, 9 - 6, 9, 4172, 6, 10, 6183, 7, 9, 5615, 7, 10, 49566, // 7,10 - 6, 10, 5368, 6, 11, 8177, 7, 10, 7029, 7, 11, 44962, // 7,11 - 6, 11, 6403, 6, 12, 10051, 7, 11, 8141, 7, 12, 40941, // 7,12 - 6, 12, 7298, 6, 13, 11842, 7, 12, 8994, 7, 13, 37402, // 7,13 - 6, 13, 8068, 6, 14, 13582, 7, 13, 9626, 7, 14, 34260, // 7,14 - 6, 14, 8727, 6, 15, 15301, 7, 14, 10065, 7, 15, 31443, // 7,15 - 8, 0, 31444, 8, 1, 10065, 9, 0, 15301, 9, 1, 8726, // 8, 0 - 8, 1, 34261, 8, 2, 9626, 9, 1, 13582, 9, 2, 8067, // 8, 1 - 8, 2, 37402, 8, 3, 8994, 9, 2, 11842, 9, 3, 7298, // 8, 2 - 8, 3, 40940, 8, 4, 8141, 9, 3, 10051, 9, 4, 6404, // 8, 3 - 8, 4, 44962, 8, 5, 7029, 9, 4, 8177, 9, 5, 5368, // 8, 4 - 8, 5, 49566, 8, 6, 5615, 9, 5, 6183, 9, 6, 4172, // 8, 5 - 8, 6, 54831, 8, 7, 3864, 9, 6, 4044, 9, 7, 2797, // 8, 6 - 8, 7, 60382, 8, 8, 1905, 9, 7, 1903, 9, 8, 1346, // 8, 7 - 7, 8, 1905, 7, 9, 1347, 8, 8, 60382, 8, 9, 1902, // 8, 8 - 7, 9, 4049, 7, 10, 2795, 8, 9, 54839, 8, 10, 3853, // 8, 9 - 7, 10, 6193, 7, 11, 4164, 8, 10, 49588, 8, 11, 5591, // 8,10 - 7, 11, 8195, 7, 12, 5354, 8, 11, 44999, 8, 12, 6988, // 8,11 - 7, 12, 10079, 7, 13, 6381, 8, 12, 40994, 8, 13, 8082, // 8,12 - 7, 13, 11883, 7, 14, 7266, 8, 13, 37470, 8, 14, 8917, // 8,13 - 7, 14, 13638, 7, 15, 8024, 8, 14, 34340, 8, 15, 9534, // 8,14 - 7, 15, 15376, 7, 16, 8669, 8, 15, 31532, 8, 16, 9959, // 8,15 - 9, 0, 30876, 9, 1, 10482, 10, 0, 15193, 10, 1, 8985, // 9, 0 - 9, 1, 33585, 9, 2, 10074, 10, 1, 13548, 10, 2, 8329, // 9, 1 - 9, 2, 36582, 9, 3, 9484, 10, 2, 11897, 10, 3, 7573, // 9, 2 - 9, 3, 39912, 9, 4, 8690, 10, 3, 10221, 10, 4, 6713, // 9, 3 - 9, 4, 43602, 9, 5, 7678, 10, 4, 8507, 10, 5, 5749, // 9, 4 - 9, 5, 47619, 9, 6, 6455, 10, 5, 6768, 10, 6, 4694, // 9, 5 - 9, 6, 51701, 9, 7, 5116, 10, 6, 5099, 10, 7, 3620, // 9, 6 - 9, 7, 54839, 9, 8, 4049, 10, 7, 3853, 10, 8, 2795, // 9, 7 - 8, 8, 3864, 8, 9, 2797, 9, 8, 54831, 9, 9, 4044, // 9, 8 - 8, 9, 5116, 8, 10, 3620, 9, 9, 51701, 9, 10, 5099, // 9, 9 - 8, 10, 6794, 8, 11, 4690, 9, 10, 47630, 9, 11, 6422, // 9,10 - 8, 11, 8545, 8, 12, 5739, 9, 11, 43626, 9, 12, 7626, // 9,11 - 8, 12, 10275, 8, 13, 6695, 9, 12, 39949, 9, 13, 8617, // 9,12 - 8, 13, 11972, 8, 14, 7543, 9, 13, 36631, 9, 14, 9390, // 9,13 - 8, 14, 13647, 8, 15, 8286, 9, 14, 33642, 9, 15, 9961, // 9,14 - 8, 15, 15319, 8, 16, 8927, 9, 15, 30939, 9, 16, 10351, // 9,15 - 10, 0, 30064, 10, 1, 11013, 11, 0, 15135, 11, 1, 9324, // 10, 0 - 10, 1, 32586, 10, 2, 10665, 11, 1, 13600, 11, 2, 8685, // 10, 1 - 10, 2, 35332, 10, 3, 10156, 11, 2, 12079, 11, 3, 7969, // 10, 2 - 10, 3, 38307, 10, 4, 9479, 11, 3, 10569, 11, 4, 7181, // 10, 3 - 10, 4, 41475, 10, 5, 8646, 11, 4, 9081, 11, 5, 6334, // 10, 4 - 10, 5, 44700, 10, 6, 7705, 11, 5, 7659, 11, 6, 5472, // 10, 5 - 10, 6, 47630, 10, 7, 6794, 11, 6, 6422, 11, 7, 4690, // 10, 6 - 10, 7, 49588, 10, 8, 6193, 11, 7, 5590, 11, 8, 4165, // 10, 7 - 9, 8, 5615, 9, 9, 4172, 10, 8, 49566, 10, 9, 6183, // 10, 8 - 9, 9, 6455, 9, 10, 4694, 10, 9, 47619, 10, 10, 6768, // 10, 9 - 9, 10, 7705, 9, 11, 5472, 10, 10, 44700, 10, 11, 7659, // 10,10 - 9, 11, 9143, 9, 12, 6328, 10, 11, 41487, 10, 12, 8578, // 10,11 - 9, 12, 10653, 9, 13, 7165, 10, 12, 38330, 10, 13, 9388, // 10,12 - 9, 13, 12188, 9, 14, 7943, 10, 13, 35364, 10, 14, 10041, // 10,13 - 9, 14, 13740, 9, 15, 8645, 10, 14, 32624, 10, 15, 10527, // 10,14 - 9, 15, 15311, 9, 16, 9265, 10, 15, 30105, 10, 16, 10855, // 10,15 - 11, 0, 29055, 11, 1, 11652, 12, 0, 15100, 12, 1, 9729, // 11, 0 - 11, 1, 31339, 11, 2, 11385, 12, 1, 13694, 12, 2, 9118, // 11, 1 - 11, 2, 33777, 11, 3, 10983, 12, 2, 12323, 12, 3, 8453, // 11, 2 - 11, 3, 36343, 11, 4, 10452, 12, 3, 10995, 12, 4, 7746, // 11, 3 - 11, 4, 38966, 11, 5, 9818, 12, 4, 9730, 12, 5, 7022, // 11, 4 - 11, 5, 41487, 11, 6, 9143, 12, 5, 8578, 12, 6, 6328, // 11, 5 - 11, 6, 43626, 11, 7, 8545, 12, 6, 7626, 12, 7, 5739, // 11, 6 - 11, 7, 44999, 11, 8, 8195, 12, 7, 6987, 12, 8, 5355, // 11, 7 - 10, 8, 7029, 10, 9, 5368, 11, 8, 44962, 11, 9, 8177, // 11, 8 - 10, 9, 7678, 10, 10, 5749, 11, 9, 43602, 11, 10, 8507, // 11, 9 - 10, 10, 8646, 10, 11, 6334, 11, 10, 41475, 11, 11, 9081, // 11,10 - 10, 11, 9818, 10, 12, 7022, 11, 11, 38966, 11, 12, 9730, // 11,11 - 10, 12, 11108, 10, 13, 7737, 11, 12, 36354, 11, 13, 10337, // 11,12 - 10, 13, 12467, 10, 14, 8432, 11, 13, 33795, 11, 14, 10842, // 11,13 - 10, 14, 13875, 10, 15, 9082, 11, 14, 31361, 11, 15, 11218, // 11,14 - 10, 15, 15325, 10, 16, 9673, 11, 15, 29078, 11, 16, 11460, // 11,15 - 12, 0, 27903, 12, 1, 12388, 13, 0, 15060, 13, 1, 10185, // 12, 0 - 12, 1, 29928, 12, 2, 12216, 13, 1, 13789, 13, 2, 9603, // 12, 1 - 12, 2, 32045, 12, 3, 11934, 13, 2, 12569, 13, 3, 8988, // 12, 2 - 12, 3, 34213, 12, 4, 11554, 13, 3, 11411, 13, 4, 8358, // 12, 3 - 12, 4, 36354, 12, 5, 11108, 13, 4, 10337, 13, 5, 7737, // 12, 4 - 12, 5, 38330, 12, 6, 10653, 13, 5, 9388, 13, 6, 7165, // 12, 5 - 12, 6, 39949, 12, 7, 10275, 13, 6, 8617, 13, 7, 6695, // 12, 6 - 12, 7, 40994, 12, 8, 10079, 13, 7, 8082, 13, 8, 6381, // 12, 7 - 11, 8, 8141, 11, 9, 6403, 12, 8, 40940, 12, 9, 10052, // 12, 8 - 11, 9, 8690, 11, 10, 6714, 12, 9, 39912, 12, 10, 10220, // 12, 9 - 11, 10, 9479, 11, 11, 7180, 12, 10, 38307, 12, 11, 10570, // 12,10 - 11, 11, 10452, 11, 12, 7746, 12, 11, 36343, 12, 12, 10995, // 12,11 - 11, 12, 11554, 11, 13, 8358, 12, 12, 34213, 12, 13, 11411, // 12,12 - 11, 13, 12747, 11, 14, 8976, 12, 13, 32052, 12, 14, 11761, // 12,13 - 11, 14, 14009, 11, 15, 9575, 12, 14, 29938, 12, 15, 12014, // 12,14 - 11, 15, 15330, 11, 16, 10135, 12, 15, 27912, 12, 16, 12159, // 12,15 - 13, 0, 26660, 13, 1, 13211, 14, 0, 14990, 14, 1, 10675, // 13, 0 - 13, 1, 28427, 13, 2, 13141, 14, 1, 13850, 14, 2, 10118, // 13, 1 - 13, 2, 30239, 13, 3, 12982, 14, 2, 12769, 14, 3, 9546, // 13, 2 - 13, 3, 32052, 13, 4, 12747, 14, 3, 11760, 14, 4, 8977, // 13, 3 - 13, 4, 33795, 13, 5, 12467, 14, 4, 10842, 14, 5, 8432, // 13, 4 - 13, 5, 35364, 13, 6, 12188, 14, 5, 10041, 14, 6, 7943, // 13, 5 - 13, 6, 36631, 13, 7, 11972, 14, 6, 9390, 14, 7, 7543, // 13, 6 - 13, 7, 37470, 13, 8, 11883, 14, 7, 8918, 14, 8, 7265, // 13, 7 - 12, 8, 8994, 12, 9, 7298, 13, 8, 37402, 13, 9, 11842, // 13, 8 - 12, 9, 9484, 12, 10, 7573, 13, 9, 36582, 13, 10, 11897, // 13, 9 - 12, 10, 10156, 12, 11, 7969, 13, 10, 35332, 13, 11, 12079, // 13,10 - 12, 11, 10983, 12, 12, 8452, 13, 11, 33777, 13, 12, 12324, // 13,11 - 12, 12, 11934, 12, 13, 8988, 13, 12, 32045, 13, 13, 12569, // 13,12 - 12, 13, 12982, 12, 14, 9546, 13, 13, 30239, 13, 14, 12769, // 13,13 - 12, 14, 14107, 12, 15, 10102, 13, 14, 28430, 13, 15, 12897, // 13,14 - 12, 15, 15301, 12, 16, 10637, 13, 15, 26660, 13, 16, 12938, // 13,15 - 14, 0, 25368, 14, 1, 14109, 15, 0, 14872, 15, 1, 11187, // 14, 0 - 14, 1, 26893, 14, 2, 14145, 15, 1, 13853, 15, 2, 10645, // 14, 1 - 14, 2, 28430, 14, 3, 14107, 15, 2, 12897, 15, 3, 10102, // 14, 2 - 14, 3, 29938, 14, 4, 14009, 15, 3, 12014, 15, 4, 9575, // 14, 3 - 14, 4, 31361, 14, 5, 13875, 15, 4, 11218, 15, 5, 9082, // 14, 4 - 14, 5, 32624, 14, 6, 13740, 15, 5, 10528, 15, 6, 8644, // 14, 5 - 14, 6, 33642, 14, 7, 13647, 15, 6, 9961, 15, 7, 8286, // 14, 6 - 14, 7, 34340, 14, 8, 13638, 15, 7, 9534, 15, 8, 8024, // 14, 7 - 13, 8, 9626, 13, 9, 8068, 14, 8, 34261, 14, 9, 13581, // 14, 8 - 13, 9, 10074, 13, 10, 8329, 14, 9, 33585, 14, 10, 13548, // 14, 9 - 13, 10, 10665, 13, 11, 8685, 14, 10, 32586, 14, 11, 13600, // 14,10 - 13, 11, 11385, 13, 12, 9118, 14, 11, 31339, 14, 12, 13694, // 14,11 - 13, 12, 12216, 13, 13, 9603, 14, 12, 29928, 14, 13, 13789, // 14,12 - 13, 13, 13141, 13, 14, 10119, 14, 13, 28427, 14, 14, 13849, // 14,13 - 13, 14, 14145, 13, 15, 10644, 14, 14, 26893, 14, 15, 13854, // 14,14 - 13, 15, 15220, 13, 16, 11164, 14, 15, 25366, 14, 16, 13786, // 14,15 - 15, 0, 24063, 15, 1, 15076, 16, 0, 14696, 16, 1, 11701, // 15, 0 - 15, 1, 25366, 15, 2, 15220, 16, 1, 13787, 16, 2, 11163, // 15, 1 - 15, 2, 26660, 15, 3, 15301, 16, 2, 12938, 16, 3, 10637, // 15, 2 - 15, 3, 27912, 15, 4, 15330, 16, 3, 12159, 16, 4, 10135, // 15, 3 - 15, 4, 29078, 15, 5, 15325, 16, 4, 11461, 16, 5, 9672, // 15, 4 - 15, 5, 30105, 15, 6, 15311, 16, 5, 10855, 16, 6, 9265, // 15, 5 - 15, 6, 30939, 15, 7, 15319, 16, 6, 10351, 16, 7, 8927, // 15, 6 - 15, 7, 31532, 15, 8, 15376, 16, 7, 9959, 16, 8, 8669, // 15, 7 - 14, 8, 10065, 14, 9, 8727, 15, 8, 31444, 15, 9, 15300, // 15, 8 - 14, 9, 10482, 14, 10, 8986, 15, 9, 30876, 15, 10, 15192, // 15, 9 - 14, 10, 11013, 14, 11, 9323, 15, 10, 30064, 15, 11, 15136, // 15,10 - 14, 11, 11652, 14, 12, 9728, 15, 11, 29055, 15, 12, 15101, // 15,11 - 14, 12, 12388, 14, 13, 10185, 15, 12, 27903, 15, 13, 15060, // 15,12 - 14, 13, 13211, 14, 14, 10676, 15, 13, 26660, 15, 14, 14989, // 15,13 - 14, 14, 14109, 14, 15, 11187, 15, 14, 25368, 15, 15, 14872, // 15,14 - 14, 15, 15076, 14, 16, 11702, 15, 15, 24063, 15, 16, 14695, // 15,15 +// angle of -2.5 degrees +-1, 0, 14696, -1, 1, 11702, 0, 0, 24063, 0, 1, 15075, // 0, 0 +-1, 1, 13787, -1, 2, 11164, 0, 1, 25366, 0, 2, 15219, // 0, 1 +-1, 2, 12938, -1, 3, 10637, 0, 2, 26660, 0, 3, 15301, // 0, 2 +-1, 3, 12159, -1, 4, 10135, 0, 3, 27912, 0, 4, 15330, // 0, 3 +-1, 4, 11461, -1, 5, 9673, 0, 4, 29078, 0, 5, 15324, // 0, 4 +-1, 5, 10855, -1, 6, 9265, 0, 5, 30105, 0, 6, 15311, // 0, 5 +-1, 6, 10351, -1, 7, 8927, 0, 6, 30939, 0, 7, 15319, // 0, 6 +-1, 7, 9959, -1, 8, 8669, 0, 7, 31532, 0, 8, 15376, // 0, 7 +0, 8, 31444, 0, 9, 15301, 1, 8, 10065, 1, 9, 8726, // 0, 8 +0, 9, 30876, 0, 10, 15193, 1, 9, 10482, 1, 10, 8985, // 0, 9 +0, 10, 30064, 0, 11, 15135, 1, 10, 11013, 1, 11, 9324, // 0,10 +0, 11, 29055, 0, 12, 15100, 1, 11, 11652, 1, 12, 9729, // 0,11 +0, 12, 27903, 0, 13, 15060, 1, 12, 12388, 1, 13, 10185, // 0,12 +0, 13, 26660, 0, 14, 14990, 1, 13, 13211, 1, 14, 10675, // 0,13 +0, 14, 25368, 0, 15, 14872, 1, 14, 14109, 1, 15, 11187, // 0,14 +0, 15, 24063, 0, 16, 14696, 1, 15, 15076, 1, 16, 11701, // 0,15 +0, 0, 14872, 0, 1, 11187, 1, 0, 25368, 1, 1, 14109, // 1, 0 +0, 1, 13853, 0, 2, 10644, 1, 1, 26893, 1, 2, 14146, // 1, 1 +0, 2, 12897, 0, 3, 10102, 1, 2, 28430, 1, 3, 14107, // 1, 2 +0, 3, 12014, 0, 4, 9575, 1, 3, 29938, 1, 4, 14009, // 1, 3 +0, 4, 11218, 0, 5, 9082, 1, 4, 31361, 1, 5, 13875, // 1, 4 +0, 5, 10528, 0, 6, 8645, 1, 5, 32624, 1, 6, 13739, // 1, 5 +0, 6, 9961, 0, 7, 8286, 1, 6, 33642, 1, 7, 13647, // 1, 6 +0, 7, 9534, 0, 8, 8024, 1, 7, 34340, 1, 8, 13638, // 1, 7 +1, 8, 34261, 1, 9, 13582, 2, 8, 9626, 2, 9, 8067, // 1, 8 +1, 9, 33585, 1, 10, 13548, 2, 9, 10074, 2, 10, 8329, // 1, 9 +1, 10, 32586, 1, 11, 13600, 2, 10, 10665, 2, 11, 8685, // 1,10 +1, 11, 31339, 1, 12, 13694, 2, 11, 11385, 2, 12, 9118, // 1,11 +1, 12, 29928, 1, 13, 13789, 2, 12, 12216, 2, 13, 9603, // 1,12 +1, 13, 28427, 1, 14, 13850, 2, 13, 13141, 2, 14, 10118, // 1,13 +1, 14, 26893, 1, 15, 13853, 2, 14, 14145, 2, 15, 10645, // 1,14 +1, 15, 25366, 1, 16, 13787, 2, 15, 15220, 2, 16, 11163, // 1,15 +1, 0, 14990, 1, 1, 10676, 2, 0, 26660, 2, 1, 13210, // 2, 0 +1, 1, 13850, 1, 2, 10119, 2, 1, 28427, 2, 2, 13140, // 2, 1 +1, 2, 12769, 1, 3, 9546, 2, 2, 30239, 2, 3, 12982, // 2, 2 +1, 3, 11760, 1, 4, 8976, 2, 3, 32052, 2, 4, 12748, // 2, 3 +1, 4, 10842, 1, 5, 8432, 2, 4, 33795, 2, 5, 12467, // 2, 4 +1, 5, 10041, 1, 6, 7943, 2, 5, 35364, 2, 6, 12188, // 2, 5 +1, 6, 9390, 1, 7, 7543, 2, 6, 36631, 2, 7, 11972, // 2, 6 +1, 7, 8918, 1, 8, 7266, 2, 7, 37470, 2, 8, 11882, // 2, 7 +2, 8, 37402, 2, 9, 11842, 3, 8, 8994, 3, 9, 7298, // 2, 8 +2, 9, 36582, 2, 10, 11897, 3, 9, 9484, 3, 10, 7573, // 2, 9 +2, 10, 35332, 2, 11, 12079, 3, 10, 10156, 3, 11, 7969, // 2,10 +2, 11, 33777, 2, 12, 12323, 3, 11, 10983, 3, 12, 8453, // 2,11 +2, 12, 32045, 2, 13, 12569, 3, 12, 11934, 3, 13, 8988, // 2,12 +2, 13, 30239, 2, 14, 12769, 3, 13, 12982, 3, 14, 9546, // 2,13 +2, 14, 28430, 2, 15, 12897, 3, 14, 14107, 3, 15, 10102, // 2,14 +2, 15, 26660, 2, 16, 12938, 3, 15, 15301, 3, 16, 10637, // 2,15 +2, 0, 15060, 2, 1, 10185, 3, 0, 27903, 3, 1, 12388, // 3, 0 +2, 1, 13789, 2, 2, 9603, 3, 1, 29928, 3, 2, 12216, // 3, 1 +2, 2, 12569, 2, 3, 8988, 3, 2, 32045, 3, 3, 11934, // 3, 2 +2, 3, 11411, 2, 4, 8358, 3, 3, 34213, 3, 4, 11554, // 3, 3 +2, 4, 10337, 2, 5, 7737, 3, 4, 36354, 3, 5, 11108, // 3, 4 +2, 5, 9388, 2, 6, 7165, 3, 5, 38330, 3, 6, 10653, // 3, 5 +2, 6, 8617, 2, 7, 6695, 3, 6, 39949, 3, 7, 10275, // 3, 6 +2, 7, 8082, 2, 8, 6381, 3, 7, 40994, 3, 8, 10079, // 3, 7 +3, 8, 40940, 3, 9, 10051, 4, 8, 8141, 4, 9, 6404, // 3, 8 +3, 9, 39912, 3, 10, 10221, 4, 9, 8690, 4, 10, 6713, // 3, 9 +3, 10, 38307, 3, 11, 10569, 4, 10, 9479, 4, 11, 7181, // 3,10 +3, 11, 36343, 3, 12, 10995, 4, 11, 10452, 4, 12, 7746, // 3,11 +3, 12, 34213, 3, 13, 11411, 4, 12, 11554, 4, 13, 8358, // 3,12 +3, 13, 32052, 3, 14, 11760, 4, 13, 12747, 4, 14, 8977, // 3,13 +3, 14, 29938, 3, 15, 12014, 4, 14, 14009, 4, 15, 9575, // 3,14 +3, 15, 27912, 3, 16, 12159, 4, 15, 15330, 4, 16, 10135, // 3,15 +3, 0, 15100, 3, 1, 9728, 4, 0, 29055, 4, 1, 11653, // 4, 0 +3, 1, 13694, 3, 2, 9118, 4, 1, 31339, 4, 2, 11385, // 4, 1 +3, 2, 12323, 3, 3, 8452, 4, 2, 33777, 4, 3, 10984, // 4, 2 +3, 3, 10995, 3, 4, 7746, 4, 3, 36343, 4, 4, 10452, // 4, 3 +3, 4, 9730, 3, 5, 7022, 4, 4, 38966, 4, 5, 9818, // 4, 4 +3, 5, 8578, 3, 6, 6328, 4, 5, 41487, 4, 6, 9143, // 4, 5 +3, 6, 7626, 3, 7, 5739, 4, 6, 43626, 4, 7, 8545, // 4, 6 +3, 7, 6987, 3, 8, 5354, 4, 7, 44999, 4, 8, 8196, // 4, 7 +4, 8, 44962, 4, 9, 8177, 5, 8, 7029, 5, 9, 5368, // 4, 8 +4, 9, 43602, 4, 10, 8507, 5, 9, 7678, 5, 10, 5749, // 4, 9 +4, 10, 41475, 4, 11, 9081, 5, 10, 8646, 5, 11, 6334, // 4,10 +4, 11, 38966, 4, 12, 9730, 5, 11, 9818, 5, 12, 7022, // 4,11 +4, 12, 36354, 4, 13, 10337, 5, 12, 11108, 5, 13, 7737, // 4,12 +4, 13, 33795, 4, 14, 10842, 5, 13, 12467, 5, 14, 8432, // 4,13 +4, 14, 31361, 4, 15, 11218, 5, 14, 13875, 5, 15, 9082, // 4,14 +4, 15, 29078, 4, 16, 11461, 5, 15, 15325, 5, 16, 9672, // 4,15 +4, 0, 15135, 4, 1, 9323, 5, 0, 30064, 5, 1, 11014, // 5, 0 +4, 1, 13600, 4, 2, 8685, 5, 1, 32586, 5, 2, 10665, // 5, 1 +4, 2, 12079, 4, 3, 7969, 5, 2, 35332, 5, 3, 10156, // 5, 2 +4, 3, 10569, 4, 4, 7180, 5, 3, 38307, 5, 4, 9480, // 5, 3 +4, 4, 9081, 4, 5, 6334, 5, 4, 41475, 5, 5, 8646, // 5, 4 +4, 5, 7659, 4, 6, 5472, 5, 5, 44700, 5, 6, 7705, // 5, 5 +4, 6, 6422, 4, 7, 4690, 5, 6, 47630, 5, 7, 6794, // 5, 6 +4, 7, 5590, 4, 8, 4164, 5, 7, 49588, 5, 8, 6194, // 5, 7 +5, 8, 49566, 5, 9, 6183, 6, 8, 5615, 6, 9, 4172, // 5, 8 +5, 9, 47619, 5, 10, 6768, 6, 9, 6455, 6, 10, 4694, // 5, 9 +5, 10, 44700, 5, 11, 7659, 6, 10, 7705, 6, 11, 5472, // 5,10 +5, 11, 41487, 5, 12, 8578, 6, 11, 9143, 6, 12, 6328, // 5,11 +5, 12, 38330, 5, 13, 9388, 6, 12, 10653, 6, 13, 7165, // 5,12 +5, 13, 35364, 5, 14, 10041, 6, 13, 12188, 6, 14, 7943, // 5,13 +5, 14, 32624, 5, 15, 10528, 6, 14, 13740, 6, 15, 8644, // 5,14 +5, 15, 30105, 5, 16, 10855, 6, 15, 15311, 6, 16, 9265, // 5,15 +5, 0, 15193, 5, 1, 8986, 6, 0, 30876, 6, 1, 10481, // 6, 0 +5, 1, 13548, 5, 2, 8329, 6, 1, 33585, 6, 2, 10074, // 6, 1 +5, 2, 11897, 5, 3, 7573, 6, 2, 36582, 6, 3, 9484, // 6, 2 +5, 3, 10221, 5, 4, 6714, 6, 3, 39912, 6, 4, 8689, // 6, 3 +5, 4, 8507, 5, 5, 5749, 6, 4, 43602, 6, 5, 7678, // 6, 4 +5, 5, 6768, 5, 6, 4694, 6, 5, 47619, 6, 6, 6455, // 6, 5 +5, 6, 5099, 5, 7, 3620, 6, 6, 51701, 6, 7, 5116, // 6, 6 +5, 7, 3853, 5, 8, 2795, 6, 7, 54839, 6, 8, 4049, // 6, 7 +6, 8, 54831, 6, 9, 4044, 7, 8, 3864, 7, 9, 2797, // 6, 8 +6, 9, 51701, 6, 10, 5099, 7, 9, 5116, 7, 10, 3620, // 6, 9 +6, 10, 47630, 6, 11, 6422, 7, 10, 6794, 7, 11, 4690, // 6,10 +6, 11, 43626, 6, 12, 7626, 7, 11, 8545, 7, 12, 5739, // 6,11 +6, 12, 39949, 6, 13, 8617, 7, 12, 10275, 7, 13, 6695, // 6,12 +6, 13, 36631, 6, 14, 9390, 7, 13, 11972, 7, 14, 7543, // 6,13 +6, 14, 33642, 6, 15, 9961, 7, 14, 13647, 7, 15, 8286, // 6,14 +6, 15, 30939, 6, 16, 10351, 7, 15, 15319, 7, 16, 8927, // 6,15 +6, 0, 15301, 6, 1, 8727, 7, 0, 31444, 7, 1, 10064, // 7, 0 +6, 1, 13582, 6, 2, 8068, 7, 1, 34261, 7, 2, 9625, // 7, 1 +6, 2, 11842, 6, 3, 7298, 7, 2, 37402, 7, 3, 8994, // 7, 2 +6, 3, 10051, 6, 4, 6403, 7, 3, 40940, 7, 4, 8142, // 7, 3 +6, 4, 8177, 6, 5, 5368, 7, 4, 44962, 7, 5, 7029, // 7, 4 +6, 5, 6183, 6, 6, 4172, 7, 5, 49566, 7, 6, 5615, // 7, 5 +6, 6, 4044, 6, 7, 2797, 7, 6, 54831, 7, 7, 3864, // 7, 6 +6, 7, 1903, 6, 8, 1347, 7, 7, 60382, 7, 8, 1904, // 7, 7 +7, 8, 60382, 7, 9, 1903, 8, 8, 1905, 8, 9, 1346, // 7, 8 +7, 9, 54839, 7, 10, 3853, 8, 9, 4049, 8, 10, 2795, // 7, 9 +7, 10, 49588, 7, 11, 5590, 8, 10, 6193, 8, 11, 4165, // 7,10 +7, 11, 44999, 7, 12, 6987, 8, 11, 8195, 8, 12, 5355, // 7,11 +7, 12, 40994, 7, 13, 8082, 8, 12, 10079, 8, 13, 6381, // 7,12 +7, 13, 37470, 7, 14, 8918, 8, 13, 11883, 8, 14, 7265, // 7,13 +7, 14, 34340, 7, 15, 9534, 8, 14, 13638, 8, 15, 8024, // 7,14 +7, 15, 31532, 7, 16, 9959, 8, 15, 15376, 8, 16, 8669, // 7,15 +7, -1, 8669, 7, 0, 15376, 8, -1, 9959, 8, 0, 31532, // 8, 0 +7, 0, 8024, 7, 1, 13638, 8, 0, 9534, 8, 1, 34340, // 8, 1 +7, 1, 7266, 7, 2, 11883, 8, 1, 8918, 8, 2, 37469, // 8, 2 +7, 2, 6381, 7, 3, 10079, 8, 2, 8082, 8, 3, 40994, // 8, 3 +7, 3, 5354, 7, 4, 8195, 8, 3, 6987, 8, 4, 45000, // 8, 4 +7, 4, 4164, 7, 5, 6193, 8, 4, 5590, 8, 5, 49589, // 8, 5 +7, 5, 2795, 7, 6, 4049, 8, 5, 3853, 8, 6, 54839, // 8, 6 +7, 6, 1347, 7, 7, 1905, 8, 6, 1903, 8, 7, 60381, // 8, 7 +8, 7, 1905, 8, 8, 60382, 9, 7, 1347, 9, 8, 1902, // 8, 8 +8, 8, 3864, 8, 9, 54831, 9, 8, 2797, 9, 9, 4044, // 8, 9 +8, 9, 5615, 8, 10, 49566, 9, 9, 4172, 9, 10, 6183, // 8,10 +8, 10, 7029, 8, 11, 44962, 9, 10, 5368, 9, 11, 8177, // 8,11 +8, 11, 8141, 8, 12, 40940, 9, 11, 6403, 9, 12, 10052, // 8,12 +8, 12, 8994, 8, 13, 37402, 9, 12, 7298, 9, 13, 11842, // 8,13 +8, 13, 9626, 8, 14, 34261, 9, 13, 8068, 9, 14, 13581, // 8,14 +8, 14, 10065, 8, 15, 31444, 9, 14, 8727, 9, 15, 15300, // 8,15 +8, -1, 8927, 8, 0, 15319, 9, -1, 10351, 9, 0, 30939, // 9, 0 +8, 0, 8286, 8, 1, 13647, 9, 0, 9961, 9, 1, 33642, // 9, 1 +8, 1, 7543, 8, 2, 11972, 9, 1, 9390, 9, 2, 36631, // 9, 2 +8, 2, 6695, 8, 3, 10275, 9, 2, 8617, 9, 3, 39949, // 9, 3 +8, 3, 5739, 8, 4, 8545, 9, 3, 7626, 9, 4, 43626, // 9, 4 +8, 4, 4690, 8, 5, 6794, 9, 4, 6422, 9, 5, 47630, // 9, 5 +8, 5, 3620, 8, 6, 5116, 9, 5, 5099, 9, 6, 51701, // 9, 6 +8, 6, 2797, 8, 7, 3864, 9, 6, 4044, 9, 7, 54831, // 9, 7 +9, 7, 4049, 9, 8, 54839, 10, 7, 2795, 10, 8, 3853, // 9, 8 +9, 8, 5116, 9, 9, 51701, 10, 8, 3620, 10, 9, 5099, // 9, 9 +9, 9, 6455, 9, 10, 47619, 10, 9, 4694, 10, 10, 6768, // 9,10 +9, 10, 7678, 9, 11, 43602, 10, 10, 5749, 10, 11, 8507, // 9,11 +9, 11, 8690, 9, 12, 39912, 10, 11, 6714, 10, 12, 10220, // 9,12 +9, 12, 9484, 9, 13, 36582, 10, 12, 7573, 10, 13, 11897, // 9,13 +9, 13, 10074, 9, 14, 33585, 10, 13, 8329, 10, 14, 13548, // 9,14 +9, 14, 10482, 9, 15, 30876, 10, 14, 8986, 10, 15, 15192, // 9,15 +9, -1, 9265, 9, 0, 15311, 10, -1, 10855, 10, 0, 30105, // 10, 0 +9, 0, 8645, 9, 1, 13740, 10, 0, 10528, 10, 1, 32623, // 10, 1 +9, 1, 7943, 9, 2, 12188, 10, 1, 10041, 10, 2, 35364, // 10, 2 +9, 2, 7165, 9, 3, 10653, 10, 2, 9388, 10, 3, 38330, // 10, 3 +9, 3, 6328, 9, 4, 9143, 10, 3, 8578, 10, 4, 41487, // 10, 4 +9, 4, 5472, 9, 5, 7705, 10, 4, 7659, 10, 5, 44700, // 10, 5 +9, 5, 4694, 9, 6, 6455, 10, 5, 6768, 10, 6, 47619, // 10, 6 +9, 6, 4172, 9, 7, 5615, 10, 6, 6183, 10, 7, 49566, // 10, 7 +10, 7, 6193, 10, 8, 49588, 11, 7, 4164, 11, 8, 5591, // 10, 8 +10, 8, 6794, 10, 9, 47630, 11, 8, 4690, 11, 9, 6422, // 10, 9 +10, 9, 7705, 10, 10, 44700, 11, 9, 5472, 11, 10, 7659, // 10,10 +10, 10, 8646, 10, 11, 41475, 11, 10, 6334, 11, 11, 9081, // 10,11 +10, 11, 9479, 10, 12, 38307, 11, 11, 7180, 11, 12, 10570, // 10,12 +10, 12, 10156, 10, 13, 35332, 11, 12, 7969, 11, 13, 12079, // 10,13 +10, 13, 10665, 10, 14, 32586, 11, 13, 8685, 11, 14, 13600, // 10,14 +10, 14, 11013, 10, 15, 30064, 11, 14, 9323, 11, 15, 15136, // 10,15 +10, -1, 9673, 10, 0, 15325, 11, -1, 11461, 11, 0, 29077, // 11, 0 +10, 0, 9082, 10, 1, 13875, 11, 0, 11218, 11, 1, 31361, // 11, 1 +10, 1, 8432, 10, 2, 12467, 11, 1, 10842, 11, 2, 33795, // 11, 2 +10, 2, 7737, 10, 3, 11108, 11, 2, 10337, 11, 3, 36354, // 11, 3 +10, 3, 7022, 10, 4, 9818, 11, 3, 9730, 11, 4, 38966, // 11, 4 +10, 4, 6334, 10, 5, 8646, 11, 4, 9081, 11, 5, 41475, // 11, 5 +10, 5, 5749, 10, 6, 7678, 11, 5, 8507, 11, 6, 43602, // 11, 6 +10, 6, 5368, 10, 7, 7029, 11, 6, 8177, 11, 7, 44962, // 11, 7 +11, 7, 8195, 11, 8, 44999, 12, 7, 5354, 12, 8, 6988, // 11, 8 +11, 8, 8545, 11, 9, 43626, 12, 8, 5739, 12, 9, 7626, // 11, 9 +11, 9, 9143, 11, 10, 41487, 12, 9, 6328, 12, 10, 8578, // 11,10 +11, 10, 9818, 11, 11, 38966, 12, 10, 7022, 12, 11, 9730, // 11,11 +11, 11, 10452, 11, 12, 36343, 12, 11, 7746, 12, 12, 10995, // 11,12 +11, 12, 10983, 11, 13, 33777, 12, 12, 8452, 12, 13, 12324, // 11,13 +11, 13, 11385, 11, 14, 31339, 12, 13, 9118, 12, 14, 13694, // 11,14 +11, 14, 11652, 11, 15, 29055, 12, 14, 9728, 12, 15, 15101, // 11,15 +11, -1, 10135, 11, 0, 15330, 12, -1, 12159, 12, 0, 27912, // 12, 0 +11, 0, 9575, 11, 1, 14009, 12, 0, 12014, 12, 1, 29938, // 12, 1 +11, 1, 8976, 11, 2, 12747, 12, 1, 11760, 12, 2, 32053, // 12, 2 +11, 2, 8358, 11, 3, 11554, 12, 2, 11411, 12, 3, 34213, // 12, 3 +11, 3, 7746, 11, 4, 10452, 12, 3, 10995, 12, 4, 36343, // 12, 4 +11, 4, 7180, 11, 5, 9479, 12, 4, 10569, 12, 5, 38308, // 12, 5 +11, 5, 6714, 11, 6, 8690, 12, 5, 10221, 12, 6, 39911, // 12, 6 +11, 6, 6403, 11, 7, 8141, 12, 6, 10051, 12, 7, 40941, // 12, 7 +12, 7, 10079, 12, 8, 40994, 13, 7, 6381, 13, 8, 8082, // 12, 8 +12, 8, 10275, 12, 9, 39949, 13, 8, 6695, 13, 9, 8617, // 12, 9 +12, 9, 10653, 12, 10, 38330, 13, 9, 7165, 13, 10, 9388, // 12,10 +12, 10, 11108, 12, 11, 36354, 13, 10, 7737, 13, 11, 10337, // 12,11 +12, 11, 11554, 12, 12, 34213, 13, 11, 8358, 13, 12, 11411, // 12,12 +12, 12, 11934, 12, 13, 32045, 13, 12, 8988, 13, 13, 12569, // 12,13 +12, 13, 12216, 12, 14, 29928, 13, 13, 9603, 13, 14, 13789, // 12,14 +12, 14, 12388, 12, 15, 27903, 13, 14, 10185, 13, 15, 15060, // 12,15 +12, -1, 10637, 12, 0, 15301, 13, -1, 12938, 13, 0, 26660, // 13, 0 +12, 0, 10102, 12, 1, 14107, 13, 0, 12897, 13, 1, 28430, // 13, 1 +12, 1, 9546, 12, 2, 12982, 13, 1, 12769, 13, 2, 30239, // 13, 2 +12, 2, 8988, 12, 3, 11934, 13, 2, 12569, 13, 3, 32045, // 13, 3 +12, 3, 8452, 12, 4, 10983, 13, 3, 12323, 13, 4, 33778, // 13, 4 +12, 4, 7969, 12, 5, 10156, 13, 4, 12079, 13, 5, 35332, // 13, 5 +12, 5, 7573, 12, 6, 9484, 13, 5, 11897, 13, 6, 36582, // 13, 6 +12, 6, 7298, 12, 7, 8994, 13, 6, 11842, 13, 7, 37402, // 13, 7 +13, 7, 11883, 13, 8, 37470, 14, 7, 7266, 14, 8, 8917, // 13, 8 +13, 8, 11972, 13, 9, 36631, 14, 8, 7543, 14, 9, 9390, // 13, 9 +13, 9, 12188, 13, 10, 35364, 14, 9, 7943, 14, 10, 10041, // 13,10 +13, 10, 12467, 13, 11, 33795, 14, 10, 8432, 14, 11, 10842, // 13,11 +13, 11, 12747, 13, 12, 32052, 14, 11, 8976, 14, 12, 11761, // 13,12 +13, 12, 12982, 13, 13, 30239, 14, 12, 9546, 14, 13, 12769, // 13,13 +13, 13, 13141, 13, 14, 28427, 14, 13, 10119, 14, 14, 13849, // 13,14 +13, 14, 13211, 13, 15, 26660, 14, 14, 10676, 14, 15, 14989, // 13,15 +13, -1, 11164, 13, 0, 15220, 14, -1, 13787, 14, 0, 25365, // 14, 0 +13, 0, 10644, 13, 1, 14145, 14, 0, 13853, 14, 1, 26894, // 14, 1 +13, 1, 10119, 13, 2, 13141, 14, 1, 13850, 14, 2, 28426, // 14, 2 +13, 2, 9603, 13, 3, 12216, 14, 2, 13789, 14, 3, 29928, // 14, 3 +13, 3, 9118, 13, 4, 11385, 14, 3, 13694, 14, 4, 31339, // 14, 4 +13, 4, 8685, 13, 5, 10665, 14, 4, 13600, 14, 5, 32586, // 14, 5 +13, 5, 8329, 13, 6, 10074, 14, 5, 13548, 14, 6, 33585, // 14, 6 +13, 6, 8068, 13, 7, 9626, 14, 6, 13582, 14, 7, 34260, // 14, 7 +14, 7, 13638, 14, 8, 34340, 15, 7, 8024, 15, 8, 9534, // 14, 8 +14, 8, 13647, 14, 9, 33642, 15, 8, 8286, 15, 9, 9961, // 14, 9 +14, 9, 13740, 14, 10, 32624, 15, 9, 8645, 15, 10, 10527, // 14,10 +14, 10, 13875, 14, 11, 31361, 15, 10, 9082, 15, 11, 11218, // 14,11 +14, 11, 14009, 14, 12, 29938, 15, 11, 9575, 15, 12, 12014, // 14,12 +14, 12, 14107, 14, 13, 28430, 15, 12, 10102, 15, 13, 12897, // 14,13 +14, 13, 14145, 14, 14, 26893, 15, 13, 10644, 15, 14, 13854, // 14,14 +14, 14, 14109, 14, 15, 25368, 15, 14, 11187, 15, 15, 14872, // 14,15 +14, -1, 11702, 14, 0, 15076, 15, -1, 14696, 15, 0, 24062, // 15, 0 +14, 0, 11187, 14, 1, 14109, 15, 0, 14872, 15, 1, 25368, // 15, 1 +14, 1, 10676, 14, 2, 13211, 15, 1, 14990, 15, 2, 26659, // 15, 2 +14, 2, 10185, 14, 3, 12388, 15, 2, 15060, 15, 3, 27903, // 15, 3 +14, 3, 9728, 14, 4, 11652, 15, 3, 15100, 15, 4, 29056, // 15, 4 +14, 4, 9323, 14, 5, 11013, 15, 4, 15135, 15, 5, 30065, // 15, 5 +14, 5, 8986, 14, 6, 10482, 15, 5, 15193, 15, 6, 30875, // 15, 6 +14, 6, 8727, 14, 7, 10065, 15, 6, 15301, 15, 7, 31443, // 15, 7 +15, 7, 15376, 15, 8, 31532, 16, 7, 8669, 16, 8, 9959, // 15, 8 +15, 8, 15319, 15, 9, 30939, 16, 8, 8927, 16, 9, 10351, // 15, 9 +15, 9, 15311, 15, 10, 30105, 16, 9, 9265, 16, 10, 10855, // 15,10 +15, 10, 15325, 15, 11, 29078, 16, 10, 9673, 16, 11, 11460, // 15,11 +15, 11, 15330, 15, 12, 27912, 16, 11, 10135, 16, 12, 12159, // 15,12 +15, 12, 15301, 15, 13, 26660, 16, 12, 10637, 16, 13, 12938, // 15,13 +15, 13, 15220, 15, 14, 25366, 16, 13, 11164, 16, 14, 13786, // 15,14 +15, 14, 15076, 15, 15, 24063, 16, 14, 11702, 16, 15, 14695, // 15,15 +// angle of -2.0 degrees +-1, 0, 13368, -1, 1, 10104, 0, 0, 28495, 0, 1, 13569, // 0, 0 +-1, 1, 12574, -1, 2, 9662, 0, 1, 29831, 0, 2, 13469, // 0, 1 +-1, 2, 11829, -1, 3, 9229, 0, 2, 31146, 0, 3, 13332, // 0, 2 +-1, 3, 11143, -1, 4, 8816, 0, 3, 32406, 0, 4, 13171, // 0, 3 +-1, 4, 10528, -1, 5, 8438, 0, 4, 33564, 0, 5, 13006, // 0, 4 +-1, 5, 9995, -1, 6, 8107, 0, 5, 34567, 0, 6, 12867, // 0, 5 +-1, 6, 9558, -1, 7, 7839, 0, 6, 35362, 0, 7, 12777, // 0, 6 +-1, 7, 9224, -1, 8, 7643, 0, 7, 35905, 0, 8, 12764, // 0, 7 +0, 8, 35844, 0, 9, 12728, 1, 8, 9290, 1, 9, 7674, // 0, 8 +0, 9, 35315, 0, 10, 12717, 1, 9, 9635, 1, 10, 7869, // 0, 9 +0, 10, 34532, 0, 11, 12783, 1, 10, 10086, 1, 11, 8135, // 0,10 +0, 11, 33539, 0, 12, 12899, 1, 11, 10635, 1, 12, 8463, // 0,11 +0, 12, 32391, 0, 13, 13038, 1, 12, 11269, 1, 13, 8838, // 0,12 +0, 13, 31138, 0, 14, 13176, 1, 13, 11977, 1, 14, 9245, // 0,13 +0, 14, 29828, 0, 15, 13291, 1, 14, 12746, 1, 15, 9671, // 0,14 +0, 15, 28495, 0, 16, 13368, 1, 15, 13569, 1, 16, 10104, // 0,15 +0, 0, 13291, 0, 1, 9671, 1, 0, 29828, 1, 1, 12746, // 1, 0 +0, 1, 12412, 0, 2, 9202, 1, 1, 31358, 1, 2, 12564, // 1, 1 +0, 2, 11580, 0, 3, 8735, 1, 2, 32886, 1, 3, 12335, // 1, 2 +0, 3, 10808, 0, 4, 8284, 1, 3, 34369, 1, 4, 12075, // 1, 3 +0, 4, 10111, 0, 5, 7865, 1, 4, 35750, 1, 5, 11810, // 1, 4 +0, 5, 9509, 0, 6, 7497, 1, 5, 36955, 1, 6, 11575, // 1, 5 +0, 6, 9020, 0, 7, 7202, 1, 6, 37906, 1, 7, 11408, // 1, 6 +0, 7, 8662, 0, 8, 6997, 1, 7, 38534, 1, 8, 11343, // 1, 7 +1, 8, 38481, 1, 9, 11317, 2, 8, 8718, 2, 9, 7020, // 1, 8 +1, 9, 37866, 1, 10, 11360, 2, 9, 9086, 2, 10, 7224, // 1, 9 +1, 10, 36926, 1, 11, 11507, 2, 10, 9587, 2, 11, 7516, // 1,10 +1, 11, 35730, 1, 12, 11721, 2, 11, 10204, 2, 12, 7881, // 1,11 +1, 12, 34358, 1, 13, 11964, 2, 12, 10918, 2, 13, 8296, // 1,12 +1, 13, 32881, 1, 14, 12203, 2, 13, 11709, 2, 14, 8743, // 1,13 +1, 14, 31358, 1, 15, 12412, 2, 14, 12564, 2, 15, 9202, // 1,14 +1, 15, 29831, 1, 16, 12574, 2, 15, 13470, 2, 16, 9661, // 1,15 +1, 0, 13176, 1, 1, 9245, 2, 0, 31138, 2, 1, 11977, // 2, 0 +1, 1, 12203, 1, 2, 8742, 2, 1, 32881, 2, 2, 11710, // 2, 1 +1, 2, 11272, 1, 3, 8232, 2, 2, 34650, 2, 3, 11382, // 2, 2 +1, 3, 10397, 1, 4, 7728, 2, 3, 36399, 2, 4, 11012, // 2, 3 +1, 4, 9597, 1, 5, 7252, 2, 4, 38057, 2, 5, 10630, // 2, 4 +1, 5, 8902, 1, 6, 6829, 2, 5, 39526, 2, 6, 10279, // 2, 5 +1, 6, 8344, 1, 7, 6491, 2, 6, 40688, 2, 7, 10013, // 2, 6 +1, 7, 7951, 1, 8, 6266, 2, 7, 41432, 2, 8, 9887, // 2, 7 +2, 8, 41389, 2, 9, 9867, 3, 8, 7996, 3, 9, 6284, // 2, 8 +2, 9, 40656, 2, 10, 9977, 3, 9, 8397, 3, 10, 6506, // 2, 9 +2, 10, 39503, 2, 11, 10226, 3, 10, 8966, 3, 11, 6841, // 2,10 +2, 11, 38042, 2, 12, 10559, 3, 11, 9674, 3, 12, 7261, // 2,11 +2, 12, 36392, 2, 13, 10922, 3, 12, 10488, 3, 13, 7734, // 2,12 +2, 13, 34650, 2, 14, 11272, 3, 13, 11382, 3, 14, 8232, // 2,13 +2, 14, 32886, 2, 15, 11580, 3, 14, 12334, 3, 15, 8736, // 2,14 +2, 15, 31146, 2, 16, 11829, 3, 15, 13332, 3, 16, 9229, // 2,15 +2, 0, 13038, 2, 1, 8838, 3, 0, 32391, 3, 1, 11269, // 3, 0 +2, 1, 11964, 2, 2, 8296, 3, 1, 34358, 3, 2, 10918, // 3, 1 +2, 2, 10922, 2, 3, 7734, 3, 2, 36392, 3, 3, 10488, // 3, 2 +2, 3, 9924, 2, 4, 7164, 3, 3, 38450, 3, 4, 9998, // 3, 3 +2, 4, 8995, 2, 5, 6611, 3, 4, 40452, 3, 5, 9478, // 3, 4 +2, 5, 8175, 2, 6, 6108, 3, 5, 42271, 3, 6, 8982, // 3, 5 +2, 6, 7516, 2, 7, 5703, 3, 6, 43733, 3, 7, 8584, // 3, 6 +2, 7, 7072, 2, 8, 5443, 3, 7, 44649, 3, 8, 8372, // 3, 7 +3, 8, 44616, 3, 9, 8359, 4, 8, 7106, 4, 9, 5455, // 3, 8 +3, 9, 43710, 3, 10, 8558, 4, 9, 7556, 4, 10, 5712, // 3, 9 +3, 10, 42256, 3, 11, 8940, 4, 10, 8224, 4, 11, 6116, // 3,10 +3, 11, 40444, 3, 12, 9421, 4, 11, 9056, 4, 12, 6615, // 3,11 +3, 12, 38450, 3, 13, 9924, 4, 12, 9998, 4, 13, 7164, // 3,12 +3, 13, 36399, 3, 14, 10397, 4, 13, 11012, 4, 14, 7728, // 3,13 +3, 14, 34369, 3, 15, 10808, 4, 14, 12074, 4, 15, 8285, // 3,14 +3, 15, 32406, 3, 16, 11143, 4, 15, 13171, 4, 16, 8816, // 3,15 +3, 0, 12899, 3, 1, 8463, 4, 0, 33539, 4, 1, 10635, // 4, 0 +3, 1, 11721, 3, 2, 7881, 4, 1, 35730, 4, 2, 10204, // 4, 1 +3, 2, 10559, 3, 3, 7261, 4, 2, 38042, 4, 3, 9674, // 4, 2 +3, 3, 9421, 3, 4, 6615, 4, 3, 40444, 4, 4, 9056, // 4, 3 +3, 4, 8332, 3, 5, 5965, 4, 4, 42861, 4, 5, 8378, // 4, 4 +3, 5, 7342, 3, 6, 5350, 4, 5, 45146, 4, 6, 7698, // 4, 5 +3, 6, 6530, 3, 7, 4838, 4, 6, 47049, 4, 7, 7119, // 4, 6 +3, 7, 6000, 3, 8, 4513, 4, 7, 48240, 4, 8, 6783, // 4, 7 +4, 8, 48218, 4, 9, 6774, 5, 8, 6023, 5, 9, 4521, // 4, 8 +4, 9, 47035, 4, 10, 7100, 5, 9, 6558, 5, 10, 4843, // 4, 9 +4, 10, 45139, 4, 11, 7667, 5, 10, 7377, 5, 11, 5353, // 4,10 +4, 11, 42861, 4, 12, 8332, 5, 11, 8378, 5, 12, 5965, // 4,11 +4, 12, 40452, 4, 13, 8995, 5, 12, 9478, 5, 13, 6611, // 4,12 +4, 13, 38057, 4, 14, 9597, 5, 13, 10630, 5, 14, 7252, // 4,13 +4, 14, 35750, 4, 15, 10111, 5, 14, 11810, 5, 15, 7865, // 4,14 +4, 15, 33564, 4, 16, 10528, 5, 15, 13007, 5, 16, 8437, // 4,15 +4, 0, 12783, 4, 1, 8135, 5, 0, 34532, 5, 1, 10086, // 5, 0 +4, 1, 11507, 4, 2, 7517, 5, 1, 36926, 5, 2, 9586, // 5, 1 +4, 2, 10226, 4, 3, 6842, 5, 2, 39503, 5, 3, 8965, // 5, 2 +4, 3, 8940, 4, 4, 6116, 5, 3, 42256, 5, 4, 8224, // 5, 3 +4, 4, 7667, 4, 5, 5353, 5, 4, 45139, 5, 5, 7377, // 5, 4 +4, 5, 6451, 4, 6, 4591, 5, 5, 48019, 5, 6, 6475, // 5, 5 +4, 6, 5400, 4, 7, 3911, 5, 6, 50587, 5, 7, 5638, // 5, 6 +4, 7, 4708, 4, 8, 3466, 5, 7, 52266, 5, 8, 5096, // 5, 7 +5, 8, 52253, 5, 9, 5092, 6, 8, 4721, 6, 9, 3470, // 5, 8 +5, 9, 50581, 5, 10, 5624, 6, 9, 5418, 6, 10, 3913, // 5, 9 +5, 10, 48019, 5, 11, 6451, 6, 10, 6475, 6, 11, 4591, // 5,10 +5, 11, 45146, 5, 12, 7342, 6, 11, 7698, 6, 12, 5350, // 5,11 +5, 12, 42271, 5, 13, 8175, 6, 12, 8982, 6, 13, 6108, // 5,12 +5, 13, 39526, 5, 14, 8902, 6, 13, 10279, 6, 14, 6829, // 5,13 +5, 14, 36955, 5, 15, 9509, 6, 14, 11575, 6, 15, 7497, // 5,14 +5, 15, 34567, 5, 16, 9995, 6, 15, 12867, 6, 16, 8107, // 5,15 +5, 0, 12717, 5, 1, 7868, 6, 0, 35315, 6, 1, 9636, // 6, 0 +5, 1, 11360, 5, 2, 7224, 6, 1, 37866, 6, 2, 9086, // 6, 1 +5, 2, 9977, 5, 3, 6506, 6, 2, 40656, 6, 3, 8397, // 6, 2 +5, 3, 8558, 5, 4, 5712, 6, 3, 43710, 6, 4, 7556, // 6, 3 +5, 4, 7100, 5, 5, 4843, 6, 4, 47035, 6, 5, 6558, // 6, 4 +5, 5, 5624, 5, 6, 3913, 6, 5, 50581, 6, 6, 5418, // 6, 5 +5, 6, 4217, 5, 7, 2989, 6, 6, 54105, 6, 7, 4225, // 6, 6 +5, 7, 3180, 5, 8, 2294, 6, 7, 56756, 6, 8, 3306, // 6, 7 +6, 8, 56751, 6, 9, 3303, 7, 8, 3186, 7, 9, 2296, // 6, 8 +6, 9, 54105, 6, 10, 4217, 7, 9, 4225, 7, 10, 2989, // 6, 9 +6, 10, 50587, 6, 11, 5400, 7, 10, 5637, 7, 11, 3912, // 6,10 +6, 11, 47049, 6, 12, 6530, 7, 11, 7119, 7, 12, 4838, // 6,11 +6, 12, 43733, 6, 13, 7516, 7, 12, 8584, 7, 13, 5703, // 6,12 +6, 13, 40688, 6, 14, 8344, 7, 13, 10013, 7, 14, 6491, // 6,13 +6, 14, 37906, 6, 15, 9020, 7, 14, 11407, 7, 15, 7203, // 6,14 +6, 15, 35362, 6, 16, 9558, 7, 15, 12777, 7, 16, 7839, // 6,15 +6, 0, 12728, 6, 1, 7674, 7, 0, 35844, 7, 1, 9290, // 7, 0 +6, 1, 11317, 6, 2, 7020, 7, 1, 38481, 7, 2, 8718, // 7, 1 +6, 2, 9867, 6, 3, 6284, 7, 2, 41389, 7, 3, 7996, // 7, 2 +6, 3, 8359, 6, 4, 5454, 7, 3, 44616, 7, 4, 7107, // 7, 3 +6, 4, 6774, 6, 5, 4521, 7, 4, 48218, 7, 5, 6023, // 7, 4 +6, 5, 5092, 6, 6, 3470, 7, 5, 52253, 7, 6, 4721, // 7, 5 +6, 6, 3303, 6, 7, 2295, 7, 6, 56751, 7, 7, 3187, // 7, 6 +6, 7, 1541, 6, 8, 1090, 7, 7, 61364, 7, 8, 1541, // 7, 7 +7, 8, 61364, 7, 9, 1541, 8, 8, 1542, 8, 9, 1089, // 7, 8 +7, 9, 56756, 7, 10, 3180, 8, 9, 3306, 8, 10, 2294, // 7, 9 +7, 10, 52266, 7, 11, 4708, 8, 10, 5097, 8, 11, 3465, // 7,10 +7, 11, 48240, 7, 12, 6000, 8, 11, 6783, 8, 12, 4513, // 7,11 +7, 12, 44649, 7, 13, 7072, 8, 12, 8373, 8, 13, 5442, // 7,12 +7, 13, 41432, 7, 14, 7951, 8, 13, 9886, 8, 14, 6267, // 7,13 +7, 14, 38534, 7, 15, 8662, 8, 14, 11344, 8, 15, 6996, // 7,14 +7, 15, 35905, 7, 16, 9224, 8, 15, 12764, 8, 16, 7643, // 7,15 +7, -1, 7643, 7, 0, 12764, 8, -1, 9224, 8, 0, 35905, // 8, 0 +7, 0, 6997, 7, 1, 11344, 8, 0, 8662, 8, 1, 38533, // 8, 1 +7, 1, 6266, 7, 2, 9886, 8, 1, 7951, 8, 2, 41433, // 8, 2 +7, 2, 5443, 7, 3, 8373, 8, 2, 7072, 8, 3, 44648, // 8, 3 +7, 3, 4513, 7, 4, 6783, 8, 3, 6000, 8, 4, 48240, // 8, 4 +7, 4, 3466, 7, 5, 5097, 8, 4, 4708, 8, 5, 52265, // 8, 5 +7, 5, 2294, 7, 6, 3306, 8, 5, 3180, 8, 6, 56756, // 8, 6 +7, 6, 1090, 7, 7, 1542, 8, 6, 1541, 8, 7, 61363, // 8, 7 +8, 7, 1542, 8, 8, 61364, 9, 7, 1090, 9, 8, 1540, // 8, 8 +8, 8, 3186, 8, 9, 56751, 9, 8, 2295, 9, 9, 3304, // 8, 9 +8, 9, 4721, 8, 10, 52253, 9, 9, 3470, 9, 10, 5092, // 8,10 +8, 10, 6023, 8, 11, 48218, 9, 10, 4521, 9, 11, 6774, // 8,11 +8, 11, 7106, 8, 12, 44616, 9, 11, 5454, 9, 12, 8360, // 8,12 +8, 12, 7996, 8, 13, 41389, 9, 12, 6284, 9, 13, 9867, // 8,13 +8, 13, 8718, 8, 14, 38481, 9, 13, 7020, 9, 14, 11317, // 8,14 +8, 14, 9290, 8, 15, 35844, 9, 14, 7674, 9, 15, 12728, // 8,15 +8, -1, 7839, 8, 0, 12777, 9, -1, 9558, 9, 0, 35362, // 9, 0 +8, 0, 7202, 8, 1, 11407, 9, 0, 9020, 9, 1, 37907, // 9, 1 +8, 1, 6491, 8, 2, 10013, 9, 1, 8344, 9, 2, 40688, // 9, 2 +8, 2, 5703, 8, 3, 8584, 9, 2, 7516, 9, 3, 43733, // 9, 3 +8, 3, 4838, 8, 4, 7119, 9, 3, 6530, 9, 4, 47049, // 9, 4 +8, 4, 3911, 8, 5, 5637, 9, 4, 5400, 9, 5, 50588, // 9, 5 +8, 5, 2989, 8, 6, 4225, 9, 5, 4217, 9, 6, 54105, // 9, 6 +8, 6, 2295, 8, 7, 3186, 9, 6, 3303, 9, 7, 56752, // 9, 7 +9, 7, 3306, 9, 8, 56756, 10, 7, 2294, 10, 8, 3180, // 9, 8 +9, 8, 4225, 9, 9, 54105, 10, 8, 2989, 10, 9, 4217, // 9, 9 +9, 9, 5418, 9, 10, 50581, 10, 9, 3913, 10, 10, 5624, // 9,10 +9, 10, 6558, 9, 11, 47035, 10, 10, 4843, 10, 11, 7100, // 9,11 +9, 11, 7556, 9, 12, 43710, 10, 11, 5712, 10, 12, 8558, // 9,12 +9, 12, 8397, 9, 13, 40656, 10, 12, 6506, 10, 13, 9977, // 9,13 +9, 13, 9086, 9, 14, 37866, 10, 13, 7224, 10, 14, 11360, // 9,14 +9, 14, 9635, 9, 15, 35315, 10, 14, 7868, 10, 15, 12718, // 9,15 +9, -1, 8107, 9, 0, 12867, 10, -1, 9995, 10, 0, 34567, // 10, 0 +9, 0, 7497, 9, 1, 11575, 10, 0, 9509, 10, 1, 36955, // 10, 1 +9, 1, 6829, 9, 2, 10279, 10, 1, 8902, 10, 2, 39526, // 10, 2 +9, 2, 6108, 9, 3, 8982, 10, 2, 8175, 10, 3, 42271, // 10, 3 +9, 3, 5350, 9, 4, 7698, 10, 3, 7342, 10, 4, 45146, // 10, 4 +9, 4, 4591, 9, 5, 6475, 10, 4, 6451, 10, 5, 48019, // 10, 5 +9, 5, 3913, 9, 6, 5418, 10, 5, 5624, 10, 6, 50581, // 10, 6 +9, 6, 3470, 9, 7, 4721, 10, 6, 5092, 10, 7, 52253, // 10, 7 +10, 7, 5097, 10, 8, 52266, 11, 7, 3466, 11, 8, 4707, // 10, 8 +10, 8, 5637, 10, 9, 50587, 11, 8, 3911, 11, 9, 5401, // 10, 9 +10, 9, 6475, 10, 10, 48019, 11, 9, 4591, 11, 10, 6451, // 10,10 +10, 10, 7377, 10, 11, 45139, 11, 10, 5353, 11, 11, 7667, // 10,11 +10, 11, 8224, 10, 12, 42256, 11, 11, 6116, 11, 12, 8940, // 10,12 +10, 12, 8966, 10, 13, 39503, 11, 12, 6842, 11, 13, 10225, // 10,13 +10, 13, 9587, 10, 14, 36926, 11, 13, 7517, 11, 14, 11506, // 10,14 +10, 14, 10086, 10, 15, 34532, 11, 14, 8135, 11, 15, 12783, // 10,15 +10, -1, 8438, 10, 0, 13007, 11, -1, 10528, 11, 0, 33563, // 11, 0 +10, 0, 7865, 10, 1, 11810, 11, 0, 10111, 11, 1, 35750, // 11, 1 +10, 1, 7252, 10, 2, 10630, 11, 1, 9597, 11, 2, 38057, // 11, 2 +10, 2, 6611, 10, 3, 9478, 11, 2, 8995, 11, 3, 40452, // 11, 3 +10, 3, 5965, 10, 4, 8378, 11, 3, 8332, 11, 4, 42861, // 11, 4 +10, 4, 5353, 10, 5, 7377, 11, 4, 7667, 11, 5, 45139, // 11, 5 +10, 5, 4843, 10, 6, 6558, 11, 5, 7100, 11, 6, 47035, // 11, 6 +10, 6, 4521, 10, 7, 6023, 11, 6, 6774, 11, 7, 48218, // 11, 7 +11, 7, 6783, 11, 8, 48240, 12, 7, 4513, 12, 8, 6000, // 11, 8 +11, 8, 7119, 11, 9, 47049, 12, 8, 4838, 12, 9, 6530, // 11, 9 +11, 9, 7698, 11, 10, 45146, 12, 9, 5350, 12, 10, 7342, // 11,10 +11, 10, 8378, 11, 11, 42861, 12, 10, 5965, 12, 11, 8332, // 11,11 +11, 11, 9056, 11, 12, 40444, 12, 11, 6615, 12, 12, 9421, // 11,12 +11, 12, 9674, 11, 13, 38042, 12, 12, 7261, 12, 13, 10559, // 11,13 +11, 13, 10204, 11, 14, 35730, 12, 13, 7881, 12, 14, 11721, // 11,14 +11, 14, 10635, 11, 15, 33539, 12, 14, 8463, 12, 15, 12899, // 11,15 +11, -1, 8816, 11, 0, 13171, 12, -1, 11143, 12, 0, 32406, // 12, 0 +11, 0, 8284, 11, 1, 12074, 12, 0, 10808, 12, 1, 34370, // 12, 1 +11, 1, 7728, 11, 2, 11012, 12, 1, 10397, 12, 2, 36399, // 12, 2 +11, 2, 7164, 11, 3, 9998, 12, 2, 9924, 12, 3, 38450, // 12, 3 +11, 3, 6615, 11, 4, 9056, 12, 3, 9421, 12, 4, 40444, // 12, 4 +11, 4, 6116, 11, 5, 8224, 12, 4, 8940, 12, 5, 42256, // 12, 5 +11, 5, 5712, 11, 6, 7556, 12, 5, 8558, 12, 6, 43710, // 12, 6 +11, 6, 5454, 11, 7, 7106, 12, 6, 8359, 12, 7, 44617, // 12, 7 +12, 7, 8373, 12, 8, 44649, 13, 7, 5443, 13, 8, 7071, // 12, 8 +12, 8, 8584, 12, 9, 43733, 13, 8, 5703, 13, 9, 7516, // 12, 9 +12, 9, 8982, 12, 10, 42271, 13, 9, 6108, 13, 10, 8175, // 12,10 +12, 10, 9478, 12, 11, 40452, 13, 10, 6611, 13, 11, 8995, // 12,11 +12, 11, 9998, 12, 12, 38450, 13, 11, 7164, 13, 12, 9924, // 12,12 +12, 12, 10488, 12, 13, 36392, 13, 12, 7734, 13, 13, 10922, // 12,13 +12, 13, 10918, 12, 14, 34358, 13, 13, 8296, 13, 14, 11964, // 12,14 +12, 14, 11269, 12, 15, 32391, 13, 14, 8838, 13, 15, 13038, // 12,15 +12, -1, 9229, 12, 0, 13332, 13, -1, 11829, 13, 0, 31146, // 13, 0 +12, 0, 8735, 12, 1, 12334, 13, 0, 11580, 13, 1, 32887, // 13, 1 +12, 1, 8232, 12, 2, 11382, 13, 1, 11272, 13, 2, 34650, // 13, 2 +12, 2, 7734, 12, 3, 10488, 13, 2, 10922, 13, 3, 36392, // 13, 3 +12, 3, 7261, 12, 4, 9674, 13, 3, 10559, 13, 4, 38042, // 13, 4 +12, 4, 6842, 12, 5, 8966, 13, 4, 10226, 13, 5, 39502, // 13, 5 +12, 5, 6506, 12, 6, 8397, 13, 5, 9977, 13, 6, 40656, // 13, 6 +12, 6, 6284, 12, 7, 7996, 13, 6, 9867, 13, 7, 41389, // 13, 7 +13, 7, 9886, 13, 8, 41432, 14, 7, 6266, 14, 8, 7952, // 13, 8 +13, 8, 10013, 13, 9, 40688, 14, 8, 6491, 14, 9, 8344, // 13, 9 +13, 9, 10279, 13, 10, 39526, 14, 9, 6829, 14, 10, 8902, // 13,10 +13, 10, 10630, 13, 11, 38057, 14, 10, 7252, 14, 11, 9597, // 13,11 +13, 11, 11012, 13, 12, 36399, 14, 11, 7728, 14, 12, 10397, // 13,12 +13, 12, 11382, 13, 13, 34650, 14, 12, 8232, 14, 13, 11272, // 13,13 +13, 13, 11709, 13, 14, 32881, 14, 13, 8742, 14, 14, 12204, // 13,14 +13, 14, 11977, 13, 15, 31138, 14, 14, 9245, 14, 15, 13176, // 13,15 +13, -1, 9662, 13, 0, 13470, 14, -1, 12574, 14, 0, 29830, // 14, 0 +13, 0, 9202, 13, 1, 12564, 14, 0, 12412, 14, 1, 31358, // 14, 1 +13, 1, 8742, 13, 2, 11709, 14, 1, 12203, 14, 2, 32882, // 14, 2 +13, 2, 8296, 13, 3, 10918, 14, 2, 11964, 14, 3, 34358, // 14, 3 +13, 3, 7881, 13, 4, 10204, 14, 3, 11721, 14, 4, 35730, // 14, 4 +13, 4, 7517, 13, 5, 9587, 14, 4, 11507, 14, 5, 36925, // 14, 5 +13, 5, 7224, 13, 6, 9086, 14, 5, 11360, 14, 6, 37866, // 14, 6 +13, 6, 7020, 13, 7, 8718, 14, 6, 11317, 14, 7, 38481, // 14, 7 +14, 7, 11344, 14, 8, 38534, 15, 7, 6997, 15, 8, 8661, // 14, 8 +14, 8, 11407, 14, 9, 37906, 15, 8, 7202, 15, 9, 9021, // 14, 9 +14, 9, 11575, 14, 10, 36955, 15, 9, 7497, 15, 10, 9509, // 14,10 +14, 10, 11810, 14, 11, 35750, 15, 10, 7865, 15, 11, 10111, // 14,11 +14, 11, 12074, 14, 12, 34369, 15, 11, 8284, 15, 12, 10809, // 14,12 +14, 12, 12334, 14, 13, 32886, 15, 12, 8735, 15, 13, 11581, // 14,13 +14, 13, 12564, 14, 14, 31358, 15, 13, 9202, 15, 14, 12412, // 14,14 +14, 14, 12746, 14, 15, 29828, 15, 14, 9671, 15, 15, 13291, // 14,15 +14, -1, 10104, 14, 0, 13569, 15, -1, 13368, 15, 0, 28495, // 15, 0 +14, 0, 9671, 14, 1, 12746, 15, 0, 13291, 15, 1, 29828, // 15, 1 +14, 1, 9245, 14, 2, 11977, 15, 1, 13176, 15, 2, 31138, // 15, 2 +14, 2, 8838, 14, 3, 11269, 15, 2, 13038, 15, 3, 32391, // 15, 3 +14, 3, 8463, 14, 4, 10635, 15, 3, 12899, 15, 4, 33539, // 15, 4 +14, 4, 8135, 14, 5, 10086, 15, 4, 12783, 15, 5, 34532, // 15, 5 +14, 5, 7868, 14, 6, 9635, 15, 5, 12717, 15, 6, 35316, // 15, 6 +14, 6, 7674, 14, 7, 9290, 15, 6, 12728, 15, 7, 35844, // 15, 7 +15, 7, 12764, 15, 8, 35905, 16, 7, 7643, 16, 8, 9224, // 15, 8 +15, 8, 12777, 15, 9, 35362, 16, 8, 7839, 16, 9, 9558, // 15, 9 +15, 9, 12867, 15, 10, 34567, 16, 9, 8107, 16, 10, 9995, // 15,10 +15, 10, 13007, 15, 11, 33564, 16, 10, 8438, 16, 11, 10527, // 15,11 +15, 11, 13171, 15, 12, 32406, 16, 11, 8816, 16, 12, 11143, // 15,12 +15, 12, 13332, 15, 13, 31146, 16, 12, 9229, 16, 13, 11829, // 15,13 +15, 13, 13470, 15, 14, 29831, 16, 13, 9662, 16, 14, 12573, // 15,14 +15, 14, 13569, 15, 15, 28495, 16, 14, 10104, 16, 15, 13368, // 15,15 +// angle of -1.5 degrees +-1, 0, 11440, -1, 1, 8358, 0, 0, 34212, 0, 1, 11526, // 0, 0 +-1, 1, 10780, -1, 2, 7983, 0, 1, 35506, 0, 2, 11267, // 0, 1 +-1, 2, 10158, -1, 3, 7620, 0, 2, 36764, 0, 3, 10994, // 0, 2 +-1, 3, 9585, -1, 4, 7276, 0, 3, 37951, 0, 4, 10724, // 0, 3 +-1, 4, 9072, -1, 5, 6965, 0, 4, 39026, 0, 5, 10473, // 0, 4 +-1, 5, 8632, -1, 6, 6699, 0, 5, 39940, 0, 6, 10265, // 0, 5 +-1, 6, 8278, -1, 7, 6489, 0, 6, 40646, 0, 7, 10123, // 0, 6 +-1, 7, 8018, -1, 8, 6346, 0, 7, 41106, 0, 8, 10066, // 0, 7 +0, 8, 41072, 0, 9, 10052, 1, 8, 8052, 1, 9, 6360, // 0, 8 +0, 9, 40618, 0, 10, 10100, 1, 9, 8316, 1, 10, 6502, // 0, 9 +0, 10, 39918, 0, 11, 10232, 1, 10, 8676, 1, 11, 6710, // 0,10 +0, 11, 39009, 0, 12, 10430, 1, 11, 9122, 1, 12, 6975, // 0,11 +0, 12, 37939, 0, 13, 10670, 1, 12, 9642, 1, 13, 7285, // 0,12 +0, 13, 36756, 0, 14, 10930, 1, 13, 10224, 1, 14, 7626, // 0,13 +0, 14, 35502, 0, 15, 11192, 1, 14, 10855, 1, 15, 7987, // 0,14 +0, 15, 34212, 0, 16, 11440, 1, 15, 11526, 1, 16, 8358, // 0,15 +0, 0, 11192, 0, 1, 7987, 1, 0, 35502, 1, 1, 10855, // 1, 0 +0, 1, 10467, 0, 2, 7579, 1, 1, 36959, 1, 2, 10531, // 1, 1 +0, 2, 9777, 0, 3, 7177, 1, 2, 38394, 1, 3, 10188, // 1, 2 +0, 3, 9135, 0, 4, 6792, 1, 3, 39767, 1, 4, 9842, // 1, 3 +0, 4, 8557, 0, 5, 6440, 1, 4, 41026, 1, 5, 9513, // 1, 4 +0, 5, 8061, 0, 6, 6137, 1, 5, 42105, 1, 6, 9233, // 1, 5 +0, 6, 7667, 0, 7, 5900, 1, 6, 42936, 1, 7, 9033, // 1, 6 +0, 7, 7390, 0, 8, 5745, 1, 7, 43461, 1, 8, 8940, // 1, 7 +1, 8, 43433, 1, 9, 8929, 2, 8, 7418, 2, 9, 5756, // 1, 8 +1, 9, 42913, 1, 10, 9014, 2, 9, 7699, 2, 10, 5910, // 1, 9 +1, 10, 42087, 1, 11, 9206, 2, 10, 8098, 2, 11, 6145, // 1,10 +1, 11, 41013, 1, 12, 9478, 2, 11, 8599, 2, 12, 6446, // 1,11 +1, 12, 39759, 1, 13, 9796, 2, 12, 9184, 2, 13, 6797, // 1,12 +1, 13, 38390, 1, 14, 10133, 2, 13, 9834, 2, 14, 7179, // 1,13 +1, 14, 36959, 1, 15, 10467, 2, 14, 10532, 2, 15, 7578, // 1,14 +1, 15, 35506, 1, 16, 10780, 2, 15, 11267, 2, 16, 7983, // 1,15 +1, 0, 10930, 1, 1, 7626, 2, 0, 36756, 2, 1, 10224, // 2, 0 +1, 1, 10133, 1, 2, 7179, 2, 1, 38390, 2, 2, 9834, // 2, 1 +1, 2, 9366, 1, 3, 6732, 2, 2, 40025, 2, 3, 9413, // 2, 2 +1, 3, 8641, 1, 4, 6297, 2, 3, 41618, 2, 4, 8980, // 2, 3 +1, 4, 7981, 1, 5, 5891, 2, 4, 43105, 2, 5, 8559, // 2, 4 +1, 5, 7411, 1, 6, 5537, 2, 5, 44399, 2, 6, 8189, // 2, 5 +1, 6, 6961, 1, 7, 5261, 2, 6, 45401, 2, 7, 7913, // 2, 6 +1, 7, 6658, 1, 8, 5087, 2, 7, 46017, 2, 8, 7774, // 2, 7 +2, 8, 45995, 2, 9, 7766, 3, 8, 6680, 3, 9, 5095, // 2, 8 +2, 9, 45383, 2, 10, 7899, 3, 9, 6986, 3, 10, 5268, // 2, 9 +2, 10, 44386, 2, 11, 8167, 3, 10, 7440, 3, 11, 5543, // 2,10 +2, 11, 43096, 2, 12, 8530, 3, 11, 8015, 3, 12, 5895, // 2,11 +2, 12, 41614, 2, 13, 8941, 3, 12, 8681, 3, 13, 6300, // 2,12 +2, 13, 40025, 2, 14, 9366, 3, 13, 9413, 3, 14, 6732, // 2,13 +2, 14, 38394, 2, 15, 9777, 3, 14, 10188, 3, 15, 7177, // 2,14 +2, 15, 36764, 2, 16, 10158, 3, 15, 10994, 3, 16, 7620, // 2,15 +2, 0, 10670, 2, 1, 7285, 3, 0, 37939, 3, 1, 9642, // 3, 0 +2, 1, 9796, 2, 2, 6797, 3, 1, 39759, 3, 2, 9184, // 3, 1 +2, 2, 8941, 2, 3, 6299, 3, 2, 41614, 3, 3, 8682, // 3, 2 +2, 3, 8120, 2, 4, 5804, 3, 3, 43461, 3, 4, 8151, // 3, 3 +2, 4, 7356, 2, 5, 5330, 3, 4, 45229, 3, 5, 7621, // 3, 4 +2, 5, 6685, 2, 6, 4906, 3, 5, 46806, 3, 6, 7139, // 3, 5 +2, 6, 6154, 2, 7, 4572, 3, 6, 48049, 3, 7, 6761, // 3, 6 +2, 7, 5811, 2, 8, 4366, 3, 7, 48801, 3, 8, 6558, // 3, 7 +3, 8, 48785, 3, 9, 6552, 4, 8, 5827, 4, 9, 4372, // 3, 8 +3, 9, 48037, 3, 10, 6750, 4, 9, 6173, 4, 10, 4576, // 3, 9 +3, 10, 46798, 3, 11, 7121, 4, 10, 6707, 4, 11, 4910, // 3,10 +3, 11, 45224, 3, 12, 7598, 4, 11, 7382, 4, 12, 5332, // 3,11 +3, 12, 43461, 3, 13, 8120, 4, 12, 8151, 4, 13, 5804, // 3,12 +3, 13, 41618, 3, 14, 8641, 4, 13, 8979, 4, 14, 6298, // 3,13 +3, 14, 39767, 3, 15, 9135, 4, 14, 9841, 4, 15, 6793, // 3,14 +3, 15, 37951, 3, 16, 9585, 4, 15, 10723, 4, 16, 7277, // 3,15 +3, 0, 10430, 3, 1, 6975, 4, 0, 39009, 4, 1, 9122, // 4, 0 +3, 1, 9478, 3, 2, 6447, 4, 1, 41013, 4, 2, 8598, // 4, 1 +3, 2, 8530, 3, 3, 5895, 4, 2, 43096, 4, 3, 8015, // 4, 2 +3, 3, 7598, 3, 4, 5331, 4, 3, 45224, 4, 4, 7383, // 4, 3 +3, 4, 6708, 3, 5, 4774, 4, 4, 47328, 4, 5, 6726, // 4, 4 +3, 5, 5901, 3, 6, 4257, 4, 5, 49279, 4, 6, 6099, // 4, 5 +3, 6, 5248, 3, 7, 3834, 4, 6, 50873, 4, 7, 5581, // 4, 6 +3, 7, 4835, 3, 8, 3575, 4, 7, 51842, 4, 8, 5284, // 4, 7 +4, 8, 51832, 4, 9, 5280, 5, 8, 4846, 5, 9, 3578, // 4, 8 +4, 9, 50865, 4, 10, 5573, 5, 9, 5261, 5, 10, 3837, // 4, 9 +4, 10, 49275, 4, 11, 6086, 5, 10, 5917, 5, 11, 4258, // 4,10 +4, 11, 47328, 4, 12, 6708, 5, 11, 6727, 5, 12, 4773, // 4,11 +4, 12, 45229, 4, 13, 7356, 5, 12, 7622, 5, 13, 5329, // 4,12 +4, 13, 43105, 4, 14, 7981, 5, 13, 8559, 5, 14, 5891, // 4,13 +4, 14, 41026, 4, 15, 8557, 5, 14, 9513, 5, 15, 6440, // 4,14 +4, 15, 39026, 4, 16, 9072, 5, 15, 10473, 5, 16, 6965, // 4,15 +4, 0, 10232, 4, 1, 6710, 5, 0, 39918, 5, 1, 8676, // 5, 0 +4, 1, 9206, 4, 2, 6145, 5, 1, 42087, 5, 2, 8098, // 5, 1 +4, 2, 8167, 4, 3, 5543, 5, 2, 44386, 5, 3, 7440, // 5, 2 +4, 3, 7121, 4, 4, 4909, 5, 3, 46798, 5, 4, 6708, // 5, 3 +4, 4, 6086, 4, 5, 4258, 5, 4, 49275, 5, 5, 5917, // 5, 4 +4, 5, 5103, 4, 6, 3621, 5, 5, 51700, 5, 6, 5112, // 5, 5 +4, 6, 4262, 4, 7, 3064, 5, 6, 53816, 5, 7, 4394, // 5, 6 +4, 7, 3720, 4, 8, 2708, 5, 7, 55168, 5, 8, 3940, // 5, 7 +5, 8, 55162, 5, 9, 3938, 6, 8, 3726, 6, 9, 2710, // 5, 8 +5, 9, 53813, 5, 10, 4388, 6, 9, 4269, 6, 10, 3066, // 5, 9 +5, 10, 51700, 5, 11, 5103, 6, 10, 5113, 6, 11, 3620, // 5,10 +5, 11, 49279, 5, 12, 5901, 6, 11, 6099, 6, 12, 4257, // 5,11 +5, 12, 46806, 5, 13, 6685, 6, 12, 7138, 6, 13, 4907, // 5,12 +5, 13, 44399, 5, 14, 7411, 6, 13, 8189, 6, 14, 5537, // 5,13 +5, 14, 42105, 5, 15, 8061, 6, 14, 9233, 6, 15, 6137, // 5,14 +5, 15, 39940, 5, 16, 8632, 6, 15, 10265, 6, 16, 6699, // 5,15 +5, 0, 10100, 5, 1, 6502, 6, 0, 40618, 6, 1, 8316, // 6, 0 +5, 1, 9014, 5, 2, 5910, 6, 1, 42913, 6, 2, 7699, // 6, 1 +5, 2, 7899, 5, 3, 5268, 6, 2, 45383, 6, 3, 6986, // 6, 2 +5, 3, 6750, 5, 4, 4576, 6, 3, 48037, 6, 4, 6173, // 6, 3 +5, 4, 5573, 5, 5, 3837, 6, 4, 50865, 6, 5, 5261, // 6, 4 +5, 5, 4388, 5, 6, 3065, 6, 5, 53813, 6, 6, 4270, // 6, 5 +5, 6, 3271, 5, 7, 2316, 6, 6, 56673, 6, 7, 3276, // 6, 6 +5, 7, 2462, 5, 8, 1766, 6, 7, 58775, 6, 8, 2533, // 6, 7 +6, 8, 58773, 6, 9, 2532, 7, 8, 2464, 7, 9, 1767, // 6, 8 +6, 9, 56673, 6, 10, 3271, 7, 9, 3275, 7, 10, 2317, // 6, 9 +6, 10, 53816, 6, 11, 4262, 7, 10, 4394, 7, 11, 3064, // 6,10 +6, 11, 50873, 6, 12, 5248, 7, 11, 5581, 7, 12, 3834, // 6,11 +6, 12, 48049, 6, 13, 6154, 7, 12, 6761, 7, 13, 4572, // 6,12 +6, 13, 45401, 6, 14, 6961, 7, 13, 7913, 7, 14, 5261, // 6,13 +6, 14, 42936, 6, 15, 7667, 7, 14, 9032, 7, 15, 5901, // 6,14 +6, 15, 40646, 6, 16, 8278, 7, 15, 10123, 7, 16, 6489, // 6,15 +6, 0, 10052, 6, 1, 6360, 7, 0, 41072, 7, 1, 8052, // 7, 0 +6, 1, 8929, 6, 2, 5756, 7, 1, 43433, 7, 2, 7418, // 7, 1 +6, 2, 7766, 6, 3, 5095, 7, 2, 45995, 7, 3, 6680, // 7, 2 +6, 3, 6552, 6, 4, 4372, 7, 3, 48785, 7, 4, 5827, // 7, 3 +6, 4, 5280, 6, 5, 3579, 7, 4, 51832, 7, 5, 4845, // 7, 4 +6, 5, 3938, 6, 6, 2710, 7, 5, 55162, 7, 6, 3726, // 7, 5 +6, 6, 2532, 6, 7, 1767, 7, 6, 58773, 7, 7, 2464, // 7, 6 +6, 7, 1170, 6, 8, 827, 7, 7, 62369, 7, 8, 1170, // 7, 7 +7, 8, 62369, 7, 9, 1170, 8, 8, 1170, 8, 9, 827, // 7, 8 +7, 9, 58775, 7, 10, 2462, 8, 9, 2533, 8, 10, 1766, // 7, 9 +7, 10, 55168, 7, 11, 3720, 8, 10, 3940, 8, 11, 2708, // 7,10 +7, 11, 51842, 7, 12, 4835, 8, 11, 5283, 8, 12, 3576, // 7,11 +7, 12, 48801, 7, 13, 5811, 8, 12, 6558, 8, 13, 4366, // 7,12 +7, 13, 46017, 7, 14, 6658, 8, 13, 7773, 8, 14, 5088, // 7,13 +7, 14, 43461, 7, 15, 7390, 8, 14, 8939, 8, 15, 5746, // 7,14 +7, 15, 41106, 7, 16, 8018, 8, 15, 10066, 8, 16, 6346, // 7,15 +7, -1, 6346, 7, 0, 10066, 8, -1, 8018, 8, 0, 41106, // 8, 0 +7, 0, 5745, 7, 1, 8939, 8, 0, 7390, 8, 1, 43462, // 8, 1 +7, 1, 5087, 7, 2, 7773, 8, 1, 6658, 8, 2, 46018, // 8, 2 +7, 2, 4366, 7, 3, 6558, 8, 2, 5811, 8, 3, 48801, // 8, 3 +7, 3, 3575, 7, 4, 5283, 8, 3, 4835, 8, 4, 51843, // 8, 4 +7, 4, 2708, 7, 5, 3940, 8, 4, 3720, 8, 5, 55168, // 8, 5 +7, 5, 1766, 7, 6, 2533, 8, 5, 2462, 8, 6, 58775, // 8, 6 +7, 6, 827, 7, 7, 1170, 8, 6, 1170, 8, 7, 62369, // 8, 7 +8, 7, 1170, 8, 8, 62369, 9, 7, 827, 9, 8, 1170, // 8, 8 +8, 8, 2464, 8, 9, 58773, 9, 8, 1767, 9, 9, 2532, // 8, 9 +8, 9, 3726, 8, 10, 55162, 9, 9, 2710, 9, 10, 3938, // 8,10 +8, 10, 4846, 8, 11, 51832, 9, 10, 3579, 9, 11, 5279, // 8,11 +8, 11, 5827, 8, 12, 48785, 9, 11, 4372, 9, 12, 6552, // 8,12 +8, 12, 6680, 8, 13, 45995, 9, 12, 5095, 9, 13, 7766, // 8,13 +8, 13, 7418, 8, 14, 43433, 9, 13, 5756, 9, 14, 8929, // 8,14 +8, 14, 8052, 8, 15, 41072, 9, 14, 6360, 9, 15, 10052, // 8,15 +8, -1, 6489, 8, 0, 10123, 9, -1, 8278, 9, 0, 40646, // 9, 0 +8, 0, 5900, 8, 1, 9032, 9, 0, 7667, 9, 1, 42937, // 9, 1 +8, 1, 5261, 8, 2, 7913, 9, 1, 6961, 9, 2, 45401, // 9, 2 +8, 2, 4572, 8, 3, 6761, 9, 2, 6154, 9, 3, 48049, // 9, 3 +8, 3, 3834, 8, 4, 5581, 9, 3, 5248, 9, 4, 50873, // 9, 4 +8, 4, 3064, 8, 5, 4394, 9, 4, 4262, 9, 5, 53816, // 9, 5 +8, 5, 2316, 8, 6, 3275, 9, 5, 3271, 9, 6, 56674, // 9, 6 +8, 6, 1767, 8, 7, 2464, 9, 6, 2532, 9, 7, 58773, // 9, 7 +9, 7, 2533, 9, 8, 58775, 10, 7, 1766, 10, 8, 2462, // 9, 8 +9, 8, 3275, 9, 9, 56673, 10, 8, 2316, 10, 9, 3272, // 9, 9 +9, 9, 4269, 9, 10, 53813, 10, 9, 3065, 10, 10, 4389, // 9,10 +9, 10, 5261, 9, 11, 50865, 10, 10, 3837, 10, 11, 5573, // 9,11 +9, 11, 6173, 9, 12, 48037, 10, 11, 4576, 10, 12, 6750, // 9,12 +9, 12, 6986, 9, 13, 45383, 10, 12, 5268, 10, 13, 7899, // 9,13 +9, 13, 7699, 9, 14, 42913, 10, 13, 5910, 10, 14, 9014, // 9,14 +9, 14, 8316, 9, 15, 40618, 10, 14, 6502, 10, 15, 10100, // 9,15 +9, -1, 6699, 9, 0, 10265, 10, -1, 8632, 10, 0, 39940, // 10, 0 +9, 0, 6137, 9, 1, 9233, 10, 0, 8061, 10, 1, 42105, // 10, 1 +9, 1, 5537, 9, 2, 8189, 10, 1, 7411, 10, 2, 44399, // 10, 2 +9, 2, 4906, 9, 3, 7138, 10, 2, 6685, 10, 3, 46807, // 10, 3 +9, 3, 4257, 9, 4, 6099, 10, 3, 5901, 10, 4, 49279, // 10, 4 +9, 4, 3621, 9, 5, 5113, 10, 4, 5103, 10, 5, 51699, // 10, 5 +9, 5, 3065, 9, 6, 4269, 10, 5, 4388, 10, 6, 53814, // 10, 6 +9, 6, 2710, 9, 7, 3726, 10, 6, 3938, 10, 7, 55162, // 10, 7 +10, 7, 3940, 10, 8, 55168, 11, 7, 2708, 11, 8, 3720, // 10, 8 +10, 8, 4394, 10, 9, 53816, 11, 8, 3064, 11, 9, 4262, // 10, 9 +10, 9, 5113, 10, 10, 51700, 11, 9, 3621, 11, 10, 5102, // 10,10 +10, 10, 5917, 10, 11, 49275, 11, 10, 4258, 11, 11, 6086, // 10,11 +10, 11, 6707, 10, 12, 46798, 11, 11, 4909, 11, 12, 7122, // 10,12 +10, 12, 7440, 10, 13, 44386, 11, 12, 5543, 11, 13, 8167, // 10,13 +10, 13, 8098, 10, 14, 42087, 11, 13, 6145, 11, 14, 9206, // 10,14 +10, 14, 8676, 10, 15, 39918, 11, 14, 6710, 11, 15, 10232, // 10,15 +10, -1, 6965, 10, 0, 10473, 11, -1, 9072, 11, 0, 39026, // 11, 0 +10, 0, 6440, 10, 1, 9513, 11, 0, 8557, 11, 1, 41026, // 11, 1 +10, 1, 5891, 10, 2, 8559, 11, 1, 7981, 11, 2, 43105, // 11, 2 +10, 2, 5330, 10, 3, 7622, 11, 2, 7356, 11, 3, 45228, // 11, 3 +10, 3, 4774, 10, 4, 6727, 11, 3, 6708, 11, 4, 47327, // 11, 4 +10, 4, 4258, 10, 5, 5917, 11, 4, 6086, 11, 5, 49275, // 11, 5 +10, 5, 3837, 10, 6, 5261, 11, 5, 5573, 11, 6, 50865, // 11, 6 +10, 6, 3579, 10, 7, 4846, 11, 6, 5280, 11, 7, 51831, // 11, 7 +11, 7, 5283, 11, 8, 51842, 12, 7, 3575, 12, 8, 4836, // 11, 8 +11, 8, 5581, 11, 9, 50873, 12, 8, 3834, 12, 9, 5248, // 11, 9 +11, 9, 6099, 11, 10, 49279, 12, 9, 4257, 12, 10, 5901, // 11,10 +11, 10, 6727, 11, 11, 47328, 12, 10, 4774, 12, 11, 6707, // 11,11 +11, 11, 7382, 11, 12, 45224, 12, 11, 5331, 12, 12, 7599, // 11,12 +11, 12, 8015, 11, 13, 43096, 12, 12, 5895, 12, 13, 8530, // 11,13 +11, 13, 8599, 11, 14, 41013, 12, 13, 6447, 12, 14, 9477, // 11,14 +11, 14, 9122, 11, 15, 39009, 12, 14, 6975, 12, 15, 10430, // 11,15 +11, -1, 7276, 11, 0, 10723, 12, -1, 9585, 12, 0, 37952, // 12, 0 +11, 0, 6792, 11, 1, 9841, 12, 0, 9135, 12, 1, 39768, // 12, 1 +11, 1, 6297, 11, 2, 8979, 12, 1, 8641, 12, 2, 41619, // 12, 2 +11, 2, 5804, 11, 3, 8151, 12, 2, 8120, 12, 3, 43461, // 12, 3 +11, 3, 5331, 11, 4, 7382, 12, 3, 7598, 12, 4, 45225, // 12, 4 +11, 4, 4909, 11, 5, 6707, 12, 4, 7121, 12, 5, 46799, // 12, 5 +11, 5, 4576, 11, 6, 6173, 12, 5, 6750, 12, 6, 48037, // 12, 6 +11, 6, 4372, 11, 7, 5827, 12, 6, 6552, 12, 7, 48785, // 12, 7 +12, 7, 6558, 12, 8, 48801, 13, 7, 4366, 13, 8, 5811, // 12, 8 +12, 8, 6761, 12, 9, 48049, 13, 8, 4572, 13, 9, 6154, // 12, 9 +12, 9, 7138, 12, 10, 46806, 13, 9, 4906, 13, 10, 6686, // 12,10 +12, 10, 7622, 12, 11, 45229, 13, 10, 5330, 13, 11, 7355, // 12,11 +12, 11, 8151, 12, 12, 43461, 13, 11, 5804, 13, 12, 8120, // 12,12 +12, 12, 8681, 12, 13, 41614, 13, 12, 6299, 13, 13, 8942, // 12,13 +12, 13, 9184, 12, 14, 39759, 13, 13, 6797, 13, 14, 9796, // 12,14 +12, 14, 9642, 12, 15, 37939, 13, 14, 7285, 13, 15, 10670, // 12,15 +12, -1, 7620, 12, 0, 10994, 13, -1, 10158, 13, 0, 36764, // 13, 0 +12, 0, 7177, 12, 1, 10188, 13, 0, 9777, 13, 1, 38394, // 13, 1 +12, 1, 6732, 12, 2, 9413, 13, 1, 9366, 13, 2, 40025, // 13, 2 +12, 2, 6299, 12, 3, 8681, 13, 2, 8941, 13, 3, 41615, // 13, 3 +12, 3, 5895, 12, 4, 8015, 13, 3, 8530, 13, 4, 43096, // 13, 4 +12, 4, 5543, 12, 5, 7440, 13, 4, 8167, 13, 5, 44386, // 13, 5 +12, 5, 5268, 12, 6, 6986, 13, 5, 7899, 13, 6, 45383, // 13, 6 +12, 6, 5095, 12, 7, 6680, 13, 6, 7766, 13, 7, 45995, // 13, 7 +13, 7, 7773, 13, 8, 46017, 14, 7, 5087, 14, 8, 6659, // 13, 8 +13, 8, 7913, 13, 9, 45401, 14, 8, 5261, 14, 9, 6961, // 13, 9 +13, 9, 8189, 13, 10, 44399, 14, 9, 5537, 14, 10, 7411, // 13,10 +13, 10, 8559, 13, 11, 43105, 14, 10, 5891, 14, 11, 7981, // 13,11 +13, 11, 8979, 13, 12, 41618, 14, 11, 6297, 14, 12, 8642, // 13,12 +13, 12, 9413, 13, 13, 40025, 14, 12, 6732, 14, 13, 9366, // 13,13 +13, 13, 9834, 13, 14, 38390, 14, 13, 7179, 14, 14, 10133, // 13,14 +13, 14, 10224, 13, 15, 36756, 14, 14, 7626, 14, 15, 10930, // 13,15 +13, -1, 7983, 13, 0, 11267, 14, -1, 10780, 14, 0, 35506, // 14, 0 +13, 0, 7579, 13, 1, 10532, 14, 0, 10467, 14, 1, 36958, // 14, 1 +13, 1, 7179, 13, 2, 9834, 14, 1, 10133, 14, 2, 38390, // 14, 2 +13, 2, 6797, 13, 3, 9184, 14, 2, 9796, 14, 3, 39759, // 14, 3 +13, 3, 6447, 13, 4, 8599, 14, 3, 9478, 14, 4, 41012, // 14, 4 +13, 4, 6145, 13, 5, 8098, 14, 4, 9206, 14, 5, 42087, // 14, 5 +13, 5, 5910, 13, 6, 7699, 14, 5, 9014, 14, 6, 42913, // 14, 6 +13, 6, 5756, 13, 7, 7418, 14, 6, 8929, 14, 7, 43433, // 14, 7 +14, 7, 8939, 14, 8, 43461, 15, 7, 5745, 15, 8, 7391, // 14, 8 +14, 8, 9032, 14, 9, 42936, 15, 8, 5900, 15, 9, 7668, // 14, 9 +14, 9, 9233, 14, 10, 42105, 15, 9, 6137, 15, 10, 8061, // 14,10 +14, 10, 9513, 14, 11, 41026, 15, 10, 6440, 15, 11, 8557, // 14,11 +14, 11, 9841, 14, 12, 39767, 15, 11, 6792, 15, 12, 9136, // 14,12 +14, 12, 10188, 14, 13, 38394, 15, 12, 7177, 15, 13, 9777, // 14,13 +14, 13, 10532, 14, 14, 36959, 15, 13, 7579, 15, 14, 10466, // 14,14 +14, 14, 10855, 14, 15, 35502, 15, 14, 7987, 15, 15, 11192, // 14,15 +14, -1, 8358, 14, 0, 11526, 15, -1, 11440, 15, 0, 34212, // 15, 0 +14, 0, 7987, 14, 1, 10855, 15, 0, 11192, 15, 1, 35502, // 15, 1 +14, 1, 7626, 14, 2, 10224, 15, 1, 10930, 15, 2, 36756, // 15, 2 +14, 2, 7285, 14, 3, 9642, 15, 2, 10670, 15, 3, 37939, // 15, 3 +14, 3, 6975, 14, 4, 9122, 15, 3, 10430, 15, 4, 39009, // 15, 4 +14, 4, 6710, 14, 5, 8676, 15, 4, 10232, 15, 5, 39918, // 15, 5 +14, 5, 6502, 14, 6, 8316, 15, 5, 10100, 15, 6, 40618, // 15, 6 +14, 6, 6360, 14, 7, 8052, 15, 6, 10052, 15, 7, 41072, // 15, 7 +15, 7, 10066, 15, 8, 41106, 16, 7, 6346, 16, 8, 8018, // 15, 8 +15, 8, 10123, 15, 9, 40646, 16, 8, 6489, 16, 9, 8278, // 15, 9 +15, 9, 10265, 15, 10, 39940, 16, 9, 6699, 16, 10, 8632, // 15,10 +15, 10, 10473, 15, 11, 39026, 16, 10, 6965, 16, 11, 9072, // 15,11 +15, 11, 10723, 15, 12, 37951, 16, 11, 7276, 16, 12, 9586, // 15,12 +15, 12, 10994, 15, 13, 36764, 16, 12, 7620, 16, 13, 10158, // 15,13 +15, 13, 11267, 15, 14, 35506, 16, 13, 7983, 16, 14, 10780, // 15,14 +15, 14, 11526, 15, 15, 34212, 16, 14, 8358, 16, 15, 11440, // 15,15 +// angle of -1.0 degrees +-1, 0, 8769, -1, 1, 6280, 0, 0, 41693, 0, 1, 8794, // 0, 0 +-1, 1, 8265, -1, 2, 5974, 0, 1, 42823, 0, 2, 8474, // 0, 1 +-1, 2, 7791, -1, 3, 5682, 0, 2, 43904, 0, 3, 8159, // 0, 2 +-1, 3, 7356, -1, 4, 5410, 0, 3, 44907, 0, 4, 7863, // 0, 3 +-1, 4, 6970, -1, 5, 5169, 0, 4, 45799, 0, 5, 7598, // 0, 4 +-1, 5, 6644, -1, 6, 4967, 0, 5, 46541, 0, 6, 7384, // 0, 5 +-1, 6, 6391, -1, 7, 4814, 0, 6, 47098, 0, 7, 7233, // 0, 6 +-1, 7, 6217, -1, 8, 4718, 0, 7, 47440, 0, 8, 7161, // 0, 7 +0, 8, 47426, 0, 9, 7158, 1, 8, 6230, 1, 9, 4722, // 0, 8 +0, 9, 47086, 0, 10, 7227, 1, 9, 6405, 1, 10, 4818, // 0, 9 +0, 10, 46532, 0, 11, 7374, 1, 10, 6659, 1, 11, 4971, // 0,10 +0, 11, 45791, 0, 12, 7587, 1, 11, 6986, 1, 12, 5172, // 0,11 +0, 12, 44901, 0, 13, 7848, 1, 12, 7374, 1, 13, 5413, // 0,12 +0, 13, 43900, 0, 14, 8141, 1, 13, 7812, 1, 14, 5683, // 0,13 +0, 14, 42821, 0, 15, 8452, 1, 14, 8288, 1, 15, 5975, // 0,14 +0, 15, 41693, 0, 16, 8769, 1, 15, 8795, 1, 16, 6279, // 0,15 +0, 0, 8452, 0, 1, 5975, 1, 0, 42821, 1, 1, 8288, // 1, 0 +0, 1, 7901, 0, 2, 5640, 1, 1, 44074, 1, 2, 7921, // 1, 1 +0, 2, 7378, 0, 3, 5315, 1, 2, 45288, 1, 3, 7555, // 1, 2 +0, 3, 6892, 0, 4, 5009, 1, 3, 46430, 1, 4, 7205, // 1, 3 +0, 4, 6458, 0, 5, 4734, 1, 4, 47458, 1, 5, 6886, // 1, 4 +0, 5, 6092, 0, 6, 4502, 1, 5, 48322, 1, 6, 6620, // 1, 5 +0, 6, 5809, 0, 7, 4327, 1, 6, 48969, 1, 7, 6431, // 1, 6 +0, 7, 5623, 0, 8, 4221, 1, 7, 49358, 1, 8, 6334, // 1, 7 +1, 8, 49347, 1, 9, 6332, 2, 8, 5633, 2, 9, 4224, // 1, 8 +1, 9, 48960, 1, 10, 6425, 2, 9, 5820, 2, 10, 4331, // 1, 9 +1, 10, 48314, 1, 11, 6613, 2, 10, 6104, 2, 11, 4505, // 1,10 +1, 11, 47453, 1, 12, 6875, 2, 11, 6472, 2, 12, 4736, // 1,11 +1, 12, 46427, 1, 13, 7191, 2, 12, 6908, 2, 13, 5010, // 1,12 +1, 13, 45286, 1, 14, 7539, 2, 13, 7395, 2, 14, 5316, // 1,13 +1, 14, 44074, 1, 15, 7901, 2, 14, 7921, 2, 15, 5640, // 1,14 +1, 15, 42823, 1, 16, 8265, 2, 15, 8474, 2, 16, 5974, // 1,15 +1, 0, 8141, 1, 1, 5684, 2, 0, 43900, 2, 1, 7811, // 2, 0 +1, 1, 7539, 1, 2, 5316, 2, 1, 45286, 2, 2, 7395, // 2, 1 +1, 2, 6959, 1, 3, 4954, 2, 2, 46650, 2, 3, 6973, // 2, 2 +1, 3, 6414, 1, 4, 4607, 2, 3, 47955, 2, 4, 6560, // 2, 3 +1, 4, 5920, 1, 5, 4290, 2, 4, 49150, 2, 5, 6176, // 2, 4 +1, 5, 5499, 1, 6, 4019, 2, 5, 50171, 2, 6, 5847, // 2, 5 +1, 6, 5175, 1, 7, 3813, 2, 6, 50942, 2, 7, 5606, // 2, 6 +1, 7, 4970, 1, 8, 3691, 2, 7, 51395, 2, 8, 5480, // 2, 7 +2, 8, 51387, 2, 9, 5478, 3, 8, 4978, 3, 9, 3693, // 2, 8 +2, 9, 50935, 2, 10, 5602, 3, 9, 5184, 3, 10, 3815, // 2, 9 +2, 10, 50165, 2, 11, 5842, 3, 10, 5508, 3, 11, 4021, // 2,10 +2, 11, 49147, 2, 12, 6168, 3, 11, 5930, 3, 12, 4291, // 2,11 +2, 12, 47953, 2, 13, 6549, 3, 12, 6426, 3, 13, 4608, // 2,12 +2, 13, 46650, 2, 14, 6959, 3, 13, 6973, 3, 14, 4954, // 2,13 +2, 14, 45288, 2, 15, 7378, 3, 14, 7555, 3, 15, 5315, // 2,14 +2, 15, 43904, 2, 16, 7791, 3, 15, 8159, 3, 16, 5682, // 2,15 +2, 0, 7848, 2, 1, 5413, 3, 0, 44901, 3, 1, 7374, // 3, 0 +2, 1, 7191, 2, 2, 5011, 3, 1, 46427, 3, 2, 6907, // 3, 1 +2, 2, 6549, 2, 3, 4608, 3, 2, 47953, 3, 3, 6426, // 3, 2 +2, 3, 5934, 2, 4, 4214, 3, 3, 49445, 3, 4, 5943, // 3, 3 +2, 4, 5365, 2, 5, 3845, 3, 4, 50844, 3, 5, 5482, // 3, 4 +2, 5, 4872, 2, 6, 3522, 3, 5, 52069, 3, 6, 5073, // 3, 5 +2, 6, 4489, 2, 7, 3273, 3, 6, 53012, 3, 7, 4762, // 3, 6 +2, 7, 4254, 2, 8, 3126, 3, 7, 53562, 3, 8, 4594, // 3, 7 +3, 8, 53557, 3, 9, 4592, 4, 8, 4259, 4, 9, 3128, // 3, 8 +3, 9, 53008, 3, 10, 4759, 4, 9, 4495, 4, 10, 3274, // 3, 9 +3, 10, 52066, 3, 11, 5069, 4, 10, 4879, 4, 11, 3522, // 3,10 +3, 11, 50843, 3, 12, 5474, 4, 11, 5373, 4, 12, 3846, // 3,11 +3, 12, 49445, 3, 13, 5934, 4, 12, 5943, 4, 13, 4214, // 3,12 +3, 13, 47955, 3, 14, 6414, 4, 13, 6560, 4, 14, 4607, // 3,13 +3, 14, 46430, 3, 15, 6892, 4, 14, 7204, 4, 15, 5010, // 3,14 +3, 15, 44907, 3, 16, 7356, 4, 15, 7863, 4, 16, 5410, // 3,15 +3, 0, 7587, 3, 1, 5172, 4, 0, 45791, 4, 1, 6986, // 4, 0 +3, 1, 6875, 3, 2, 4736, 4, 1, 47453, 4, 2, 6472, // 4, 1 +3, 2, 6168, 3, 3, 4291, 4, 2, 49147, 4, 3, 5930, // 4, 2 +3, 3, 5474, 3, 4, 3846, 4, 3, 50843, 4, 4, 5373, // 4, 3 +3, 4, 4816, 3, 5, 3415, 4, 4, 52484, 4, 5, 4821, // 4, 4 +3, 5, 4226, 3, 6, 3023, 4, 5, 53975, 4, 6, 4312, // 4, 5 +3, 6, 3755, 3, 7, 2710, 4, 6, 55166, 4, 7, 3905, // 4, 6 +3, 7, 3469, 3, 8, 2524, 4, 7, 55870, 4, 8, 3673, // 4, 7 +4, 8, 55867, 4, 9, 3671, 5, 8, 3473, 5, 9, 2525, // 4, 8 +4, 9, 55164, 4, 10, 3902, 5, 9, 3759, 5, 10, 2711, // 4, 9 +4, 10, 53973, 4, 11, 4309, 5, 10, 4230, 5, 11, 3024, // 4,10 +4, 11, 52484, 4, 12, 4816, 5, 11, 4822, 5, 12, 3414, // 4,11 +4, 12, 50844, 4, 13, 5365, 5, 12, 5481, 5, 13, 3846, // 4,12 +4, 13, 49150, 4, 14, 5920, 5, 13, 6176, 5, 14, 4290, // 4,13 +4, 14, 47458, 4, 15, 6458, 5, 14, 6886, 5, 15, 4734, // 4,14 +4, 15, 45799, 4, 16, 6970, 5, 15, 7599, 5, 16, 5168, // 4,15 +4, 0, 7374, 4, 1, 4971, 5, 0, 46532, 5, 1, 6659, // 5, 0 +4, 1, 6613, 4, 2, 4505, 5, 1, 48314, 5, 2, 6104, // 5, 1 +4, 2, 5842, 4, 3, 4020, 5, 2, 50165, 5, 3, 5509, // 5, 2 +4, 3, 5069, 4, 4, 3523, 5, 3, 52066, 5, 4, 4878, // 5, 3 +4, 4, 4309, 4, 5, 3023, 5, 4, 53973, 5, 5, 4231, // 5, 4 +4, 5, 3595, 4, 6, 2546, 5, 5, 55798, 5, 6, 3597, // 5, 5 +4, 6, 2993, 4, 7, 2138, 5, 6, 57354, 5, 7, 3051, // 5, 6 +4, 7, 2615, 4, 8, 1884, 5, 7, 58324, 5, 8, 2713, // 5, 7 +5, 8, 58322, 5, 9, 2713, 6, 8, 2616, 6, 9, 1885, // 5, 8 +5, 9, 57353, 5, 10, 3050, 6, 9, 2995, 6, 10, 2138, // 5, 9 +5, 10, 55798, 5, 11, 3595, 6, 10, 3598, 6, 11, 2545, // 5,10 +5, 11, 53975, 5, 12, 4226, 6, 11, 4313, 6, 12, 3022, // 5,11 +5, 12, 52069, 5, 13, 4872, 6, 12, 5073, 6, 13, 3522, // 5,12 +5, 13, 50171, 5, 14, 5499, 6, 13, 5848, 6, 14, 4018, // 5,13 +5, 14, 48322, 5, 15, 6092, 6, 14, 6620, 6, 15, 4502, // 5,14 +5, 15, 46541, 5, 16, 6644, 6, 15, 7383, 6, 16, 4968, // 5,15 +5, 0, 7227, 5, 1, 4818, 6, 0, 47086, 6, 1, 6405, // 6, 0 +5, 1, 6425, 5, 2, 4330, 6, 1, 48960, 6, 2, 5821, // 6, 1 +5, 2, 5602, 5, 3, 3815, 6, 2, 50935, 6, 3, 5184, // 6, 2 +5, 3, 4759, 5, 4, 3274, 6, 3, 53008, 6, 4, 4495, // 6, 3 +5, 4, 3902, 5, 5, 2711, 6, 4, 55164, 6, 5, 3759, // 6, 4 +5, 5, 3050, 5, 6, 2138, 6, 5, 57353, 6, 6, 2995, // 6, 5 +5, 6, 2258, 5, 7, 1597, 6, 6, 59422, 6, 7, 2259, // 6, 6 +5, 7, 1695, 5, 8, 1209, 6, 7, 60906, 6, 8, 1726, // 6, 7 +6, 8, 60905, 6, 9, 1726, 7, 8, 1695, 7, 9, 1210, // 6, 8 +6, 9, 59422, 6, 10, 2258, 7, 9, 2259, 7, 10, 1597, // 6, 9 +6, 10, 57354, 6, 11, 2993, 7, 10, 3051, 7, 11, 2138, // 6,10 +6, 11, 55166, 6, 12, 3755, 7, 11, 3904, 7, 12, 2711, // 6,11 +6, 12, 53012, 6, 13, 4489, 7, 12, 4762, 7, 13, 3273, // 6,12 +6, 13, 50942, 6, 14, 5175, 7, 13, 5606, 7, 14, 3813, // 6,13 +6, 14, 48969, 6, 15, 5809, 7, 14, 6430, 7, 15, 4328, // 6,14 +6, 15, 47098, 6, 16, 6391, 7, 15, 7233, 7, 16, 4814, // 6,15 +6, 0, 7158, 6, 1, 4722, 7, 0, 47426, 7, 1, 6230, // 7, 0 +6, 1, 6332, 6, 2, 4224, 7, 1, 49347, 7, 2, 5633, // 7, 1 +6, 2, 5478, 6, 3, 3693, 7, 2, 51387, 7, 3, 4978, // 7, 2 +6, 3, 4592, 6, 4, 3128, 7, 3, 53557, 7, 4, 4259, // 7, 3 +6, 4, 3671, 6, 5, 2525, 7, 4, 55867, 7, 5, 3473, // 7, 4 +6, 5, 2713, 6, 6, 1884, 7, 5, 58322, 7, 6, 2617, // 7, 5 +6, 6, 1726, 6, 7, 1210, 7, 6, 60905, 7, 7, 1695, // 7, 6 +6, 7, 789, 6, 8, 558, 7, 7, 63399, 7, 8, 790, // 7, 7 +7, 8, 63399, 7, 9, 789, 8, 8, 789, 8, 9, 559, // 7, 8 +7, 9, 60906, 7, 10, 1695, 8, 9, 1726, 8, 10, 1209, // 7, 9 +7, 10, 58324, 7, 11, 2615, 8, 10, 2714, 8, 11, 1883, // 7,10 +7, 11, 55870, 7, 12, 3469, 8, 11, 3672, 8, 12, 2525, // 7,11 +7, 12, 53562, 7, 13, 4254, 8, 12, 4594, 8, 13, 3126, // 7,12 +7, 13, 51395, 7, 14, 4970, 8, 13, 5480, 8, 14, 3691, // 7,13 +7, 14, 49358, 7, 15, 5623, 8, 14, 6335, 8, 15, 4220, // 7,14 +7, 15, 47440, 7, 16, 6217, 8, 15, 7161, 8, 16, 4718, // 7,15 +7, -1, 4718, 7, 0, 7161, 8, -1, 6217, 8, 0, 47440, // 8, 0 +7, 0, 4221, 7, 1, 6335, 8, 0, 5623, 8, 1, 49357, // 8, 1 +7, 1, 3691, 7, 2, 5480, 8, 1, 4970, 8, 2, 51395, // 8, 2 +7, 2, 3126, 7, 3, 4594, 8, 2, 4254, 8, 3, 53562, // 8, 3 +7, 3, 2524, 7, 4, 3672, 8, 3, 3469, 8, 4, 55871, // 8, 4 +7, 4, 1884, 7, 5, 2714, 8, 4, 2615, 8, 5, 58323, // 8, 5 +7, 5, 1209, 7, 6, 1726, 8, 5, 1695, 8, 6, 60906, // 8, 6 +7, 6, 558, 7, 7, 789, 8, 6, 789, 8, 7, 63400, // 8, 7 +8, 7, 789, 8, 8, 63399, 9, 7, 558, 9, 8, 790, // 8, 8 +8, 8, 1695, 8, 9, 60905, 9, 8, 1210, 9, 9, 1726, // 8, 9 +8, 9, 2616, 8, 10, 58322, 9, 9, 1884, 9, 10, 2714, // 8,10 +8, 10, 3473, 8, 11, 55867, 9, 10, 2525, 9, 11, 3671, // 8,11 +8, 11, 4259, 8, 12, 53557, 9, 11, 3128, 9, 12, 4592, // 8,12 +8, 12, 4978, 8, 13, 51387, 9, 12, 3693, 9, 13, 5478, // 8,13 +8, 13, 5633, 8, 14, 49347, 9, 13, 4224, 9, 14, 6332, // 8,14 +8, 14, 6230, 8, 15, 47426, 9, 14, 4722, 9, 15, 7158, // 8,15 +8, -1, 4814, 8, 0, 7233, 9, -1, 6391, 9, 0, 47098, // 9, 0 +8, 0, 4327, 8, 1, 6430, 9, 0, 5809, 9, 1, 48970, // 9, 1 +8, 1, 3813, 8, 2, 5606, 9, 1, 5175, 9, 2, 50942, // 9, 2 +8, 2, 3273, 8, 3, 4762, 9, 2, 4489, 9, 3, 53012, // 9, 3 +8, 3, 2710, 8, 4, 3904, 9, 3, 3755, 9, 4, 55167, // 9, 4 +8, 4, 2138, 8, 5, 3051, 9, 4, 2993, 9, 5, 57354, // 9, 5 +8, 5, 1597, 8, 6, 2259, 9, 5, 2258, 9, 6, 59422, // 9, 6 +8, 6, 1210, 8, 7, 1695, 9, 6, 1726, 9, 7, 60905, // 9, 7 +9, 7, 1726, 9, 8, 60906, 10, 7, 1209, 10, 8, 1695, // 9, 8 +9, 8, 2259, 9, 9, 59422, 10, 8, 1597, 10, 9, 2258, // 9, 9 +9, 9, 2995, 9, 10, 57353, 10, 9, 2138, 10, 10, 3050, // 9,10 +9, 10, 3759, 9, 11, 55164, 10, 10, 2711, 10, 11, 3902, // 9,11 +9, 11, 4495, 9, 12, 53008, 10, 11, 3274, 10, 12, 4759, // 9,12 +9, 12, 5184, 9, 13, 50935, 10, 12, 3815, 10, 13, 5602, // 9,13 +9, 13, 5820, 9, 14, 48960, 10, 13, 4330, 10, 14, 6426, // 9,14 +9, 14, 6405, 9, 15, 47086, 10, 14, 4818, 10, 15, 7227, // 9,15 +9, -1, 4967, 9, 0, 7383, 10, -1, 6644, 10, 0, 46542, // 10, 0 +9, 0, 4502, 9, 1, 6620, 10, 0, 6092, 10, 1, 48322, // 10, 1 +9, 1, 4019, 9, 2, 5848, 10, 1, 5499, 10, 2, 50170, // 10, 2 +9, 2, 3522, 9, 3, 5073, 10, 2, 4872, 10, 3, 52069, // 10, 3 +9, 3, 3023, 9, 4, 4313, 10, 3, 4226, 10, 4, 53974, // 10, 4 +9, 4, 2546, 9, 5, 3598, 10, 4, 3595, 10, 5, 55797, // 10, 5 +9, 5, 2138, 9, 6, 2995, 10, 5, 3050, 10, 6, 57353, // 10, 6 +9, 6, 1884, 9, 7, 2616, 10, 6, 2713, 10, 7, 58323, // 10, 7 +10, 7, 2714, 10, 8, 58324, 11, 7, 1884, 11, 8, 2614, // 10, 8 +10, 8, 3051, 10, 9, 57354, 11, 8, 2138, 11, 9, 2993, // 10, 9 +10, 9, 3598, 10, 10, 55798, 11, 9, 2546, 11, 10, 3594, // 10,10 +10, 10, 4230, 10, 11, 53973, 11, 10, 3023, 11, 11, 4310, // 10,11 +10, 11, 4879, 10, 12, 52066, 11, 11, 3523, 11, 12, 5068, // 10,12 +10, 12, 5508, 10, 13, 50165, 11, 12, 4020, 11, 13, 5843, // 10,13 +10, 13, 6104, 10, 14, 48314, 11, 13, 4505, 11, 14, 6613, // 10,14 +10, 14, 6659, 10, 15, 46532, 11, 14, 4971, 11, 15, 7374, // 10,15 +10, -1, 5169, 10, 0, 7599, 11, -1, 6970, 11, 0, 45798, // 11, 0 +10, 0, 4734, 10, 1, 6886, 11, 0, 6458, 11, 1, 47458, // 11, 1 +10, 1, 4290, 10, 2, 6176, 11, 1, 5920, 11, 2, 49150, // 11, 2 +10, 2, 3845, 10, 3, 5481, 11, 2, 5365, 11, 3, 50845, // 11, 3 +10, 3, 3415, 10, 4, 4822, 11, 3, 4816, 11, 4, 52483, // 11, 4 +10, 4, 3023, 10, 5, 4230, 11, 4, 4309, 11, 5, 53974, // 11, 5 +10, 5, 2711, 10, 6, 3759, 11, 5, 3902, 11, 6, 55164, // 11, 6 +10, 6, 2525, 10, 7, 3473, 11, 6, 3671, 11, 7, 55867, // 11, 7 +11, 7, 3672, 11, 8, 55870, 12, 7, 2524, 12, 8, 3470, // 11, 8 +11, 8, 3904, 11, 9, 55166, 12, 8, 2710, 12, 9, 3756, // 11, 9 +11, 9, 4313, 11, 10, 53975, 12, 9, 3023, 12, 10, 4225, // 11,10 +11, 10, 4822, 11, 11, 52484, 12, 10, 3415, 12, 11, 4815, // 11,11 +11, 11, 5373, 11, 12, 50843, 12, 11, 3846, 12, 12, 5474, // 11,12 +11, 12, 5930, 11, 13, 49147, 12, 12, 4291, 12, 13, 6168, // 11,13 +11, 13, 6472, 11, 14, 47453, 12, 13, 4736, 12, 14, 6875, // 11,14 +11, 14, 6986, 11, 15, 45791, 12, 14, 5172, 12, 15, 7587, // 11,15 +11, -1, 5410, 11, 0, 7863, 12, -1, 7356, 12, 0, 44907, // 12, 0 +11, 0, 5009, 11, 1, 7204, 12, 0, 6892, 12, 1, 46431, // 12, 1 +11, 1, 4607, 11, 2, 6560, 12, 1, 6414, 12, 2, 47955, // 12, 2 +11, 2, 4214, 11, 3, 5943, 12, 2, 5934, 12, 3, 49445, // 12, 3 +11, 3, 3846, 11, 4, 5373, 12, 3, 5474, 12, 4, 50843, // 12, 4 +11, 4, 3523, 11, 5, 4879, 12, 4, 5069, 12, 5, 52065, // 12, 5 +11, 5, 3274, 11, 6, 4495, 12, 5, 4759, 12, 6, 53008, // 12, 6 +11, 6, 3128, 11, 7, 4259, 12, 6, 4592, 12, 7, 53557, // 12, 7 +12, 7, 4594, 12, 8, 53562, 13, 7, 3126, 13, 8, 4254, // 12, 8 +12, 8, 4762, 12, 9, 53012, 13, 8, 3273, 13, 9, 4489, // 12, 9 +12, 9, 5073, 12, 10, 52069, 13, 9, 3522, 13, 10, 4872, // 12,10 +12, 10, 5481, 12, 11, 50844, 13, 10, 3845, 13, 11, 5366, // 12,11 +12, 11, 5943, 12, 12, 49445, 13, 11, 4214, 13, 12, 5934, // 12,12 +12, 12, 6426, 12, 13, 47953, 13, 12, 4608, 13, 13, 6549, // 12,13 +12, 13, 6908, 12, 14, 46427, 13, 13, 5011, 13, 14, 7190, // 12,14 +12, 14, 7374, 12, 15, 44901, 13, 14, 5413, 13, 15, 7848, // 12,15 +12, -1, 5682, 12, 0, 8159, 13, -1, 7791, 13, 0, 43904, // 13, 0 +12, 0, 5315, 12, 1, 7555, 13, 0, 7378, 13, 1, 45288, // 13, 1 +12, 1, 4954, 12, 2, 6973, 13, 1, 6959, 13, 2, 46650, // 13, 2 +12, 2, 4608, 12, 3, 6426, 13, 2, 6549, 13, 3, 47953, // 13, 3 +12, 3, 4291, 12, 4, 5930, 13, 3, 6168, 13, 4, 49147, // 13, 4 +12, 4, 4020, 12, 5, 5508, 13, 4, 5842, 13, 5, 50166, // 13, 5 +12, 5, 3815, 12, 6, 5184, 13, 5, 5602, 13, 6, 50935, // 13, 6 +12, 6, 3693, 12, 7, 4978, 13, 6, 5478, 13, 7, 51387, // 13, 7 +13, 7, 5480, 13, 8, 51395, 14, 7, 3691, 14, 8, 4970, // 13, 8 +13, 8, 5606, 13, 9, 50942, 14, 8, 3813, 14, 9, 5175, // 13, 9 +13, 9, 5848, 13, 10, 50171, 14, 9, 4019, 14, 10, 5498, // 13,10 +13, 10, 6176, 13, 11, 49150, 14, 10, 4290, 14, 11, 5920, // 13,11 +13, 11, 6560, 13, 12, 47955, 14, 11, 4607, 14, 12, 6414, // 13,12 +13, 12, 6973, 13, 13, 46650, 14, 12, 4954, 14, 13, 6959, // 13,13 +13, 13, 7395, 13, 14, 45286, 14, 13, 5316, 14, 14, 7539, // 13,14 +13, 14, 7812, 13, 15, 43900, 14, 14, 5684, 14, 15, 8140, // 13,15 +13, -1, 5974, 13, 0, 8474, 14, -1, 8265, 14, 0, 42823, // 14, 0 +13, 0, 5640, 13, 1, 7921, 14, 0, 7901, 14, 1, 44074, // 14, 1 +13, 1, 5316, 13, 2, 7395, 14, 1, 7539, 14, 2, 45286, // 14, 2 +13, 2, 5011, 13, 3, 6908, 14, 2, 7191, 14, 3, 46426, // 14, 3 +13, 3, 4736, 13, 4, 6472, 14, 3, 6875, 14, 4, 47453, // 14, 4 +13, 4, 4505, 13, 5, 6104, 14, 4, 6613, 14, 5, 48314, // 14, 5 +13, 5, 4330, 13, 6, 5820, 14, 5, 6425, 14, 6, 48961, // 14, 6 +13, 6, 4224, 13, 7, 5633, 14, 6, 6332, 14, 7, 49347, // 14, 7 +14, 7, 6335, 14, 8, 49358, 15, 7, 4221, 15, 8, 5622, // 14, 8 +14, 8, 6430, 14, 9, 48969, 15, 8, 4327, 15, 9, 5810, // 14, 9 +14, 9, 6620, 14, 10, 48322, 15, 9, 4502, 15, 10, 6092, // 14,10 +14, 10, 6886, 14, 11, 47458, 15, 10, 4734, 15, 11, 6458, // 14,11 +14, 11, 7204, 14, 12, 46430, 15, 11, 5009, 15, 12, 6893, // 14,12 +14, 12, 7555, 14, 13, 45288, 15, 12, 5315, 15, 13, 7378, // 14,13 +14, 13, 7921, 14, 14, 44074, 15, 13, 5640, 15, 14, 7901, // 14,14 +14, 14, 8288, 14, 15, 42821, 15, 14, 5975, 15, 15, 8452, // 14,15 +14, -1, 6280, 14, 0, 8795, 15, -1, 8769, 15, 0, 41692, // 15, 0 +14, 0, 5975, 14, 1, 8288, 15, 0, 8452, 15, 1, 42821, // 15, 1 +14, 1, 5684, 14, 2, 7812, 15, 1, 8141, 15, 2, 43899, // 15, 2 +14, 2, 5413, 14, 3, 7374, 15, 2, 7848, 15, 3, 44901, // 15, 3 +14, 3, 5172, 14, 4, 6986, 15, 3, 7587, 15, 4, 45791, // 15, 4 +14, 4, 4971, 14, 5, 6659, 15, 4, 7374, 15, 5, 46532, // 15, 5 +14, 5, 4818, 14, 6, 6405, 15, 5, 7227, 15, 6, 47086, // 15, 6 +14, 6, 4722, 14, 7, 6230, 15, 6, 7158, 15, 7, 47426, // 15, 7 +15, 7, 7161, 15, 8, 47440, 16, 7, 4718, 16, 8, 6217, // 15, 8 +15, 8, 7233, 15, 9, 47098, 16, 8, 4814, 16, 9, 6391, // 15, 9 +15, 9, 7383, 15, 10, 46541, 16, 9, 4967, 16, 10, 6645, // 15,10 +15, 10, 7599, 15, 11, 45799, 16, 10, 5169, 16, 11, 6969, // 15,11 +15, 11, 7863, 15, 12, 44907, 16, 11, 5410, 16, 12, 7356, // 15,12 +15, 12, 8159, 15, 13, 43904, 16, 12, 5682, 16, 13, 7791, // 15,13 +15, 13, 8474, 15, 14, 42823, 16, 13, 5974, 16, 14, 8265, // 15,14 +15, 14, 8795, 15, 15, 41693, 16, 14, 6280, 16, 15, 8768, // 15,15 +// angle of -0.5 degrees +-1, 0, 5106, -1, 1, 3621, 0, 0, 51699, 0, 1, 5110, // 0, 0 +-1, 1, 4803, -1, 2, 3421, 0, 1, 52457, 0, 2, 4855, // 0, 1 +-1, 2, 4521, -1, 3, 3235, 0, 2, 53168, 0, 3, 4612, // 0, 2 +-1, 3, 4264, -1, 4, 3064, 0, 3, 53815, 0, 4, 4393, // 0, 3 +-1, 4, 4041, -1, 5, 2916, 0, 4, 54378, 0, 5, 4201, // 0, 4 +-1, 5, 3858, -1, 6, 2796, 0, 5, 54835, 0, 6, 4047, // 0, 5 +-1, 6, 3722, -1, 7, 2709, 0, 6, 55166, 0, 7, 3939, // 0, 6 +-1, 7, 3638, -1, 8, 2659, 0, 7, 55354, 0, 8, 3885, // 0, 7 +0, 8, 55352, 0, 9, 3885, 1, 8, 3640, 1, 9, 2659, // 0, 8 +0, 9, 55164, 0, 10, 3939, 1, 9, 3724, 1, 10, 2709, // 0, 9 +0, 10, 54833, 0, 11, 4046, 1, 10, 3860, 1, 11, 2797, // 0,10 +0, 11, 54376, 0, 12, 4200, 1, 11, 4043, 1, 12, 2917, // 0,11 +0, 12, 53814, 0, 13, 4390, 1, 12, 4267, 1, 13, 3065, // 0,12 +0, 13, 53168, 0, 14, 4610, 1, 13, 4523, 1, 14, 3235, // 0,13 +0, 14, 52457, 0, 15, 4851, 1, 14, 4806, 1, 15, 3422, // 0,14 +0, 15, 51699, 0, 16, 5106, 1, 15, 5110, 1, 16, 3621, // 0,15 +0, 0, 4851, 0, 1, 3422, 1, 0, 52457, 1, 1, 4806, // 1, 0 +0, 1, 4522, 0, 2, 3204, 1, 1, 53285, 1, 2, 4525, // 1, 1 +0, 2, 4212, 0, 3, 2998, 1, 2, 54072, 1, 3, 4254, // 1, 2 +0, 3, 3927, 0, 4, 2808, 1, 3, 54796, 1, 4, 4005, // 1, 3 +0, 4, 3677, 0, 5, 2640, 1, 4, 55435, 1, 5, 3784, // 1, 4 +0, 5, 3470, 0, 6, 2502, 1, 5, 55959, 1, 6, 3605, // 1, 5 +0, 6, 3317, 0, 7, 2402, 1, 6, 56340, 1, 7, 3477, // 1, 6 +0, 7, 3225, 0, 8, 2346, 1, 7, 56554, 1, 8, 3411, // 1, 7 +1, 8, 56552, 1, 9, 3411, 2, 8, 3227, 2, 9, 2346, // 1, 8 +1, 9, 56339, 1, 10, 3476, 2, 9, 3319, 2, 10, 2402, // 1, 9 +1, 10, 55958, 1, 11, 3604, 2, 10, 3472, 2, 11, 2502, // 1,10 +1, 11, 55434, 1, 12, 3783, 2, 11, 3678, 2, 12, 2641, // 1,11 +1, 12, 54796, 1, 13, 4003, 2, 12, 3929, 2, 13, 2808, // 1,12 +1, 13, 54071, 1, 14, 4253, 2, 13, 4214, 2, 14, 2998, // 1,13 +1, 14, 53285, 1, 15, 4522, 2, 14, 4525, 2, 15, 3204, // 1,14 +1, 15, 52457, 1, 16, 4803, 2, 15, 4854, 2, 16, 3422, // 1,15 +1, 0, 4610, 1, 1, 3235, 2, 0, 53168, 2, 1, 4523, // 2, 0 +1, 1, 4253, 1, 2, 2998, 2, 1, 54071, 2, 2, 4214, // 2, 1 +1, 2, 3911, 1, 3, 2770, 2, 2, 54941, 2, 3, 3914, // 2, 2 +1, 3, 3594, 1, 4, 2556, 2, 3, 55756, 2, 4, 3630, // 2, 3 +1, 4, 3310, 1, 5, 2365, 2, 4, 56487, 2, 5, 3374, // 2, 4 +1, 5, 3073, 1, 6, 2205, 2, 5, 57096, 2, 6, 3162, // 2, 5 +1, 6, 2897, 1, 7, 2088, 2, 6, 57545, 2, 7, 3006, // 2, 6 +1, 7, 2794, 1, 8, 2022, 2, 7, 57795, 2, 8, 2925, // 2, 7 +2, 8, 57793, 2, 9, 2926, 3, 8, 2795, 3, 9, 2022, // 2, 8 +2, 9, 57544, 2, 10, 3007, 3, 9, 2898, 3, 10, 2087, // 2, 9 +2, 10, 57095, 2, 11, 3161, 3, 10, 3074, 3, 11, 2206, // 2,10 +2, 11, 56486, 2, 12, 3373, 3, 11, 3311, 3, 12, 2366, // 2,11 +2, 12, 55756, 2, 13, 3628, 3, 12, 3595, 3, 13, 2557, // 2,12 +2, 13, 54941, 2, 14, 3911, 3, 13, 3913, 3, 14, 2771, // 2,13 +2, 14, 54072, 2, 15, 4212, 3, 14, 4255, 3, 15, 2997, // 2,14 +2, 15, 53168, 2, 16, 4521, 3, 15, 4612, 3, 16, 3235, // 2,15 +2, 0, 4390, 2, 1, 3065, 3, 0, 53814, 3, 1, 4267, // 3, 0 +2, 1, 4003, 2, 2, 2808, 3, 1, 54796, 3, 2, 3929, // 3, 1 +2, 2, 3628, 2, 3, 2557, 3, 2, 55756, 3, 3, 3595, // 3, 2 +2, 3, 3273, 2, 4, 2317, 3, 3, 56673, 3, 4, 3273, // 3, 3 +2, 4, 2948, 2, 5, 2096, 3, 4, 57514, 3, 5, 2978, // 3, 4 +2, 5, 2672, 2, 6, 1908, 3, 5, 58234, 3, 6, 2722, // 3, 5 +2, 6, 2463, 2, 7, 1766, 3, 6, 58775, 3, 7, 2532, // 3, 6 +2, 7, 2342, 2, 8, 1687, 3, 7, 59077, 3, 8, 2430, // 3, 7 +3, 8, 59076, 3, 9, 2430, 4, 8, 2343, 4, 9, 1687, // 3, 8 +3, 9, 58774, 3, 10, 2532, 4, 9, 2464, 4, 10, 1766, // 3, 9 +3, 10, 58233, 3, 11, 2722, 4, 10, 2673, 4, 11, 1908, // 3,10 +3, 11, 57514, 3, 12, 2976, 4, 11, 2950, 4, 12, 2096, // 3,11 +3, 12, 56673, 3, 13, 3273, 4, 12, 3274, 4, 13, 2316, // 3,12 +3, 13, 55756, 3, 14, 3594, 4, 13, 3630, 4, 14, 2556, // 3,13 +3, 14, 54796, 3, 15, 3927, 4, 14, 4005, 4, 15, 2808, // 3,14 +3, 15, 53815, 3, 16, 4264, 4, 15, 4392, 4, 16, 3065, // 3,15 +3, 0, 4200, 3, 1, 2917, 4, 0, 54376, 4, 1, 4043, // 4, 0 +3, 1, 3783, 3, 2, 2640, 4, 1, 55434, 4, 2, 3679, // 4, 1 +3, 2, 3373, 3, 3, 2365, 4, 2, 56486, 4, 3, 3312, // 4, 2 +3, 3, 2976, 3, 4, 2096, 4, 3, 57514, 4, 4, 2950, // 4, 3 +3, 4, 2604, 3, 5, 1843, 4, 4, 58484, 4, 5, 2605, // 4, 4 +3, 5, 2276, 3, 6, 1617, 4, 5, 59346, 4, 6, 2297, // 4, 5 +3, 6, 2020, 3, 7, 1442, 4, 6, 60018, 4, 7, 2056, // 4, 6 +3, 7, 1871, 3, 8, 1341, 4, 7, 60402, 4, 8, 1922, // 4, 7 +4, 8, 60402, 4, 9, 1922, 5, 8, 1871, 5, 9, 1341, // 4, 8 +4, 9, 60017, 4, 10, 2057, 5, 9, 2020, 5, 10, 1442, // 4, 9 +4, 10, 59345, 4, 11, 2297, 5, 10, 2276, 5, 11, 1618, // 4,10 +4, 11, 58484, 4, 12, 2604, 5, 11, 2605, 5, 12, 1843, // 4,11 +4, 12, 57514, 4, 13, 2948, 5, 12, 2977, 5, 13, 2097, // 4,12 +4, 13, 56487, 4, 14, 3310, 5, 13, 3374, 5, 14, 2365, // 4,13 +4, 14, 55435, 4, 15, 3677, 5, 14, 3785, 5, 15, 2639, // 4,14 +4, 15, 54378, 4, 16, 4041, 5, 15, 4201, 5, 16, 2916, // 4,15 +4, 0, 4046, 4, 1, 2797, 5, 0, 54833, 5, 1, 3860, // 5, 0 +4, 1, 3604, 4, 2, 2503, 5, 1, 55958, 5, 2, 3471, // 5, 1 +4, 2, 3161, 4, 3, 2205, 5, 2, 57095, 5, 3, 3075, // 5, 2 +4, 3, 2722, 4, 4, 1908, 5, 3, 58233, 5, 4, 2673, // 5, 3 +4, 4, 2297, 4, 5, 1617, 5, 4, 59345, 5, 5, 2277, // 5, 4 +4, 5, 1904, 4, 6, 1347, 5, 5, 60381, 5, 6, 1904, // 5, 5 +4, 6, 1578, 4, 7, 1121, 5, 6, 61243, 5, 7, 1594, // 5, 6 +4, 7, 1380, 4, 8, 985, 5, 7, 61767, 5, 8, 1404, // 5, 7 +5, 8, 61767, 5, 9, 1405, 6, 8, 1380, 6, 9, 984, // 5, 8 +5, 9, 61243, 5, 10, 1593, 6, 9, 1579, 6, 10, 1121, // 5, 9 +5, 10, 60381, 5, 11, 1904, 6, 10, 1904, 6, 11, 1347, // 5,10 +5, 11, 59346, 5, 12, 2276, 6, 11, 2297, 6, 12, 1617, // 5,11 +5, 12, 58234, 5, 13, 2672, 6, 12, 2723, 6, 13, 1907, // 5,12 +5, 13, 57096, 5, 14, 3073, 6, 13, 3161, 6, 14, 2206, // 5,13 +5, 14, 55959, 5, 15, 3470, 6, 14, 3605, 6, 15, 2502, // 5,14 +5, 15, 54835, 5, 16, 3858, 6, 15, 4047, 6, 16, 2796, // 5,15 +5, 0, 3939, 5, 1, 2709, 6, 0, 55164, 6, 1, 3724, // 6, 0 +5, 1, 3476, 5, 2, 2403, 6, 1, 56339, 6, 2, 3318, // 6, 1 +5, 2, 3007, 5, 3, 2088, 6, 2, 57544, 6, 3, 2897, // 6, 2 +5, 3, 2532, 5, 4, 1767, 6, 3, 58774, 6, 4, 2463, // 6, 3 +5, 4, 2057, 5, 5, 1442, 6, 4, 60017, 6, 5, 2020, // 6, 4 +5, 5, 1593, 5, 6, 1121, 6, 5, 61243, 6, 6, 1579, // 6, 5 +5, 6, 1170, 5, 7, 827, 6, 6, 62369, 6, 7, 1170, // 6, 6 +5, 7, 875, 5, 8, 622, 6, 7, 63156, 6, 8, 883, // 6, 7 +6, 8, 63156, 6, 9, 883, 7, 8, 875, 7, 9, 622, // 6, 8 +6, 9, 62369, 6, 10, 1170, 7, 9, 1170, 7, 10, 827, // 6, 9 +6, 10, 61243, 6, 11, 1578, 7, 10, 1593, 7, 11, 1122, // 6,10 +6, 11, 60018, 6, 12, 2020, 7, 11, 2057, 7, 12, 1441, // 6,11 +6, 12, 58775, 6, 13, 2463, 7, 12, 2532, 7, 13, 1766, // 6,12 +6, 13, 57545, 6, 14, 2897, 7, 13, 3007, 7, 14, 2087, // 6,13 +6, 14, 56340, 6, 15, 3317, 7, 14, 3477, 7, 15, 2402, // 6,14 +6, 15, 55166, 6, 16, 3722, 7, 15, 3940, 7, 16, 2708, // 6,15 +6, 0, 3885, 6, 1, 2659, 7, 0, 55352, 7, 1, 3640, // 7, 0 +6, 1, 3411, 6, 2, 2346, 7, 1, 56552, 7, 2, 3227, // 7, 1 +6, 2, 2926, 6, 3, 2022, 7, 2, 57793, 7, 3, 2795, // 7, 2 +6, 3, 2430, 6, 4, 1687, 7, 3, 59076, 7, 4, 2343, // 7, 3 +6, 4, 1922, 6, 5, 1341, 7, 4, 60402, 7, 5, 1871, // 7, 4 +6, 5, 1405, 6, 6, 985, 7, 5, 61767, 7, 6, 1379, // 7, 5 +6, 6, 883, 6, 7, 622, 7, 6, 63156, 7, 7, 875, // 7, 6 +6, 7, 399, 6, 8, 282, 7, 7, 64455, 7, 8, 400, // 7, 7 +7, 8, 64455, 7, 9, 399, 8, 8, 399, 8, 9, 283, // 7, 8 +7, 9, 63156, 7, 10, 875, 8, 9, 883, 8, 10, 622, // 7, 9 +7, 10, 61767, 7, 11, 1380, 8, 10, 1405, 8, 11, 984, // 7,10 +7, 11, 60402, 7, 12, 1871, 8, 11, 1922, 8, 12, 1341, // 7,11 +7, 12, 59077, 7, 13, 2342, 8, 12, 2430, 8, 13, 1687, // 7,12 +7, 13, 57795, 7, 14, 2794, 8, 13, 2926, 8, 14, 2021, // 7,13 +7, 14, 56554, 7, 15, 3225, 8, 14, 3411, 8, 15, 2346, // 7,14 +7, 15, 55354, 7, 16, 3638, 8, 15, 3885, 8, 16, 2659, // 7,15 +7, -1, 2659, 7, 0, 3885, 8, -1, 3638, 8, 0, 55354, // 8, 0 +7, 0, 2346, 7, 1, 3411, 8, 0, 3225, 8, 1, 56554, // 8, 1 +7, 1, 2022, 7, 2, 2926, 8, 1, 2794, 8, 2, 57794, // 8, 2 +7, 2, 1687, 7, 3, 2430, 8, 2, 2342, 8, 3, 59077, // 8, 3 +7, 3, 1341, 7, 4, 1922, 8, 3, 1871, 8, 4, 60402, // 8, 4 +7, 4, 985, 7, 5, 1405, 8, 4, 1380, 8, 5, 61766, // 8, 5 +7, 5, 622, 7, 6, 883, 8, 5, 875, 8, 6, 63156, // 8, 6 +7, 6, 282, 7, 7, 399, 8, 6, 399, 8, 7, 64456, // 8, 7 +8, 7, 399, 8, 8, 64455, 9, 7, 282, 9, 8, 400, // 8, 8 +8, 8, 875, 8, 9, 63156, 9, 8, 622, 9, 9, 883, // 8, 9 +8, 9, 1380, 8, 10, 61767, 9, 9, 985, 9, 10, 1404, // 8,10 +8, 10, 1871, 8, 11, 60402, 9, 10, 1341, 9, 11, 1922, // 8,11 +8, 11, 2343, 8, 12, 59076, 9, 11, 1687, 9, 12, 2430, // 8,12 +8, 12, 2795, 8, 13, 57793, 9, 12, 2022, 9, 13, 2926, // 8,13 +8, 13, 3227, 8, 14, 56552, 9, 13, 2346, 9, 14, 3411, // 8,14 +8, 14, 3640, 8, 15, 55352, 9, 14, 2659, 9, 15, 3885, // 8,15 +8, -1, 2709, 8, 0, 3940, 9, -1, 3722, 9, 0, 55165, // 9, 0 +8, 0, 2402, 8, 1, 3477, 9, 0, 3317, 9, 1, 56340, // 9, 1 +8, 1, 2088, 8, 2, 3007, 9, 1, 2897, 9, 2, 57544, // 9, 2 +8, 2, 1766, 8, 3, 2532, 9, 2, 2463, 9, 3, 58775, // 9, 3 +8, 3, 1442, 8, 4, 2057, 9, 3, 2020, 9, 4, 60017, // 9, 4 +8, 4, 1121, 8, 5, 1593, 9, 4, 1578, 9, 5, 61244, // 9, 5 +8, 5, 827, 8, 6, 1170, 9, 5, 1170, 9, 6, 62369, // 9, 6 +8, 6, 622, 8, 7, 875, 9, 6, 883, 9, 7, 63156, // 9, 7 +9, 7, 883, 9, 8, 63156, 10, 7, 622, 10, 8, 875, // 9, 8 +9, 8, 1170, 9, 9, 62369, 10, 8, 827, 10, 9, 1170, // 9, 9 +9, 9, 1579, 9, 10, 61243, 10, 9, 1121, 10, 10, 1593, // 9,10 +9, 10, 2020, 9, 11, 60017, 10, 10, 1442, 10, 11, 2057, // 9,11 +9, 11, 2464, 9, 12, 58774, 10, 11, 1767, 10, 12, 2531, // 9,12 +9, 12, 2898, 9, 13, 57544, 10, 12, 2088, 10, 13, 3006, // 9,13 +9, 13, 3319, 9, 14, 56339, 10, 13, 2403, 10, 14, 3475, // 9,14 +9, 14, 3724, 9, 15, 55164, 10, 14, 2709, 10, 15, 3939, // 9,15 +9, -1, 2796, 9, 0, 4047, 10, -1, 3858, 10, 0, 54835, // 10, 0 +9, 0, 2502, 9, 1, 3605, 10, 0, 3470, 10, 1, 55959, // 10, 1 +9, 1, 2205, 9, 2, 3161, 10, 1, 3073, 10, 2, 57097, // 10, 2 +9, 2, 1908, 9, 3, 2723, 10, 2, 2672, 10, 3, 58233, // 10, 3 +9, 3, 1617, 9, 4, 2297, 10, 3, 2276, 10, 4, 59346, // 10, 4 +9, 4, 1347, 9, 5, 1904, 10, 4, 1904, 10, 5, 60381, // 10, 5 +9, 5, 1121, 9, 6, 1579, 10, 5, 1593, 10, 6, 61243, // 10, 6 +9, 6, 985, 9, 7, 1380, 10, 6, 1405, 10, 7, 61766, // 10, 7 +10, 7, 1405, 10, 8, 61767, 11, 7, 985, 11, 8, 1379, // 10, 8 +10, 8, 1593, 10, 9, 61243, 11, 8, 1121, 11, 9, 1579, // 10, 9 +10, 9, 1904, 10, 10, 60381, 11, 9, 1347, 11, 10, 1904, // 10,10 +10, 10, 2276, 10, 11, 59345, 11, 10, 1617, 11, 11, 2298, // 10,11 +10, 11, 2673, 10, 12, 58233, 11, 11, 1908, 11, 12, 2722, // 10,12 +10, 12, 3074, 10, 13, 57095, 11, 12, 2205, 11, 13, 3162, // 10,13 +10, 13, 3472, 10, 14, 55958, 11, 13, 2503, 11, 14, 3603, // 10,14 +10, 14, 3860, 10, 15, 54833, 11, 14, 2797, 11, 15, 4046, // 10,15 +10, -1, 2916, 10, 0, 4201, 11, -1, 4041, 11, 0, 54378, // 11, 0 +10, 0, 2640, 10, 1, 3785, 11, 0, 3677, 11, 1, 55434, // 11, 1 +10, 1, 2365, 10, 2, 3374, 11, 1, 3310, 11, 2, 56487, // 11, 2 +10, 2, 2096, 10, 3, 2977, 11, 2, 2948, 11, 3, 57515, // 11, 3 +10, 3, 1843, 10, 4, 2605, 11, 3, 2604, 11, 4, 58484, // 11, 4 +10, 4, 1617, 10, 5, 2276, 11, 4, 2297, 11, 5, 59346, // 11, 5 +10, 5, 1442, 10, 6, 2020, 11, 5, 2057, 11, 6, 60017, // 11, 6 +10, 6, 1341, 10, 7, 1871, 11, 6, 1922, 11, 7, 60402, // 11, 7 +11, 7, 1922, 11, 8, 60402, 12, 7, 1341, 12, 8, 1871, // 11, 8 +11, 8, 2057, 11, 9, 60018, 12, 8, 1442, 12, 9, 2019, // 11, 9 +11, 9, 2297, 11, 10, 59346, 12, 9, 1617, 12, 10, 2276, // 11,10 +11, 10, 2605, 11, 11, 58484, 12, 10, 1843, 12, 11, 2604, // 11,11 +11, 11, 2950, 11, 12, 57514, 12, 11, 2096, 12, 12, 2976, // 11,12 +11, 12, 3311, 11, 13, 56486, 12, 12, 2365, 12, 13, 3374, // 11,13 +11, 13, 3678, 11, 14, 55434, 12, 13, 2640, 12, 14, 3784, // 11,14 +11, 14, 4043, 11, 15, 54376, 12, 14, 2917, 12, 15, 4200, // 11,15 +11, -1, 3064, 11, 0, 4392, 12, -1, 4264, 12, 0, 53816, // 12, 0 +11, 0, 2808, 11, 1, 4005, 12, 0, 3927, 12, 1, 54796, // 12, 1 +11, 1, 2556, 11, 2, 3630, 12, 1, 3594, 12, 2, 55756, // 12, 2 +11, 2, 2317, 11, 3, 3274, 12, 2, 3273, 12, 3, 56672, // 12, 3 +11, 3, 2096, 11, 4, 2950, 12, 3, 2976, 12, 4, 57514, // 12, 4 +11, 4, 1908, 11, 5, 2673, 12, 4, 2722, 12, 5, 58233, // 12, 5 +11, 5, 1767, 11, 6, 2464, 12, 5, 2532, 12, 6, 58773, // 12, 6 +11, 6, 1687, 11, 7, 2343, 12, 6, 2430, 12, 7, 59076, // 12, 7 +12, 7, 2430, 12, 8, 59077, 13, 7, 1687, 13, 8, 2342, // 12, 8 +12, 8, 2532, 12, 9, 58775, 13, 8, 1766, 13, 9, 2463, // 12, 9 +12, 9, 2723, 12, 10, 58234, 13, 9, 1908, 13, 10, 2671, // 12,10 +12, 10, 2977, 12, 11, 57514, 13, 10, 2096, 13, 11, 2949, // 12,11 +12, 11, 3274, 12, 12, 56673, 13, 11, 2317, 13, 12, 3272, // 12,12 +12, 12, 3595, 12, 13, 55756, 13, 12, 2557, 13, 13, 3628, // 12,13 +12, 13, 3929, 12, 14, 54796, 13, 13, 2808, 13, 14, 4003, // 12,14 +12, 14, 4267, 12, 15, 53814, 13, 14, 3065, 13, 15, 4390, // 12,15 +12, -1, 3235, 12, 0, 4612, 13, -1, 4521, 13, 0, 53168, // 13, 0 +12, 0, 2998, 12, 1, 4255, 13, 0, 4212, 13, 1, 54071, // 13, 1 +12, 1, 2770, 12, 2, 3913, 13, 1, 3911, 13, 2, 54942, // 13, 2 +12, 2, 2557, 12, 3, 3595, 13, 2, 3628, 13, 3, 55756, // 13, 3 +12, 3, 2365, 12, 4, 3311, 13, 3, 3373, 13, 4, 56487, // 13, 4 +12, 4, 2205, 12, 5, 3074, 13, 4, 3161, 13, 5, 57096, // 13, 5 +12, 5, 2088, 12, 6, 2898, 13, 5, 3007, 13, 6, 57543, // 13, 6 +12, 6, 2022, 12, 7, 2795, 13, 6, 2926, 13, 7, 57793, // 13, 7 +13, 7, 2926, 13, 8, 57795, 14, 7, 2022, 14, 8, 2793, // 13, 8 +13, 8, 3007, 13, 9, 57545, 14, 8, 2088, 14, 9, 2896, // 13, 9 +13, 9, 3161, 13, 10, 57096, 14, 9, 2205, 14, 10, 3074, // 13,10 +13, 10, 3374, 13, 11, 56487, 14, 10, 2365, 14, 11, 3310, // 13,11 +13, 11, 3630, 13, 12, 55756, 14, 11, 2556, 14, 12, 3594, // 13,12 +13, 12, 3913, 13, 13, 54941, 14, 12, 2770, 14, 13, 3912, // 13,13 +13, 13, 4214, 13, 14, 54071, 14, 13, 2998, 14, 14, 4253, // 13,14 +13, 14, 4523, 13, 15, 53168, 14, 14, 3235, 14, 15, 4610, // 13,15 +13, -1, 3421, 13, 0, 4854, 14, -1, 4803, 14, 0, 52458, // 14, 0 +13, 0, 3204, 13, 1, 4525, 14, 0, 4522, 14, 1, 53285, // 14, 1 +13, 1, 2998, 13, 2, 4214, 14, 1, 4253, 14, 2, 54071, // 14, 2 +13, 2, 2808, 13, 3, 3929, 14, 2, 4003, 14, 3, 54796, // 14, 3 +13, 3, 2640, 13, 4, 3678, 14, 3, 3783, 14, 4, 55435, // 14, 4 +13, 4, 2503, 13, 5, 3472, 14, 4, 3604, 14, 5, 55957, // 14, 5 +13, 5, 2403, 13, 6, 3319, 14, 5, 3476, 14, 6, 56338, // 14, 6 +13, 6, 2346, 13, 7, 3227, 14, 6, 3411, 14, 7, 56552, // 14, 7 +14, 7, 3411, 14, 8, 56554, 15, 7, 2346, 15, 8, 3225, // 14, 8 +14, 8, 3477, 14, 9, 56340, 15, 8, 2402, 15, 9, 3317, // 14, 9 +14, 9, 3605, 14, 10, 55959, 15, 9, 2502, 15, 10, 3470, // 14,10 +14, 10, 3785, 14, 11, 55435, 15, 10, 2640, 15, 11, 3676, // 14,11 +14, 11, 4005, 14, 12, 54796, 15, 11, 2808, 15, 12, 3927, // 14,12 +14, 12, 4255, 14, 13, 54072, 15, 12, 2998, 15, 13, 4211, // 14,13 +14, 13, 4525, 14, 14, 53285, 15, 13, 3204, 15, 14, 4522, // 14,14 +14, 14, 4806, 14, 15, 52457, 15, 14, 3422, 15, 15, 4851, // 14,15 +14, -1, 3621, 14, 0, 5110, 15, -1, 5106, 15, 0, 51699, // 15, 0 +14, 0, 3422, 14, 1, 4806, 15, 0, 4851, 15, 1, 52457, // 15, 1 +14, 1, 3235, 14, 2, 4523, 15, 1, 4610, 15, 2, 53168, // 15, 2 +14, 2, 3065, 14, 3, 4267, 15, 2, 4390, 15, 3, 53814, // 15, 3 +14, 3, 2917, 14, 4, 4043, 15, 3, 4200, 15, 4, 54376, // 15, 4 +14, 4, 2797, 14, 5, 3860, 15, 4, 4046, 15, 5, 54833, // 15, 5 +14, 5, 2709, 14, 6, 3724, 15, 5, 3939, 15, 6, 55164, // 15, 6 +14, 6, 2659, 14, 7, 3640, 15, 6, 3885, 15, 7, 55352, // 15, 7 +15, 7, 3885, 15, 8, 55354, 16, 7, 2659, 16, 8, 3638, // 15, 8 +15, 8, 3940, 15, 9, 55166, 16, 8, 2709, 16, 9, 3721, // 15, 9 +15, 9, 4047, 15, 10, 54835, 16, 9, 2796, 16, 10, 3858, // 15,10 +15, 10, 4201, 15, 11, 54378, 16, 10, 2916, 16, 11, 4041, // 15,11 +15, 11, 4392, 15, 12, 53815, 16, 11, 3064, 16, 12, 4265, // 15,12 +15, 12, 4612, 15, 13, 53168, 16, 12, 3235, 16, 13, 4521, // 15,13 +15, 13, 4854, 15, 14, 52457, 16, 13, 3421, 16, 14, 4804, // 15,14 +15, 14, 5110, 15, 15, 51699, 16, 14, 3621, 16, 15, 5106, // 15,15 +// angle of 0.0 degrees +0, 0, 16384, 0, 0, 16384, 0, 0, 16384, 0, 0, 16384, // 0, 0 +0, 1, 16384, 0, 1, 16384, 0, 1, 16384, 0, 1, 16384, // 0, 1 +0, 2, 16384, 0, 2, 16384, 0, 2, 16384, 0, 2, 16384, // 0, 2 +0, 3, 16384, 0, 3, 16384, 0, 3, 16384, 0, 3, 16384, // 0, 3 +0, 4, 16384, 0, 4, 16384, 0, 4, 16384, 0, 4, 16384, // 0, 4 +0, 5, 16384, 0, 5, 16384, 0, 5, 16384, 0, 5, 16384, // 0, 5 +0, 6, 16384, 0, 6, 16384, 0, 6, 16384, 0, 6, 16384, // 0, 6 +0, 7, 16384, 0, 7, 16384, 0, 7, 16384, 0, 7, 16384, // 0, 7 +0, 8, 16384, 0, 8, 16384, 0, 8, 16384, 0, 8, 16384, // 0, 8 +0, 9, 16384, 0, 9, 16384, 0, 9, 16384, 0, 9, 16384, // 0, 9 +0, 10, 16384, 0, 10, 16384, 0, 10, 16384, 0, 10, 16384, // 0,10 +0, 11, 16384, 0, 11, 16384, 0, 11, 16384, 0, 11, 16384, // 0,11 +0, 12, 16384, 0, 12, 16384, 0, 12, 16384, 0, 12, 16384, // 0,12 +0, 13, 16384, 0, 13, 16384, 0, 13, 16384, 0, 13, 16384, // 0,13 +0, 14, 16384, 0, 14, 16384, 0, 14, 16384, 0, 14, 16384, // 0,14 +0, 15, 16384, 0, 15, 16384, 0, 15, 16384, 0, 15, 16384, // 0,15 +1, 0, 16384, 1, 0, 16384, 1, 0, 16384, 1, 0, 16384, // 1, 0 +1, 1, 16384, 1, 1, 16384, 1, 1, 16384, 1, 1, 16384, // 1, 1 +1, 2, 16384, 1, 2, 16384, 1, 2, 16384, 1, 2, 16384, // 1, 2 +1, 3, 16384, 1, 3, 16384, 1, 3, 16384, 1, 3, 16384, // 1, 3 +1, 4, 16384, 1, 4, 16384, 1, 4, 16384, 1, 4, 16384, // 1, 4 +1, 5, 16384, 1, 5, 16384, 1, 5, 16384, 1, 5, 16384, // 1, 5 +1, 6, 16384, 1, 6, 16384, 1, 6, 16384, 1, 6, 16384, // 1, 6 +1, 7, 16384, 1, 7, 16384, 1, 7, 16384, 1, 7, 16384, // 1, 7 +1, 8, 16384, 1, 8, 16384, 1, 8, 16384, 1, 8, 16384, // 1, 8 +1, 9, 16384, 1, 9, 16384, 1, 9, 16384, 1, 9, 16384, // 1, 9 +1, 10, 16384, 1, 10, 16384, 1, 10, 16384, 1, 10, 16384, // 1,10 +1, 11, 16384, 1, 11, 16384, 1, 11, 16384, 1, 11, 16384, // 1,11 +1, 12, 16384, 1, 12, 16384, 1, 12, 16384, 1, 12, 16384, // 1,12 +1, 13, 16384, 1, 13, 16384, 1, 13, 16384, 1, 13, 16384, // 1,13 +1, 14, 16384, 1, 14, 16384, 1, 14, 16384, 1, 14, 16384, // 1,14 +1, 15, 16384, 1, 15, 16384, 1, 15, 16384, 1, 15, 16384, // 1,15 +2, 0, 16384, 2, 0, 16384, 2, 0, 16384, 2, 0, 16384, // 2, 0 +2, 1, 16384, 2, 1, 16384, 2, 1, 16384, 2, 1, 16384, // 2, 1 +2, 2, 16384, 2, 2, 16384, 2, 2, 16384, 2, 2, 16384, // 2, 2 +2, 3, 16384, 2, 3, 16384, 2, 3, 16384, 2, 3, 16384, // 2, 3 +2, 4, 16384, 2, 4, 16384, 2, 4, 16384, 2, 4, 16384, // 2, 4 +2, 5, 16384, 2, 5, 16384, 2, 5, 16384, 2, 5, 16384, // 2, 5 +2, 6, 16384, 2, 6, 16384, 2, 6, 16384, 2, 6, 16384, // 2, 6 +2, 7, 16384, 2, 7, 16384, 2, 7, 16384, 2, 7, 16384, // 2, 7 +2, 8, 16384, 2, 8, 16384, 2, 8, 16384, 2, 8, 16384, // 2, 8 +2, 9, 16384, 2, 9, 16384, 2, 9, 16384, 2, 9, 16384, // 2, 9 +2, 10, 16384, 2, 10, 16384, 2, 10, 16384, 2, 10, 16384, // 2,10 +2, 11, 16384, 2, 11, 16384, 2, 11, 16384, 2, 11, 16384, // 2,11 +2, 12, 16384, 2, 12, 16384, 2, 12, 16384, 2, 12, 16384, // 2,12 +2, 13, 16384, 2, 13, 16384, 2, 13, 16384, 2, 13, 16384, // 2,13 +2, 14, 16384, 2, 14, 16384, 2, 14, 16384, 2, 14, 16384, // 2,14 +2, 15, 16384, 2, 15, 16384, 2, 15, 16384, 2, 15, 16384, // 2,15 +3, 0, 16384, 3, 0, 16384, 3, 0, 16384, 3, 0, 16384, // 3, 0 +3, 1, 16384, 3, 1, 16384, 3, 1, 16384, 3, 1, 16384, // 3, 1 +3, 2, 16384, 3, 2, 16384, 3, 2, 16384, 3, 2, 16384, // 3, 2 +3, 3, 16384, 3, 3, 16384, 3, 3, 16384, 3, 3, 16384, // 3, 3 +3, 4, 16384, 3, 4, 16384, 3, 4, 16384, 3, 4, 16384, // 3, 4 +3, 5, 16384, 3, 5, 16384, 3, 5, 16384, 3, 5, 16384, // 3, 5 +3, 6, 16384, 3, 6, 16384, 3, 6, 16384, 3, 6, 16384, // 3, 6 +3, 7, 16384, 3, 7, 16384, 3, 7, 16384, 3, 7, 16384, // 3, 7 +3, 8, 16384, 3, 8, 16384, 3, 8, 16384, 3, 8, 16384, // 3, 8 +3, 9, 16384, 3, 9, 16384, 3, 9, 16384, 3, 9, 16384, // 3, 9 +3, 10, 16384, 3, 10, 16384, 3, 10, 16384, 3, 10, 16384, // 3,10 +3, 11, 16384, 3, 11, 16384, 3, 11, 16384, 3, 11, 16384, // 3,11 +3, 12, 16384, 3, 12, 16384, 3, 12, 16384, 3, 12, 16384, // 3,12 +3, 13, 16384, 3, 13, 16384, 3, 13, 16384, 3, 13, 16384, // 3,13 +3, 14, 16384, 3, 14, 16384, 3, 14, 16384, 3, 14, 16384, // 3,14 +3, 15, 16384, 3, 15, 16384, 3, 15, 16384, 3, 15, 16384, // 3,15 +4, 0, 16384, 4, 0, 16384, 4, 0, 16384, 4, 0, 16384, // 4, 0 +4, 1, 16384, 4, 1, 16384, 4, 1, 16384, 4, 1, 16384, // 4, 1 +4, 2, 16384, 4, 2, 16384, 4, 2, 16384, 4, 2, 16384, // 4, 2 +4, 3, 16384, 4, 3, 16384, 4, 3, 16384, 4, 3, 16384, // 4, 3 +4, 4, 16384, 4, 4, 16384, 4, 4, 16384, 4, 4, 16384, // 4, 4 +4, 5, 16384, 4, 5, 16384, 4, 5, 16384, 4, 5, 16384, // 4, 5 +4, 6, 16384, 4, 6, 16384, 4, 6, 16384, 4, 6, 16384, // 4, 6 +4, 7, 16384, 4, 7, 16384, 4, 7, 16384, 4, 7, 16384, // 4, 7 +4, 8, 16384, 4, 8, 16384, 4, 8, 16384, 4, 8, 16384, // 4, 8 +4, 9, 16384, 4, 9, 16384, 4, 9, 16384, 4, 9, 16384, // 4, 9 +4, 10, 16384, 4, 10, 16384, 4, 10, 16384, 4, 10, 16384, // 4,10 +4, 11, 16384, 4, 11, 16384, 4, 11, 16384, 4, 11, 16384, // 4,11 +4, 12, 16384, 4, 12, 16384, 4, 12, 16384, 4, 12, 16384, // 4,12 +4, 13, 16384, 4, 13, 16384, 4, 13, 16384, 4, 13, 16384, // 4,13 +4, 14, 16384, 4, 14, 16384, 4, 14, 16384, 4, 14, 16384, // 4,14 +4, 15, 16384, 4, 15, 16384, 4, 15, 16384, 4, 15, 16384, // 4,15 +5, 0, 16384, 5, 0, 16384, 5, 0, 16384, 5, 0, 16384, // 5, 0 +5, 1, 16384, 5, 1, 16384, 5, 1, 16384, 5, 1, 16384, // 5, 1 +5, 2, 16384, 5, 2, 16384, 5, 2, 16384, 5, 2, 16384, // 5, 2 +5, 3, 16384, 5, 3, 16384, 5, 3, 16384, 5, 3, 16384, // 5, 3 +5, 4, 16384, 5, 4, 16384, 5, 4, 16384, 5, 4, 16384, // 5, 4 +5, 5, 16384, 5, 5, 16384, 5, 5, 16384, 5, 5, 16384, // 5, 5 +5, 6, 16384, 5, 6, 16384, 5, 6, 16384, 5, 6, 16384, // 5, 6 +5, 7, 16384, 5, 7, 16384, 5, 7, 16384, 5, 7, 16384, // 5, 7 +5, 8, 16384, 5, 8, 16384, 5, 8, 16384, 5, 8, 16384, // 5, 8 +5, 9, 16384, 5, 9, 16384, 5, 9, 16384, 5, 9, 16384, // 5, 9 +5, 10, 16384, 5, 10, 16384, 5, 10, 16384, 5, 10, 16384, // 5,10 +5, 11, 16384, 5, 11, 16384, 5, 11, 16384, 5, 11, 16384, // 5,11 +5, 12, 16384, 5, 12, 16384, 5, 12, 16384, 5, 12, 16384, // 5,12 +5, 13, 16384, 5, 13, 16384, 5, 13, 16384, 5, 13, 16384, // 5,13 +5, 14, 16384, 5, 14, 16384, 5, 14, 16384, 5, 14, 16384, // 5,14 +5, 15, 16384, 5, 15, 16384, 5, 15, 16384, 5, 15, 16384, // 5,15 +6, 0, 16384, 6, 0, 16384, 6, 0, 16384, 6, 0, 16384, // 6, 0 +6, 1, 16384, 6, 1, 16384, 6, 1, 16384, 6, 1, 16384, // 6, 1 +6, 2, 16384, 6, 2, 16384, 6, 2, 16384, 6, 2, 16384, // 6, 2 +6, 3, 16384, 6, 3, 16384, 6, 3, 16384, 6, 3, 16384, // 6, 3 +6, 4, 16384, 6, 4, 16384, 6, 4, 16384, 6, 4, 16384, // 6, 4 +6, 5, 16384, 6, 5, 16384, 6, 5, 16384, 6, 5, 16384, // 6, 5 +6, 6, 16384, 6, 6, 16384, 6, 6, 16384, 6, 6, 16384, // 6, 6 +6, 7, 16384, 6, 7, 16384, 6, 7, 16384, 6, 7, 16384, // 6, 7 +6, 8, 16384, 6, 8, 16384, 6, 8, 16384, 6, 8, 16384, // 6, 8 +6, 9, 16384, 6, 9, 16384, 6, 9, 16384, 6, 9, 16384, // 6, 9 +6, 10, 16384, 6, 10, 16384, 6, 10, 16384, 6, 10, 16384, // 6,10 +6, 11, 16384, 6, 11, 16384, 6, 11, 16384, 6, 11, 16384, // 6,11 +6, 12, 16384, 6, 12, 16384, 6, 12, 16384, 6, 12, 16384, // 6,12 +6, 13, 16384, 6, 13, 16384, 6, 13, 16384, 6, 13, 16384, // 6,13 +6, 14, 16384, 6, 14, 16384, 6, 14, 16384, 6, 14, 16384, // 6,14 +6, 15, 16384, 6, 15, 16384, 6, 15, 16384, 6, 15, 16384, // 6,15 +7, 0, 16384, 7, 0, 16384, 7, 0, 16384, 7, 0, 16384, // 7, 0 +7, 1, 16384, 7, 1, 16384, 7, 1, 16384, 7, 1, 16384, // 7, 1 +7, 2, 16384, 7, 2, 16384, 7, 2, 16384, 7, 2, 16384, // 7, 2 +7, 3, 16384, 7, 3, 16384, 7, 3, 16384, 7, 3, 16384, // 7, 3 +7, 4, 16384, 7, 4, 16384, 7, 4, 16384, 7, 4, 16384, // 7, 4 +7, 5, 16384, 7, 5, 16384, 7, 5, 16384, 7, 5, 16384, // 7, 5 +7, 6, 16384, 7, 6, 16384, 7, 6, 16384, 7, 6, 16384, // 7, 6 +7, 7, 16384, 7, 7, 16384, 7, 7, 16384, 7, 7, 16384, // 7, 7 +7, 8, 16384, 7, 8, 16384, 7, 8, 16384, 7, 8, 16384, // 7, 8 +7, 9, 16384, 7, 9, 16384, 7, 9, 16384, 7, 9, 16384, // 7, 9 +7, 10, 16384, 7, 10, 16384, 7, 10, 16384, 7, 10, 16384, // 7,10 +7, 11, 16384, 7, 11, 16384, 7, 11, 16384, 7, 11, 16384, // 7,11 +7, 12, 16384, 7, 12, 16384, 7, 12, 16384, 7, 12, 16384, // 7,12 +7, 13, 16384, 7, 13, 16384, 7, 13, 16384, 7, 13, 16384, // 7,13 +7, 14, 16384, 7, 14, 16384, 7, 14, 16384, 7, 14, 16384, // 7,14 +7, 15, 16384, 7, 15, 16384, 7, 15, 16384, 7, 15, 16384, // 7,15 +8, 0, 16384, 8, 0, 16384, 8, 0, 16384, 8, 0, 16384, // 8, 0 +8, 1, 16384, 8, 1, 16384, 8, 1, 16384, 8, 1, 16384, // 8, 1 +8, 2, 16384, 8, 2, 16384, 8, 2, 16384, 8, 2, 16384, // 8, 2 +8, 3, 16384, 8, 3, 16384, 8, 3, 16384, 8, 3, 16384, // 8, 3 +8, 4, 16384, 8, 4, 16384, 8, 4, 16384, 8, 4, 16384, // 8, 4 +8, 5, 16384, 8, 5, 16384, 8, 5, 16384, 8, 5, 16384, // 8, 5 +8, 6, 16384, 8, 6, 16384, 8, 6, 16384, 8, 6, 16384, // 8, 6 +8, 7, 16384, 8, 7, 16384, 8, 7, 16384, 8, 7, 16384, // 8, 7 +8, 8, 16384, 8, 8, 16384, 8, 8, 16384, 8, 8, 16384, // 8, 8 +8, 9, 16384, 8, 9, 16384, 8, 9, 16384, 8, 9, 16384, // 8, 9 +8, 10, 16384, 8, 10, 16384, 8, 10, 16384, 8, 10, 16384, // 8,10 +8, 11, 16384, 8, 11, 16384, 8, 11, 16384, 8, 11, 16384, // 8,11 +8, 12, 16384, 8, 12, 16384, 8, 12, 16384, 8, 12, 16384, // 8,12 +8, 13, 16384, 8, 13, 16384, 8, 13, 16384, 8, 13, 16384, // 8,13 +8, 14, 16384, 8, 14, 16384, 8, 14, 16384, 8, 14, 16384, // 8,14 +8, 15, 16384, 8, 15, 16384, 8, 15, 16384, 8, 15, 16384, // 8,15 +9, 0, 16384, 9, 0, 16384, 9, 0, 16384, 9, 0, 16384, // 9, 0 +9, 1, 16384, 9, 1, 16384, 9, 1, 16384, 9, 1, 16384, // 9, 1 +9, 2, 16384, 9, 2, 16384, 9, 2, 16384, 9, 2, 16384, // 9, 2 +9, 3, 16384, 9, 3, 16384, 9, 3, 16384, 9, 3, 16384, // 9, 3 +9, 4, 16384, 9, 4, 16384, 9, 4, 16384, 9, 4, 16384, // 9, 4 +9, 5, 16384, 9, 5, 16384, 9, 5, 16384, 9, 5, 16384, // 9, 5 +9, 6, 16384, 9, 6, 16384, 9, 6, 16384, 9, 6, 16384, // 9, 6 +9, 7, 16384, 9, 7, 16384, 9, 7, 16384, 9, 7, 16384, // 9, 7 +9, 8, 16384, 9, 8, 16384, 9, 8, 16384, 9, 8, 16384, // 9, 8 +9, 9, 16384, 9, 9, 16384, 9, 9, 16384, 9, 9, 16384, // 9, 9 +9, 10, 16384, 9, 10, 16384, 9, 10, 16384, 9, 10, 16384, // 9,10 +9, 11, 16384, 9, 11, 16384, 9, 11, 16384, 9, 11, 16384, // 9,11 +9, 12, 16384, 9, 12, 16384, 9, 12, 16384, 9, 12, 16384, // 9,12 +9, 13, 16384, 9, 13, 16384, 9, 13, 16384, 9, 13, 16384, // 9,13 +9, 14, 16384, 9, 14, 16384, 9, 14, 16384, 9, 14, 16384, // 9,14 +9, 15, 16384, 9, 15, 16384, 9, 15, 16384, 9, 15, 16384, // 9,15 +10, 0, 16384, 10, 0, 16384, 10, 0, 16384, 10, 0, 16384, // 10, 0 +10, 1, 16384, 10, 1, 16384, 10, 1, 16384, 10, 1, 16384, // 10, 1 +10, 2, 16384, 10, 2, 16384, 10, 2, 16384, 10, 2, 16384, // 10, 2 +10, 3, 16384, 10, 3, 16384, 10, 3, 16384, 10, 3, 16384, // 10, 3 +10, 4, 16384, 10, 4, 16384, 10, 4, 16384, 10, 4, 16384, // 10, 4 +10, 5, 16384, 10, 5, 16384, 10, 5, 16384, 10, 5, 16384, // 10, 5 +10, 6, 16384, 10, 6, 16384, 10, 6, 16384, 10, 6, 16384, // 10, 6 +10, 7, 16384, 10, 7, 16384, 10, 7, 16384, 10, 7, 16384, // 10, 7 +10, 8, 16384, 10, 8, 16384, 10, 8, 16384, 10, 8, 16384, // 10, 8 +10, 9, 16384, 10, 9, 16384, 10, 9, 16384, 10, 9, 16384, // 10, 9 +10, 10, 16384, 10, 10, 16384, 10, 10, 16384, 10, 10, 16384, // 10,10 +10, 11, 16384, 10, 11, 16384, 10, 11, 16384, 10, 11, 16384, // 10,11 +10, 12, 16384, 10, 12, 16384, 10, 12, 16384, 10, 12, 16384, // 10,12 +10, 13, 16384, 10, 13, 16384, 10, 13, 16384, 10, 13, 16384, // 10,13 +10, 14, 16384, 10, 14, 16384, 10, 14, 16384, 10, 14, 16384, // 10,14 +10, 15, 16384, 10, 15, 16384, 10, 15, 16384, 10, 15, 16384, // 10,15 +11, 0, 16384, 11, 0, 16384, 11, 0, 16384, 11, 0, 16384, // 11, 0 +11, 1, 16384, 11, 1, 16384, 11, 1, 16384, 11, 1, 16384, // 11, 1 +11, 2, 16384, 11, 2, 16384, 11, 2, 16384, 11, 2, 16384, // 11, 2 +11, 3, 16384, 11, 3, 16384, 11, 3, 16384, 11, 3, 16384, // 11, 3 +11, 4, 16384, 11, 4, 16384, 11, 4, 16384, 11, 4, 16384, // 11, 4 +11, 5, 16384, 11, 5, 16384, 11, 5, 16384, 11, 5, 16384, // 11, 5 +11, 6, 16384, 11, 6, 16384, 11, 6, 16384, 11, 6, 16384, // 11, 6 +11, 7, 16384, 11, 7, 16384, 11, 7, 16384, 11, 7, 16384, // 11, 7 +11, 8, 16384, 11, 8, 16384, 11, 8, 16384, 11, 8, 16384, // 11, 8 +11, 9, 16384, 11, 9, 16384, 11, 9, 16384, 11, 9, 16384, // 11, 9 +11, 10, 16384, 11, 10, 16384, 11, 10, 16384, 11, 10, 16384, // 11,10 +11, 11, 16384, 11, 11, 16384, 11, 11, 16384, 11, 11, 16384, // 11,11 +11, 12, 16384, 11, 12, 16384, 11, 12, 16384, 11, 12, 16384, // 11,12 +11, 13, 16384, 11, 13, 16384, 11, 13, 16384, 11, 13, 16384, // 11,13 +11, 14, 16384, 11, 14, 16384, 11, 14, 16384, 11, 14, 16384, // 11,14 +11, 15, 16384, 11, 15, 16384, 11, 15, 16384, 11, 15, 16384, // 11,15 +12, 0, 16384, 12, 0, 16384, 12, 0, 16384, 12, 0, 16384, // 12, 0 +12, 1, 16384, 12, 1, 16384, 12, 1, 16384, 12, 1, 16384, // 12, 1 +12, 2, 16384, 12, 2, 16384, 12, 2, 16384, 12, 2, 16384, // 12, 2 +12, 3, 16384, 12, 3, 16384, 12, 3, 16384, 12, 3, 16384, // 12, 3 +12, 4, 16384, 12, 4, 16384, 12, 4, 16384, 12, 4, 16384, // 12, 4 +12, 5, 16384, 12, 5, 16384, 12, 5, 16384, 12, 5, 16384, // 12, 5 +12, 6, 16384, 12, 6, 16384, 12, 6, 16384, 12, 6, 16384, // 12, 6 +12, 7, 16384, 12, 7, 16384, 12, 7, 16384, 12, 7, 16384, // 12, 7 +12, 8, 16384, 12, 8, 16384, 12, 8, 16384, 12, 8, 16384, // 12, 8 +12, 9, 16384, 12, 9, 16384, 12, 9, 16384, 12, 9, 16384, // 12, 9 +12, 10, 16384, 12, 10, 16384, 12, 10, 16384, 12, 10, 16384, // 12,10 +12, 11, 16384, 12, 11, 16384, 12, 11, 16384, 12, 11, 16384, // 12,11 +12, 12, 16384, 12, 12, 16384, 12, 12, 16384, 12, 12, 16384, // 12,12 +12, 13, 16384, 12, 13, 16384, 12, 13, 16384, 12, 13, 16384, // 12,13 +12, 14, 16384, 12, 14, 16384, 12, 14, 16384, 12, 14, 16384, // 12,14 +12, 15, 16384, 12, 15, 16384, 12, 15, 16384, 12, 15, 16384, // 12,15 +13, 0, 16384, 13, 0, 16384, 13, 0, 16384, 13, 0, 16384, // 13, 0 +13, 1, 16384, 13, 1, 16384, 13, 1, 16384, 13, 1, 16384, // 13, 1 +13, 2, 16384, 13, 2, 16384, 13, 2, 16384, 13, 2, 16384, // 13, 2 +13, 3, 16384, 13, 3, 16384, 13, 3, 16384, 13, 3, 16384, // 13, 3 +13, 4, 16384, 13, 4, 16384, 13, 4, 16384, 13, 4, 16384, // 13, 4 +13, 5, 16384, 13, 5, 16384, 13, 5, 16384, 13, 5, 16384, // 13, 5 +13, 6, 16384, 13, 6, 16384, 13, 6, 16384, 13, 6, 16384, // 13, 6 +13, 7, 16384, 13, 7, 16384, 13, 7, 16384, 13, 7, 16384, // 13, 7 +13, 8, 16384, 13, 8, 16384, 13, 8, 16384, 13, 8, 16384, // 13, 8 +13, 9, 16384, 13, 9, 16384, 13, 9, 16384, 13, 9, 16384, // 13, 9 +13, 10, 16384, 13, 10, 16384, 13, 10, 16384, 13, 10, 16384, // 13,10 +13, 11, 16384, 13, 11, 16384, 13, 11, 16384, 13, 11, 16384, // 13,11 +13, 12, 16384, 13, 12, 16384, 13, 12, 16384, 13, 12, 16384, // 13,12 +13, 13, 16384, 13, 13, 16384, 13, 13, 16384, 13, 13, 16384, // 13,13 +13, 14, 16384, 13, 14, 16384, 13, 14, 16384, 13, 14, 16384, // 13,14 +13, 15, 16384, 13, 15, 16384, 13, 15, 16384, 13, 15, 16384, // 13,15 +14, 0, 16384, 14, 0, 16384, 14, 0, 16384, 14, 0, 16384, // 14, 0 +14, 1, 16384, 14, 1, 16384, 14, 1, 16384, 14, 1, 16384, // 14, 1 +14, 2, 16384, 14, 2, 16384, 14, 2, 16384, 14, 2, 16384, // 14, 2 +14, 3, 16384, 14, 3, 16384, 14, 3, 16384, 14, 3, 16384, // 14, 3 +14, 4, 16384, 14, 4, 16384, 14, 4, 16384, 14, 4, 16384, // 14, 4 +14, 5, 16384, 14, 5, 16384, 14, 5, 16384, 14, 5, 16384, // 14, 5 +14, 6, 16384, 14, 6, 16384, 14, 6, 16384, 14, 6, 16384, // 14, 6 +14, 7, 16384, 14, 7, 16384, 14, 7, 16384, 14, 7, 16384, // 14, 7 +14, 8, 16384, 14, 8, 16384, 14, 8, 16384, 14, 8, 16384, // 14, 8 +14, 9, 16384, 14, 9, 16384, 14, 9, 16384, 14, 9, 16384, // 14, 9 +14, 10, 16384, 14, 10, 16384, 14, 10, 16384, 14, 10, 16384, // 14,10 +14, 11, 16384, 14, 11, 16384, 14, 11, 16384, 14, 11, 16384, // 14,11 +14, 12, 16384, 14, 12, 16384, 14, 12, 16384, 14, 12, 16384, // 14,12 +14, 13, 16384, 14, 13, 16384, 14, 13, 16384, 14, 13, 16384, // 14,13 +14, 14, 16384, 14, 14, 16384, 14, 14, 16384, 14, 14, 16384, // 14,14 +14, 15, 16384, 14, 15, 16384, 14, 15, 16384, 14, 15, 16384, // 14,15 +15, 0, 16384, 15, 0, 16384, 15, 0, 16384, 15, 0, 16384, // 15, 0 +15, 1, 16384, 15, 1, 16384, 15, 1, 16384, 15, 1, 16384, // 15, 1 +15, 2, 16384, 15, 2, 16384, 15, 2, 16384, 15, 2, 16384, // 15, 2 +15, 3, 16384, 15, 3, 16384, 15, 3, 16384, 15, 3, 16384, // 15, 3 +15, 4, 16384, 15, 4, 16384, 15, 4, 16384, 15, 4, 16384, // 15, 4 +15, 5, 16384, 15, 5, 16384, 15, 5, 16384, 15, 5, 16384, // 15, 5 +15, 6, 16384, 15, 6, 16384, 15, 6, 16384, 15, 6, 16384, // 15, 6 +15, 7, 16384, 15, 7, 16384, 15, 7, 16384, 15, 7, 16384, // 15, 7 +15, 8, 16384, 15, 8, 16384, 15, 8, 16384, 15, 8, 16384, // 15, 8 +15, 9, 16384, 15, 9, 16384, 15, 9, 16384, 15, 9, 16384, // 15, 9 +15, 10, 16384, 15, 10, 16384, 15, 10, 16384, 15, 10, 16384, // 15,10 +15, 11, 16384, 15, 11, 16384, 15, 11, 16384, 15, 11, 16384, // 15,11 +15, 12, 16384, 15, 12, 16384, 15, 12, 16384, 15, 12, 16384, // 15,12 +15, 13, 16384, 15, 13, 16384, 15, 13, 16384, 15, 13, 16384, // 15,13 +15, 14, 16384, 15, 14, 16384, 15, 14, 16384, 15, 14, 16384, // 15,14 +15, 15, 16384, 15, 15, 16384, 15, 15, 16384, 15, 15, 16384, // 15,15 +// angle of 0.5 degrees +0, -1, 5106, 0, 0, 51699, 1, -1, 3621, 1, 0, 5110, // 0, 0 +0, 0, 4851, 0, 1, 52457, 1, 0, 3422, 1, 1, 4806, // 0, 1 +0, 1, 4610, 0, 2, 53168, 1, 1, 3235, 1, 2, 4523, // 0, 2 +0, 2, 4390, 0, 3, 53814, 1, 2, 3065, 1, 3, 4267, // 0, 3 +0, 3, 4200, 0, 4, 54376, 1, 3, 2917, 1, 4, 4043, // 0, 4 +0, 4, 4046, 0, 5, 54833, 1, 4, 2797, 1, 5, 3860, // 0, 5 +0, 5, 3939, 0, 6, 55164, 1, 5, 2709, 1, 6, 3724, // 0, 6 +0, 6, 3885, 0, 7, 55352, 1, 6, 2659, 1, 7, 3640, // 0, 7 +-1, 7, 2659, -1, 8, 3638, 0, 7, 3885, 0, 8, 55354, // 0, 8 +-1, 8, 2709, -1, 9, 3722, 0, 8, 3940, 0, 9, 55165, // 0, 9 +-1, 9, 2796, -1, 10, 3858, 0, 9, 4047, 0, 10, 54835, // 0,10 +-1, 10, 2916, -1, 11, 4041, 0, 10, 4201, 0, 11, 54378, // 0,11 +-1, 11, 3064, -1, 12, 4264, 0, 11, 4392, 0, 12, 53816, // 0,12 +-1, 12, 3235, -1, 13, 4521, 0, 12, 4612, 0, 13, 53168, // 0,13 +-1, 13, 3421, -1, 14, 4803, 0, 13, 4854, 0, 14, 52458, // 0,14 +-1, 14, 3621, -1, 15, 5106, 0, 14, 5110, 0, 15, 51699, // 0,15 +1, -1, 4803, 1, 0, 52457, 2, -1, 3421, 2, 0, 4855, // 1, 0 +1, 0, 4522, 1, 1, 53285, 2, 0, 3204, 2, 1, 4525, // 1, 1 +1, 1, 4253, 1, 2, 54071, 2, 1, 2998, 2, 2, 4214, // 1, 2 +1, 2, 4003, 1, 3, 54796, 2, 2, 2808, 2, 3, 3929, // 1, 3 +1, 3, 3783, 1, 4, 55434, 2, 3, 2640, 2, 4, 3679, // 1, 4 +1, 4, 3604, 1, 5, 55958, 2, 4, 2503, 2, 5, 3471, // 1, 5 +1, 5, 3476, 1, 6, 56339, 2, 5, 2403, 2, 6, 3318, // 1, 6 +1, 6, 3411, 1, 7, 56552, 2, 6, 2346, 2, 7, 3227, // 1, 7 +0, 7, 2346, 0, 8, 3225, 1, 7, 3411, 1, 8, 56554, // 1, 8 +0, 8, 2402, 0, 9, 3317, 1, 8, 3477, 1, 9, 56340, // 1, 9 +0, 9, 2502, 0, 10, 3470, 1, 9, 3605, 1, 10, 55959, // 1,10 +0, 10, 2640, 0, 11, 3677, 1, 10, 3785, 1, 11, 55434, // 1,11 +0, 11, 2808, 0, 12, 3927, 1, 11, 4005, 1, 12, 54796, // 1,12 +0, 12, 2998, 0, 13, 4212, 1, 12, 4255, 1, 13, 54071, // 1,13 +0, 13, 3204, 0, 14, 4522, 1, 13, 4525, 1, 14, 53285, // 1,14 +0, 14, 3422, 0, 15, 4851, 1, 14, 4806, 1, 15, 52457, // 1,15 +2, -1, 4521, 2, 0, 53168, 3, -1, 3235, 3, 0, 4612, // 2, 0 +2, 0, 4212, 2, 1, 54072, 3, 0, 2998, 3, 1, 4254, // 2, 1 +2, 1, 3911, 2, 2, 54941, 3, 1, 2770, 3, 2, 3914, // 2, 2 +2, 2, 3628, 2, 3, 55756, 3, 2, 2557, 3, 3, 3595, // 2, 3 +2, 3, 3373, 2, 4, 56486, 3, 3, 2365, 3, 4, 3312, // 2, 4 +2, 4, 3161, 2, 5, 57095, 3, 4, 2205, 3, 5, 3075, // 2, 5 +2, 5, 3007, 2, 6, 57544, 3, 5, 2088, 3, 6, 2897, // 2, 6 +2, 6, 2926, 2, 7, 57793, 3, 6, 2022, 3, 7, 2795, // 2, 7 +1, 7, 2022, 1, 8, 2794, 2, 7, 2926, 2, 8, 57794, // 2, 8 +1, 8, 2088, 1, 9, 2897, 2, 8, 3007, 2, 9, 57544, // 2, 9 +1, 9, 2205, 1, 10, 3073, 2, 9, 3161, 2, 10, 57097, // 2,10 +1, 10, 2365, 1, 11, 3310, 2, 10, 3374, 2, 11, 56487, // 2,11 +1, 11, 2556, 1, 12, 3594, 2, 11, 3630, 2, 12, 55756, // 2,12 +1, 12, 2770, 1, 13, 3911, 2, 12, 3913, 2, 13, 54942, // 2,13 +1, 13, 2998, 1, 14, 4253, 2, 13, 4214, 2, 14, 54071, // 2,14 +1, 14, 3235, 1, 15, 4610, 2, 14, 4523, 2, 15, 53168, // 2,15 +3, -1, 4264, 3, 0, 53815, 4, -1, 3064, 4, 0, 4393, // 3, 0 +3, 0, 3927, 3, 1, 54796, 4, 0, 2808, 4, 1, 4005, // 3, 1 +3, 1, 3594, 3, 2, 55756, 4, 1, 2556, 4, 2, 3630, // 3, 2 +3, 2, 3273, 3, 3, 56673, 4, 2, 2317, 4, 3, 3273, // 3, 3 +3, 3, 2976, 3, 4, 57514, 4, 3, 2096, 4, 4, 2950, // 3, 4 +3, 4, 2722, 3, 5, 58233, 4, 4, 1908, 4, 5, 2673, // 3, 5 +3, 5, 2532, 3, 6, 58774, 4, 5, 1767, 4, 6, 2463, // 3, 6 +3, 6, 2430, 3, 7, 59076, 4, 6, 1687, 4, 7, 2343, // 3, 7 +2, 7, 1687, 2, 8, 2342, 3, 7, 2430, 3, 8, 59077, // 3, 8 +2, 8, 1766, 2, 9, 2463, 3, 8, 2532, 3, 9, 58775, // 3, 9 +2, 9, 1908, 2, 10, 2672, 3, 9, 2723, 3, 10, 58233, // 3,10 +2, 10, 2096, 2, 11, 2948, 3, 10, 2977, 3, 11, 57515, // 3,11 +2, 11, 2317, 2, 12, 3273, 3, 11, 3274, 3, 12, 56672, // 3,12 +2, 12, 2557, 2, 13, 3628, 3, 12, 3595, 3, 13, 55756, // 3,13 +2, 13, 2808, 2, 14, 4003, 3, 13, 3929, 3, 14, 54796, // 3,14 +2, 14, 3065, 2, 15, 4390, 3, 14, 4267, 3, 15, 53814, // 3,15 +4, -1, 4041, 4, 0, 54378, 5, -1, 2916, 5, 0, 4201, // 4, 0 +4, 0, 3677, 4, 1, 55435, 5, 0, 2640, 5, 1, 3784, // 4, 1 +4, 1, 3310, 4, 2, 56487, 5, 1, 2365, 5, 2, 3374, // 4, 2 +4, 2, 2948, 4, 3, 57514, 5, 2, 2096, 5, 3, 2978, // 4, 3 +4, 3, 2604, 4, 4, 58484, 5, 3, 1843, 5, 4, 2605, // 4, 4 +4, 4, 2297, 4, 5, 59345, 5, 4, 1617, 5, 5, 2277, // 4, 5 +4, 5, 2057, 4, 6, 60017, 5, 5, 1442, 5, 6, 2020, // 4, 6 +4, 6, 1922, 4, 7, 60402, 5, 6, 1341, 5, 7, 1871, // 4, 7 +3, 7, 1341, 3, 8, 1871, 4, 7, 1922, 4, 8, 60402, // 4, 8 +3, 8, 1442, 3, 9, 2020, 4, 8, 2057, 4, 9, 60017, // 4, 9 +3, 9, 1617, 3, 10, 2276, 4, 9, 2297, 4, 10, 59346, // 4,10 +3, 10, 1843, 3, 11, 2604, 4, 10, 2605, 4, 11, 58484, // 4,11 +3, 11, 2096, 3, 12, 2976, 4, 11, 2950, 4, 12, 57514, // 4,12 +3, 12, 2365, 3, 13, 3373, 4, 12, 3311, 4, 13, 56487, // 4,13 +3, 13, 2640, 3, 14, 3783, 4, 13, 3678, 4, 14, 55435, // 4,14 +3, 14, 2917, 3, 15, 4200, 4, 14, 4043, 4, 15, 54376, // 4,15 +5, -1, 3858, 5, 0, 54835, 6, -1, 2796, 6, 0, 4047, // 5, 0 +5, 0, 3470, 5, 1, 55959, 6, 0, 2502, 6, 1, 3605, // 5, 1 +5, 1, 3073, 5, 2, 57096, 6, 1, 2205, 6, 2, 3162, // 5, 2 +5, 2, 2672, 5, 3, 58234, 6, 2, 1908, 6, 3, 2722, // 5, 3 +5, 3, 2276, 5, 4, 59346, 6, 3, 1617, 6, 4, 2297, // 5, 4 +5, 4, 1904, 5, 5, 60381, 6, 4, 1347, 6, 5, 1904, // 5, 5 +5, 5, 1593, 5, 6, 61243, 6, 5, 1121, 6, 6, 1579, // 5, 6 +5, 6, 1405, 5, 7, 61767, 6, 6, 985, 6, 7, 1379, // 5, 7 +4, 7, 985, 4, 8, 1380, 5, 7, 1405, 5, 8, 61766, // 5, 8 +4, 8, 1121, 4, 9, 1578, 5, 8, 1593, 5, 9, 61244, // 5, 9 +4, 9, 1347, 4, 10, 1904, 5, 9, 1904, 5, 10, 60381, // 5,10 +4, 10, 1617, 4, 11, 2297, 5, 10, 2276, 5, 11, 59346, // 5,11 +4, 11, 1908, 4, 12, 2722, 5, 11, 2673, 5, 12, 58233, // 5,12 +4, 12, 2205, 4, 13, 3161, 5, 12, 3074, 5, 13, 57096, // 5,13 +4, 13, 2503, 4, 14, 3604, 5, 13, 3472, 5, 14, 55957, // 5,14 +4, 14, 2797, 4, 15, 4046, 5, 14, 3860, 5, 15, 54833, // 5,15 +6, -1, 3722, 6, 0, 55166, 7, -1, 2709, 7, 0, 3939, // 6, 0 +6, 0, 3317, 6, 1, 56340, 7, 0, 2402, 7, 1, 3477, // 6, 1 +6, 1, 2897, 6, 2, 57545, 7, 1, 2088, 7, 2, 3006, // 6, 2 +6, 2, 2463, 6, 3, 58775, 7, 2, 1766, 7, 3, 2532, // 6, 3 +6, 3, 2020, 6, 4, 60018, 7, 3, 1442, 7, 4, 2056, // 6, 4 +6, 4, 1578, 6, 5, 61243, 7, 4, 1121, 7, 5, 1594, // 6, 5 +6, 5, 1170, 6, 6, 62369, 7, 5, 827, 7, 6, 1170, // 6, 6 +6, 6, 883, 6, 7, 63156, 7, 6, 622, 7, 7, 875, // 6, 7 +5, 7, 622, 5, 8, 875, 6, 7, 883, 6, 8, 63156, // 6, 8 +5, 8, 827, 5, 9, 1170, 6, 8, 1170, 6, 9, 62369, // 6, 9 +5, 9, 1121, 5, 10, 1593, 6, 9, 1579, 6, 10, 61243, // 6,10 +5, 10, 1442, 5, 11, 2057, 6, 10, 2020, 6, 11, 60017, // 6,11 +5, 11, 1767, 5, 12, 2532, 6, 11, 2464, 6, 12, 58773, // 6,12 +5, 12, 2088, 5, 13, 3007, 6, 12, 2898, 6, 13, 57543, // 6,13 +5, 13, 2403, 5, 14, 3476, 6, 13, 3319, 6, 14, 56338, // 6,14 +5, 14, 2709, 5, 15, 3939, 6, 14, 3724, 6, 15, 55164, // 6,15 +7, -1, 3638, 7, 0, 55354, 8, -1, 2659, 8, 0, 3885, // 7, 0 +7, 0, 3225, 7, 1, 56554, 8, 0, 2346, 8, 1, 3411, // 7, 1 +7, 1, 2794, 7, 2, 57795, 8, 1, 2022, 8, 2, 2925, // 7, 2 +7, 2, 2342, 7, 3, 59077, 8, 2, 1687, 8, 3, 2430, // 7, 3 +7, 3, 1871, 7, 4, 60402, 8, 3, 1341, 8, 4, 1922, // 7, 4 +7, 4, 1380, 7, 5, 61767, 8, 4, 985, 8, 5, 1404, // 7, 5 +7, 5, 875, 7, 6, 63156, 8, 5, 622, 8, 6, 883, // 7, 6 +7, 6, 399, 7, 7, 64455, 8, 6, 282, 8, 7, 400, // 7, 7 +6, 7, 282, 6, 8, 399, 7, 7, 399, 7, 8, 64456, // 7, 8 +6, 8, 622, 6, 9, 883, 7, 8, 875, 7, 9, 63156, // 7, 9 +6, 9, 985, 6, 10, 1405, 7, 9, 1380, 7, 10, 61766, // 7,10 +6, 10, 1341, 6, 11, 1922, 7, 10, 1871, 7, 11, 60402, // 7,11 +6, 11, 1687, 6, 12, 2430, 7, 11, 2343, 7, 12, 59076, // 7,12 +6, 12, 2022, 6, 13, 2926, 7, 12, 2795, 7, 13, 57793, // 7,13 +6, 13, 2346, 6, 14, 3411, 7, 13, 3227, 7, 14, 56552, // 7,14 +6, 14, 2659, 6, 15, 3885, 7, 14, 3640, 7, 15, 55352, // 7,15 +8, 0, 55352, 8, 1, 3640, 9, 0, 3885, 9, 1, 2659, // 8, 0 +8, 1, 56552, 8, 2, 3227, 9, 1, 3411, 9, 2, 2346, // 8, 1 +8, 2, 57793, 8, 3, 2795, 9, 2, 2926, 9, 3, 2022, // 8, 2 +8, 3, 59076, 8, 4, 2343, 9, 3, 2430, 9, 4, 1687, // 8, 3 +8, 4, 60402, 8, 5, 1871, 9, 4, 1922, 9, 5, 1341, // 8, 4 +8, 5, 61767, 8, 6, 1380, 9, 5, 1405, 9, 6, 984, // 8, 5 +8, 6, 63156, 8, 7, 875, 9, 6, 883, 9, 7, 622, // 8, 6 +8, 7, 64455, 8, 8, 399, 9, 7, 399, 9, 8, 283, // 8, 7 +7, 8, 399, 7, 9, 282, 8, 8, 64455, 8, 9, 400, // 8, 8 +7, 9, 883, 7, 10, 622, 8, 9, 63156, 8, 10, 875, // 8, 9 +7, 10, 1405, 7, 11, 985, 8, 10, 61767, 8, 11, 1379, // 8,10 +7, 11, 1922, 7, 12, 1341, 8, 11, 60402, 8, 12, 1871, // 8,11 +7, 12, 2430, 7, 13, 1687, 8, 12, 59077, 8, 13, 2342, // 8,12 +7, 13, 2926, 7, 14, 2022, 8, 13, 57795, 8, 14, 2793, // 8,13 +7, 14, 3411, 7, 15, 2346, 8, 14, 56554, 8, 15, 3225, // 8,14 +7, 15, 3885, 7, 16, 2659, 8, 15, 55354, 8, 16, 3638, // 8,15 +9, 0, 55164, 9, 1, 3724, 10, 0, 3939, 10, 1, 2709, // 9, 0 +9, 1, 56339, 9, 2, 3319, 10, 1, 3476, 10, 2, 2402, // 9, 1 +9, 2, 57544, 9, 3, 2898, 10, 2, 3007, 10, 3, 2087, // 9, 2 +9, 3, 58774, 9, 4, 2464, 10, 3, 2532, 10, 4, 1766, // 9, 3 +9, 4, 60017, 9, 5, 2020, 10, 4, 2057, 10, 5, 1442, // 9, 4 +9, 5, 61243, 9, 6, 1579, 10, 5, 1593, 10, 6, 1121, // 9, 5 +9, 6, 62369, 9, 7, 1170, 10, 6, 1170, 10, 7, 827, // 9, 6 +9, 7, 63156, 9, 8, 883, 10, 7, 875, 10, 8, 622, // 9, 7 +8, 8, 875, 8, 9, 622, 9, 8, 63156, 9, 9, 883, // 9, 8 +8, 9, 1170, 8, 10, 827, 9, 9, 62369, 9, 10, 1170, // 9, 9 +8, 10, 1593, 8, 11, 1121, 9, 10, 61243, 9, 11, 1579, // 9,10 +8, 11, 2057, 8, 12, 1442, 9, 11, 60018, 9, 12, 2019, // 9,11 +8, 12, 2532, 8, 13, 1766, 9, 12, 58775, 9, 13, 2463, // 9,12 +8, 13, 3007, 8, 14, 2088, 9, 13, 57545, 9, 14, 2896, // 9,13 +8, 14, 3477, 8, 15, 2402, 9, 14, 56340, 9, 15, 3317, // 9,14 +8, 15, 3940, 8, 16, 2709, 9, 15, 55166, 9, 16, 3721, // 9,15 +10, 0, 54833, 10, 1, 3860, 11, 0, 4046, 11, 1, 2797, // 10, 0 +10, 1, 55958, 10, 2, 3472, 11, 1, 3604, 11, 2, 2502, // 10, 1 +10, 2, 57095, 10, 3, 3074, 11, 2, 3161, 11, 3, 2206, // 10, 2 +10, 3, 58233, 10, 4, 2673, 11, 3, 2722, 11, 4, 1908, // 10, 3 +10, 4, 59345, 10, 5, 2276, 11, 4, 2297, 11, 5, 1618, // 10, 4 +10, 5, 60381, 10, 6, 1904, 11, 5, 1904, 11, 6, 1347, // 10, 5 +10, 6, 61243, 10, 7, 1593, 11, 6, 1578, 11, 7, 1122, // 10, 6 +10, 7, 61767, 10, 8, 1405, 11, 7, 1380, 11, 8, 984, // 10, 7 +9, 8, 1380, 9, 9, 985, 10, 8, 61767, 10, 9, 1404, // 10, 8 +9, 9, 1579, 9, 10, 1121, 10, 9, 61243, 10, 10, 1593, // 10, 9 +9, 10, 1904, 9, 11, 1347, 10, 10, 60381, 10, 11, 1904, // 10,10 +9, 11, 2297, 9, 12, 1617, 10, 11, 59346, 10, 12, 2276, // 10,11 +9, 12, 2723, 9, 13, 1908, 10, 12, 58234, 10, 13, 2671, // 10,12 +9, 13, 3161, 9, 14, 2205, 10, 13, 57096, 10, 14, 3074, // 10,13 +9, 14, 3605, 9, 15, 2502, 10, 14, 55959, 10, 15, 3470, // 10,14 +9, 15, 4047, 9, 16, 2796, 10, 15, 54835, 10, 16, 3858, // 10,15 +11, 0, 54376, 11, 1, 4043, 12, 0, 4200, 12, 1, 2917, // 11, 0 +11, 1, 55434, 11, 2, 3678, 12, 1, 3783, 12, 2, 2641, // 11, 1 +11, 2, 56486, 11, 3, 3311, 12, 2, 3373, 12, 3, 2366, // 11, 2 +11, 3, 57514, 11, 4, 2950, 12, 3, 2976, 12, 4, 2096, // 11, 3 +11, 4, 58484, 11, 5, 2605, 12, 4, 2604, 12, 5, 1843, // 11, 4 +11, 5, 59346, 11, 6, 2297, 12, 5, 2276, 12, 6, 1617, // 11, 5 +11, 6, 60018, 11, 7, 2057, 12, 6, 2020, 12, 7, 1441, // 11, 6 +11, 7, 60402, 11, 8, 1922, 12, 7, 1871, 12, 8, 1341, // 11, 7 +10, 8, 1871, 10, 9, 1341, 11, 8, 60402, 11, 9, 1922, // 11, 8 +10, 9, 2020, 10, 10, 1442, 11, 9, 60017, 11, 10, 2057, // 11, 9 +10, 10, 2276, 10, 11, 1617, 11, 10, 59345, 11, 11, 2298, // 11,10 +10, 11, 2605, 10, 12, 1843, 11, 11, 58484, 11, 12, 2604, // 11,11 +10, 12, 2977, 10, 13, 2096, 11, 12, 57514, 11, 13, 2949, // 11,12 +10, 13, 3374, 10, 14, 2365, 11, 13, 56487, 11, 14, 3310, // 11,13 +10, 14, 3785, 10, 15, 2640, 11, 14, 55435, 11, 15, 3676, // 11,14 +10, 15, 4201, 10, 16, 2916, 11, 15, 54378, 11, 16, 4041, // 11,15 +12, 0, 53814, 12, 1, 4267, 13, 0, 4390, 13, 1, 3065, // 12, 0 +12, 1, 54796, 12, 2, 3929, 13, 1, 4003, 13, 2, 2808, // 12, 1 +12, 2, 55756, 12, 3, 3595, 13, 2, 3628, 13, 3, 2557, // 12, 2 +12, 3, 56673, 12, 4, 3274, 13, 3, 3273, 13, 4, 2316, // 12, 3 +12, 4, 57514, 12, 5, 2977, 13, 4, 2948, 13, 5, 2097, // 12, 4 +12, 5, 58234, 12, 6, 2723, 13, 5, 2672, 13, 6, 1907, // 12, 5 +12, 6, 58775, 12, 7, 2532, 13, 6, 2463, 13, 7, 1766, // 12, 6 +12, 7, 59077, 12, 8, 2430, 13, 7, 2342, 13, 8, 1687, // 12, 7 +11, 8, 2343, 11, 9, 1687, 12, 8, 59076, 12, 9, 2430, // 12, 8 +11, 9, 2464, 11, 10, 1767, 12, 9, 58774, 12, 10, 2531, // 12, 9 +11, 10, 2673, 11, 11, 1908, 12, 10, 58233, 12, 11, 2722, // 12,10 +11, 11, 2950, 11, 12, 2096, 12, 11, 57514, 12, 12, 2976, // 12,11 +11, 12, 3274, 11, 13, 2317, 12, 12, 56673, 12, 13, 3272, // 12,12 +11, 13, 3630, 11, 14, 2556, 12, 13, 55756, 12, 14, 3594, // 12,13 +11, 14, 4005, 11, 15, 2808, 12, 14, 54796, 12, 15, 3927, // 12,14 +11, 15, 4392, 11, 16, 3064, 12, 15, 53815, 12, 16, 4265, // 12,15 +13, 0, 53168, 13, 1, 4523, 14, 0, 4610, 14, 1, 3235, // 13, 0 +13, 1, 54071, 13, 2, 4214, 14, 1, 4253, 14, 2, 2998, // 13, 1 +13, 2, 54941, 13, 3, 3913, 14, 2, 3911, 14, 3, 2771, // 13, 2 +13, 3, 55756, 13, 4, 3630, 14, 3, 3594, 14, 4, 2556, // 13, 3 +13, 4, 56487, 13, 5, 3374, 14, 4, 3310, 14, 5, 2365, // 13, 4 +13, 5, 57096, 13, 6, 3161, 14, 5, 3073, 14, 6, 2206, // 13, 5 +13, 6, 57545, 13, 7, 3007, 14, 6, 2897, 14, 7, 2087, // 13, 6 +13, 7, 57795, 13, 8, 2926, 14, 7, 2794, 14, 8, 2021, // 13, 7 +12, 8, 2795, 12, 9, 2022, 13, 8, 57793, 13, 9, 2926, // 13, 8 +12, 9, 2898, 12, 10, 2088, 13, 9, 57544, 13, 10, 3006, // 13, 9 +12, 10, 3074, 12, 11, 2205, 13, 10, 57095, 13, 11, 3162, // 13,10 +12, 11, 3311, 12, 12, 2365, 13, 11, 56486, 13, 12, 3374, // 13,11 +12, 12, 3595, 12, 13, 2557, 13, 12, 55756, 13, 13, 3628, // 13,12 +12, 13, 3913, 12, 14, 2770, 13, 13, 54941, 13, 14, 3912, // 13,13 +12, 14, 4255, 12, 15, 2998, 13, 14, 54072, 13, 15, 4211, // 13,14 +12, 15, 4612, 12, 16, 3235, 13, 15, 53168, 13, 16, 4521, // 13,15 +14, 0, 52457, 14, 1, 4806, 15, 0, 4851, 15, 1, 3422, // 14, 0 +14, 1, 53285, 14, 2, 4525, 15, 1, 4522, 15, 2, 3204, // 14, 1 +14, 2, 54072, 14, 3, 4255, 15, 2, 4212, 15, 3, 2997, // 14, 2 +14, 3, 54796, 14, 4, 4005, 15, 3, 3927, 15, 4, 2808, // 14, 3 +14, 4, 55435, 14, 5, 3785, 15, 4, 3677, 15, 5, 2639, // 14, 4 +14, 5, 55959, 14, 6, 3605, 15, 5, 3470, 15, 6, 2502, // 14, 5 +14, 6, 56340, 14, 7, 3477, 15, 6, 3317, 15, 7, 2402, // 14, 6 +14, 7, 56554, 14, 8, 3411, 15, 7, 3225, 15, 8, 2346, // 14, 7 +13, 8, 3227, 13, 9, 2346, 14, 8, 56552, 14, 9, 3411, // 14, 8 +13, 9, 3319, 13, 10, 2403, 14, 9, 56339, 14, 10, 3475, // 14, 9 +13, 10, 3472, 13, 11, 2503, 14, 10, 55958, 14, 11, 3603, // 14,10 +13, 11, 3678, 13, 12, 2640, 14, 11, 55434, 14, 12, 3784, // 14,11 +13, 12, 3929, 13, 13, 2808, 14, 12, 54796, 14, 13, 4003, // 14,12 +13, 13, 4214, 13, 14, 2998, 14, 13, 54071, 14, 14, 4253, // 14,13 +13, 14, 4525, 13, 15, 3204, 14, 14, 53285, 14, 15, 4522, // 14,14 +13, 15, 4854, 13, 16, 3421, 14, 15, 52457, 14, 16, 4804, // 14,15 +15, 0, 51699, 15, 1, 5110, 16, 0, 5106, 16, 1, 3621, // 15, 0 +15, 1, 52457, 15, 2, 4854, 16, 1, 4803, 16, 2, 3422, // 15, 1 +15, 2, 53168, 15, 3, 4612, 16, 2, 4521, 16, 3, 3235, // 15, 2 +15, 3, 53815, 15, 4, 4392, 16, 3, 4264, 16, 4, 3065, // 15, 3 +15, 4, 54378, 15, 5, 4201, 16, 4, 4041, 16, 5, 2916, // 15, 4 +15, 5, 54835, 15, 6, 4047, 16, 5, 3858, 16, 6, 2796, // 15, 5 +15, 6, 55166, 15, 7, 3940, 16, 6, 3722, 16, 7, 2708, // 15, 6 +15, 7, 55354, 15, 8, 3885, 16, 7, 3638, 16, 8, 2659, // 15, 7 +14, 8, 3640, 14, 9, 2659, 15, 8, 55352, 15, 9, 3885, // 15, 8 +14, 9, 3724, 14, 10, 2709, 15, 9, 55164, 15, 10, 3939, // 15, 9 +14, 10, 3860, 14, 11, 2797, 15, 10, 54833, 15, 11, 4046, // 15,10 +14, 11, 4043, 14, 12, 2917, 15, 11, 54376, 15, 12, 4200, // 15,11 +14, 12, 4267, 14, 13, 3065, 15, 12, 53814, 15, 13, 4390, // 15,12 +14, 13, 4523, 14, 14, 3235, 15, 13, 53168, 15, 14, 4610, // 15,13 +14, 14, 4806, 14, 15, 3422, 15, 14, 52457, 15, 15, 4851, // 15,14 +14, 15, 5110, 14, 16, 3621, 15, 15, 51699, 15, 16, 5106, // 15,15 +// angle of 1.0 degrees +0, -1, 8769, 0, 0, 41693, 1, -1, 6280, 1, 0, 8794, // 0, 0 +0, 0, 8452, 0, 1, 42821, 1, 0, 5975, 1, 1, 8288, // 0, 1 +0, 1, 8141, 0, 2, 43900, 1, 1, 5684, 1, 2, 7811, // 0, 2 +0, 2, 7848, 0, 3, 44901, 1, 2, 5413, 1, 3, 7374, // 0, 3 +0, 3, 7587, 0, 4, 45791, 1, 3, 5172, 1, 4, 6986, // 0, 4 +0, 4, 7374, 0, 5, 46532, 1, 4, 4971, 1, 5, 6659, // 0, 5 +0, 5, 7227, 0, 6, 47086, 1, 5, 4818, 1, 6, 6405, // 0, 6 +0, 6, 7158, 0, 7, 47426, 1, 6, 4722, 1, 7, 6230, // 0, 7 +-1, 7, 4718, -1, 8, 6217, 0, 7, 7161, 0, 8, 47440, // 0, 8 +-1, 8, 4814, -1, 9, 6391, 0, 8, 7233, 0, 9, 47098, // 0, 9 +-1, 9, 4967, -1, 10, 6644, 0, 9, 7383, 0, 10, 46542, // 0,10 +-1, 10, 5169, -1, 11, 6970, 0, 10, 7599, 0, 11, 45798, // 0,11 +-1, 11, 5410, -1, 12, 7356, 0, 11, 7863, 0, 12, 44907, // 0,12 +-1, 12, 5682, -1, 13, 7791, 0, 12, 8159, 0, 13, 43904, // 0,13 +-1, 13, 5974, -1, 14, 8265, 0, 13, 8474, 0, 14, 42823, // 0,14 +-1, 14, 6280, -1, 15, 8769, 0, 14, 8795, 0, 15, 41692, // 0,15 +1, -1, 8265, 1, 0, 42823, 2, -1, 5974, 2, 0, 8474, // 1, 0 +1, 0, 7901, 1, 1, 44074, 2, 0, 5640, 2, 1, 7921, // 1, 1 +1, 1, 7539, 1, 2, 45286, 2, 1, 5316, 2, 2, 7395, // 1, 2 +1, 2, 7191, 1, 3, 46427, 2, 2, 5011, 2, 3, 6907, // 1, 3 +1, 3, 6875, 1, 4, 47453, 2, 3, 4736, 2, 4, 6472, // 1, 4 +1, 4, 6613, 1, 5, 48314, 2, 4, 4505, 2, 5, 6104, // 1, 5 +1, 5, 6425, 1, 6, 48960, 2, 5, 4330, 2, 6, 5821, // 1, 6 +1, 6, 6332, 1, 7, 49347, 2, 6, 4224, 2, 7, 5633, // 1, 7 +0, 7, 4221, 0, 8, 5623, 1, 7, 6335, 1, 8, 49357, // 1, 8 +0, 8, 4327, 0, 9, 5809, 1, 8, 6430, 1, 9, 48970, // 1, 9 +0, 9, 4502, 0, 10, 6092, 1, 9, 6620, 1, 10, 48322, // 1,10 +0, 10, 4734, 0, 11, 6458, 1, 10, 6886, 1, 11, 47458, // 1,11 +0, 11, 5009, 0, 12, 6892, 1, 11, 7204, 1, 12, 46431, // 1,12 +0, 12, 5315, 0, 13, 7378, 1, 12, 7555, 1, 13, 45288, // 1,13 +0, 13, 5640, 0, 14, 7901, 1, 13, 7921, 1, 14, 44074, // 1,14 +0, 14, 5975, 0, 15, 8452, 1, 14, 8288, 1, 15, 42821, // 1,15 +2, -1, 7791, 2, 0, 43904, 3, -1, 5682, 3, 0, 8159, // 2, 0 +2, 0, 7378, 2, 1, 45288, 3, 0, 5315, 3, 1, 7555, // 2, 1 +2, 1, 6959, 2, 2, 46650, 3, 1, 4954, 3, 2, 6973, // 2, 2 +2, 2, 6549, 2, 3, 47953, 3, 2, 4608, 3, 3, 6426, // 2, 3 +2, 3, 6168, 2, 4, 49147, 3, 3, 4291, 3, 4, 5930, // 2, 4 +2, 4, 5842, 2, 5, 50165, 3, 4, 4020, 3, 5, 5509, // 2, 5 +2, 5, 5602, 2, 6, 50935, 3, 5, 3815, 3, 6, 5184, // 2, 6 +2, 6, 5478, 2, 7, 51387, 3, 6, 3693, 3, 7, 4978, // 2, 7 +1, 7, 3691, 1, 8, 4970, 2, 7, 5480, 2, 8, 51395, // 2, 8 +1, 8, 3813, 1, 9, 5175, 2, 8, 5606, 2, 9, 50942, // 2, 9 +1, 9, 4019, 1, 10, 5499, 2, 9, 5848, 2, 10, 50170, // 2,10 +1, 10, 4290, 1, 11, 5920, 2, 10, 6176, 2, 11, 49150, // 2,11 +1, 11, 4607, 1, 12, 6414, 2, 11, 6560, 2, 12, 47955, // 2,12 +1, 12, 4954, 1, 13, 6959, 2, 12, 6973, 2, 13, 46650, // 2,13 +1, 13, 5316, 1, 14, 7539, 2, 13, 7395, 2, 14, 45286, // 2,14 +1, 14, 5684, 1, 15, 8141, 2, 14, 7812, 2, 15, 43899, // 2,15 +3, -1, 7356, 3, 0, 44907, 4, -1, 5410, 4, 0, 7863, // 3, 0 +3, 0, 6892, 3, 1, 46430, 4, 0, 5009, 4, 1, 7205, // 3, 1 +3, 1, 6414, 3, 2, 47955, 4, 1, 4607, 4, 2, 6560, // 3, 2 +3, 2, 5934, 3, 3, 49445, 4, 2, 4214, 4, 3, 5943, // 3, 3 +3, 3, 5474, 3, 4, 50843, 4, 3, 3846, 4, 4, 5373, // 3, 4 +3, 4, 5069, 3, 5, 52066, 4, 4, 3523, 4, 5, 4878, // 3, 5 +3, 5, 4759, 3, 6, 53008, 4, 5, 3274, 4, 6, 4495, // 3, 6 +3, 6, 4592, 3, 7, 53557, 4, 6, 3128, 4, 7, 4259, // 3, 7 +2, 7, 3126, 2, 8, 4254, 3, 7, 4594, 3, 8, 53562, // 3, 8 +2, 8, 3273, 2, 9, 4489, 3, 8, 4762, 3, 9, 53012, // 3, 9 +2, 9, 3522, 2, 10, 4872, 3, 9, 5073, 3, 10, 52069, // 3,10 +2, 10, 3845, 2, 11, 5365, 3, 10, 5481, 3, 11, 50845, // 3,11 +2, 11, 4214, 2, 12, 5934, 3, 11, 5943, 3, 12, 49445, // 3,12 +2, 12, 4608, 2, 13, 6549, 3, 12, 6426, 3, 13, 47953, // 3,13 +2, 13, 5011, 2, 14, 7191, 3, 13, 6908, 3, 14, 46426, // 3,14 +2, 14, 5413, 2, 15, 7848, 3, 14, 7374, 3, 15, 44901, // 3,15 +4, -1, 6970, 4, 0, 45799, 5, -1, 5169, 5, 0, 7598, // 4, 0 +4, 0, 6458, 4, 1, 47458, 5, 0, 4734, 5, 1, 6886, // 4, 1 +4, 1, 5920, 4, 2, 49150, 5, 1, 4290, 5, 2, 6176, // 4, 2 +4, 2, 5365, 4, 3, 50844, 5, 2, 3845, 5, 3, 5482, // 4, 3 +4, 3, 4816, 4, 4, 52484, 5, 3, 3415, 5, 4, 4821, // 4, 4 +4, 4, 4309, 4, 5, 53973, 5, 4, 3023, 5, 5, 4231, // 4, 5 +4, 5, 3902, 4, 6, 55164, 5, 5, 2711, 5, 6, 3759, // 4, 6 +4, 6, 3671, 4, 7, 55867, 5, 6, 2525, 5, 7, 3473, // 4, 7 +3, 7, 2524, 3, 8, 3469, 4, 7, 3672, 4, 8, 55871, // 4, 8 +3, 8, 2710, 3, 9, 3755, 4, 8, 3904, 4, 9, 55167, // 4, 9 +3, 9, 3023, 3, 10, 4226, 4, 9, 4313, 4, 10, 53974, // 4,10 +3, 10, 3415, 3, 11, 4816, 4, 10, 4822, 4, 11, 52483, // 4,11 +3, 11, 3846, 3, 12, 5474, 4, 11, 5373, 4, 12, 50843, // 4,12 +3, 12, 4291, 3, 13, 6168, 4, 12, 5930, 4, 13, 49147, // 4,13 +3, 13, 4736, 3, 14, 6875, 4, 13, 6472, 4, 14, 47453, // 4,14 +3, 14, 5172, 3, 15, 7587, 4, 14, 6986, 4, 15, 45791, // 4,15 +5, -1, 6644, 5, 0, 46541, 6, -1, 4967, 6, 0, 7384, // 5, 0 +5, 0, 6092, 5, 1, 48322, 6, 0, 4502, 6, 1, 6620, // 5, 1 +5, 1, 5499, 5, 2, 50171, 6, 1, 4019, 6, 2, 5847, // 5, 2 +5, 2, 4872, 5, 3, 52069, 6, 2, 3522, 6, 3, 5073, // 5, 3 +5, 3, 4226, 5, 4, 53975, 6, 3, 3023, 6, 4, 4312, // 5, 4 +5, 4, 3595, 5, 5, 55798, 6, 4, 2546, 6, 5, 3597, // 5, 5 +5, 5, 3050, 5, 6, 57353, 6, 5, 2138, 6, 6, 2995, // 5, 6 +5, 6, 2713, 5, 7, 58322, 6, 6, 1884, 6, 7, 2617, // 5, 7 +4, 7, 1884, 4, 8, 2615, 5, 7, 2714, 5, 8, 58323, // 5, 8 +4, 8, 2138, 4, 9, 2993, 5, 8, 3051, 5, 9, 57354, // 5, 9 +4, 9, 2546, 4, 10, 3595, 5, 9, 3598, 5, 10, 55797, // 5,10 +4, 10, 3023, 4, 11, 4309, 5, 10, 4230, 5, 11, 53974, // 5,11 +4, 11, 3523, 4, 12, 5069, 5, 11, 4879, 5, 12, 52065, // 5,12 +4, 12, 4020, 4, 13, 5842, 5, 12, 5508, 5, 13, 50166, // 5,13 +4, 13, 4505, 4, 14, 6613, 5, 13, 6104, 5, 14, 48314, // 5,14 +4, 14, 4971, 4, 15, 7374, 5, 14, 6659, 5, 15, 46532, // 5,15 +6, -1, 6391, 6, 0, 47098, 7, -1, 4814, 7, 0, 7233, // 6, 0 +6, 0, 5809, 6, 1, 48969, 7, 0, 4327, 7, 1, 6431, // 6, 1 +6, 1, 5175, 6, 2, 50942, 7, 1, 3813, 7, 2, 5606, // 6, 2 +6, 2, 4489, 6, 3, 53012, 7, 2, 3273, 7, 3, 4762, // 6, 3 +6, 3, 3755, 6, 4, 55166, 7, 3, 2710, 7, 4, 3905, // 6, 4 +6, 4, 2993, 6, 5, 57354, 7, 4, 2138, 7, 5, 3051, // 6, 5 +6, 5, 2258, 6, 6, 59422, 7, 5, 1597, 7, 6, 2259, // 6, 6 +6, 6, 1726, 6, 7, 60905, 7, 6, 1210, 7, 7, 1695, // 6, 7 +5, 7, 1209, 5, 8, 1695, 6, 7, 1726, 6, 8, 60906, // 6, 8 +5, 8, 1597, 5, 9, 2258, 6, 8, 2259, 6, 9, 59422, // 6, 9 +5, 9, 2138, 5, 10, 3050, 6, 9, 2995, 6, 10, 57353, // 6,10 +5, 10, 2711, 5, 11, 3902, 6, 10, 3759, 6, 11, 55164, // 6,11 +5, 11, 3274, 5, 12, 4759, 6, 11, 4495, 6, 12, 53008, // 6,12 +5, 12, 3815, 5, 13, 5602, 6, 12, 5184, 6, 13, 50935, // 6,13 +5, 13, 4330, 5, 14, 6425, 6, 13, 5820, 6, 14, 48961, // 6,14 +5, 14, 4818, 5, 15, 7227, 6, 14, 6405, 6, 15, 47086, // 6,15 +7, -1, 6217, 7, 0, 47440, 8, -1, 4718, 8, 0, 7161, // 7, 0 +7, 0, 5623, 7, 1, 49358, 8, 0, 4221, 8, 1, 6334, // 7, 1 +7, 1, 4970, 7, 2, 51395, 8, 1, 3691, 8, 2, 5480, // 7, 2 +7, 2, 4254, 7, 3, 53562, 8, 2, 3126, 8, 3, 4594, // 7, 3 +7, 3, 3469, 7, 4, 55870, 8, 3, 2524, 8, 4, 3673, // 7, 4 +7, 4, 2615, 7, 5, 58324, 8, 4, 1884, 8, 5, 2713, // 7, 5 +7, 5, 1695, 7, 6, 60906, 8, 5, 1209, 8, 6, 1726, // 7, 6 +7, 6, 789, 7, 7, 63399, 8, 6, 558, 8, 7, 790, // 7, 7 +6, 7, 558, 6, 8, 789, 7, 7, 789, 7, 8, 63400, // 7, 8 +6, 8, 1210, 6, 9, 1726, 7, 8, 1695, 7, 9, 60905, // 7, 9 +6, 9, 1884, 6, 10, 2713, 7, 9, 2616, 7, 10, 58323, // 7,10 +6, 10, 2525, 6, 11, 3671, 7, 10, 3473, 7, 11, 55867, // 7,11 +6, 11, 3128, 6, 12, 4592, 7, 11, 4259, 7, 12, 53557, // 7,12 +6, 12, 3693, 6, 13, 5478, 7, 12, 4978, 7, 13, 51387, // 7,13 +6, 13, 4224, 6, 14, 6332, 7, 13, 5633, 7, 14, 49347, // 7,14 +6, 14, 4722, 6, 15, 7158, 7, 14, 6230, 7, 15, 47426, // 7,15 +8, 0, 47426, 8, 1, 6230, 9, 0, 7158, 9, 1, 4722, // 8, 0 +8, 1, 49347, 8, 2, 5633, 9, 1, 6332, 9, 2, 4224, // 8, 1 +8, 2, 51387, 8, 3, 4978, 9, 2, 5478, 9, 3, 3693, // 8, 2 +8, 3, 53557, 8, 4, 4259, 9, 3, 4592, 9, 4, 3128, // 8, 3 +8, 4, 55867, 8, 5, 3473, 9, 4, 3671, 9, 5, 2525, // 8, 4 +8, 5, 58322, 8, 6, 2616, 9, 5, 2713, 9, 6, 1885, // 8, 5 +8, 6, 60905, 8, 7, 1695, 9, 6, 1726, 9, 7, 1210, // 8, 6 +8, 7, 63399, 8, 8, 789, 9, 7, 789, 9, 8, 559, // 8, 7 +7, 8, 789, 7, 9, 558, 8, 8, 63399, 8, 9, 790, // 8, 8 +7, 9, 1726, 7, 10, 1209, 8, 9, 60906, 8, 10, 1695, // 8, 9 +7, 10, 2714, 7, 11, 1884, 8, 10, 58324, 8, 11, 2614, // 8,10 +7, 11, 3672, 7, 12, 2524, 8, 11, 55870, 8, 12, 3470, // 8,11 +7, 12, 4594, 7, 13, 3126, 8, 12, 53562, 8, 13, 4254, // 8,12 +7, 13, 5480, 7, 14, 3691, 8, 13, 51395, 8, 14, 4970, // 8,13 +7, 14, 6335, 7, 15, 4221, 8, 14, 49358, 8, 15, 5622, // 8,14 +7, 15, 7161, 7, 16, 4718, 8, 15, 47440, 8, 16, 6217, // 8,15 +9, 0, 47086, 9, 1, 6405, 10, 0, 7227, 10, 1, 4818, // 9, 0 +9, 1, 48960, 9, 2, 5820, 10, 1, 6425, 10, 2, 4331, // 9, 1 +9, 2, 50935, 9, 3, 5184, 10, 2, 5602, 10, 3, 3815, // 9, 2 +9, 3, 53008, 9, 4, 4495, 10, 3, 4759, 10, 4, 3274, // 9, 3 +9, 4, 55164, 9, 5, 3759, 10, 4, 3902, 10, 5, 2711, // 9, 4 +9, 5, 57353, 9, 6, 2995, 10, 5, 3050, 10, 6, 2138, // 9, 5 +9, 6, 59422, 9, 7, 2259, 10, 6, 2258, 10, 7, 1597, // 9, 6 +9, 7, 60906, 9, 8, 1726, 10, 7, 1695, 10, 8, 1209, // 9, 7 +8, 8, 1695, 8, 9, 1210, 9, 8, 60905, 9, 9, 1726, // 9, 8 +8, 9, 2259, 8, 10, 1597, 9, 9, 59422, 9, 10, 2258, // 9, 9 +8, 10, 3051, 8, 11, 2138, 9, 10, 57354, 9, 11, 2993, // 9,10 +8, 11, 3904, 8, 12, 2710, 9, 11, 55166, 9, 12, 3756, // 9,11 +8, 12, 4762, 8, 13, 3273, 9, 12, 53012, 9, 13, 4489, // 9,12 +8, 13, 5606, 8, 14, 3813, 9, 13, 50942, 9, 14, 5175, // 9,13 +8, 14, 6430, 8, 15, 4327, 9, 14, 48969, 9, 15, 5810, // 9,14 +8, 15, 7233, 8, 16, 4814, 9, 15, 47098, 9, 16, 6391, // 9,15 +10, 0, 46532, 10, 1, 6659, 11, 0, 7374, 11, 1, 4971, // 10, 0 +10, 1, 48314, 10, 2, 6104, 11, 1, 6613, 11, 2, 4505, // 10, 1 +10, 2, 50165, 10, 3, 5508, 11, 2, 5842, 11, 3, 4021, // 10, 2 +10, 3, 52066, 10, 4, 4879, 11, 3, 5069, 11, 4, 3522, // 10, 3 +10, 4, 53973, 10, 5, 4230, 11, 4, 4309, 11, 5, 3024, // 10, 4 +10, 5, 55798, 10, 6, 3598, 11, 5, 3595, 11, 6, 2545, // 10, 5 +10, 6, 57354, 10, 7, 3051, 11, 6, 2993, 11, 7, 2138, // 10, 6 +10, 7, 58324, 10, 8, 2714, 11, 7, 2615, 11, 8, 1883, // 10, 7 +9, 8, 2616, 9, 9, 1884, 10, 8, 58322, 10, 9, 2714, // 10, 8 +9, 9, 2995, 9, 10, 2138, 10, 9, 57353, 10, 10, 3050, // 10, 9 +9, 10, 3598, 9, 11, 2546, 10, 10, 55798, 10, 11, 3594, // 10,10 +9, 11, 4313, 9, 12, 3023, 10, 11, 53975, 10, 12, 4225, // 10,11 +9, 12, 5073, 9, 13, 3522, 10, 12, 52069, 10, 13, 4872, // 10,12 +9, 13, 5848, 9, 14, 4019, 10, 13, 50171, 10, 14, 5498, // 10,13 +9, 14, 6620, 9, 15, 4502, 10, 14, 48322, 10, 15, 6092, // 10,14 +9, 15, 7383, 9, 16, 4967, 10, 15, 46541, 10, 16, 6645, // 10,15 +11, 0, 45791, 11, 1, 6986, 12, 0, 7587, 12, 1, 5172, // 11, 0 +11, 1, 47453, 11, 2, 6472, 12, 1, 6875, 12, 2, 4736, // 11, 1 +11, 2, 49147, 11, 3, 5930, 12, 2, 6168, 12, 3, 4291, // 11, 2 +11, 3, 50843, 11, 4, 5373, 12, 3, 5474, 12, 4, 3846, // 11, 3 +11, 4, 52484, 11, 5, 4822, 12, 4, 4816, 12, 5, 3414, // 11, 4 +11, 5, 53975, 11, 6, 4313, 12, 5, 4226, 12, 6, 3022, // 11, 5 +11, 6, 55166, 11, 7, 3904, 12, 6, 3755, 12, 7, 2711, // 11, 6 +11, 7, 55870, 11, 8, 3672, 12, 7, 3469, 12, 8, 2525, // 11, 7 +10, 8, 3473, 10, 9, 2525, 11, 8, 55867, 11, 9, 3671, // 11, 8 +10, 9, 3759, 10, 10, 2711, 11, 9, 55164, 11, 10, 3902, // 11, 9 +10, 10, 4230, 10, 11, 3023, 11, 10, 53973, 11, 11, 4310, // 11,10 +10, 11, 4822, 10, 12, 3415, 11, 11, 52484, 11, 12, 4815, // 11,11 +10, 12, 5481, 10, 13, 3845, 11, 12, 50844, 11, 13, 5366, // 11,12 +10, 13, 6176, 10, 14, 4290, 11, 13, 49150, 11, 14, 5920, // 11,13 +10, 14, 6886, 10, 15, 4734, 11, 14, 47458, 11, 15, 6458, // 11,14 +10, 15, 7599, 10, 16, 5169, 11, 15, 45799, 11, 16, 6969, // 11,15 +12, 0, 44901, 12, 1, 7374, 13, 0, 7848, 13, 1, 5413, // 12, 0 +12, 1, 46427, 12, 2, 6908, 13, 1, 7191, 13, 2, 5010, // 12, 1 +12, 2, 47953, 12, 3, 6426, 13, 2, 6549, 13, 3, 4608, // 12, 2 +12, 3, 49445, 12, 4, 5943, 13, 3, 5934, 13, 4, 4214, // 12, 3 +12, 4, 50844, 12, 5, 5481, 13, 4, 5365, 13, 5, 3846, // 12, 4 +12, 5, 52069, 12, 6, 5073, 13, 5, 4872, 13, 6, 3522, // 12, 5 +12, 6, 53012, 12, 7, 4762, 13, 6, 4489, 13, 7, 3273, // 12, 6 +12, 7, 53562, 12, 8, 4594, 13, 7, 4254, 13, 8, 3126, // 12, 7 +11, 8, 4259, 11, 9, 3128, 12, 8, 53557, 12, 9, 4592, // 12, 8 +11, 9, 4495, 11, 10, 3274, 12, 9, 53008, 12, 10, 4759, // 12, 9 +11, 10, 4879, 11, 11, 3523, 12, 10, 52066, 12, 11, 5068, // 12,10 +11, 11, 5373, 11, 12, 3846, 12, 11, 50843, 12, 12, 5474, // 12,11 +11, 12, 5943, 11, 13, 4214, 12, 12, 49445, 12, 13, 5934, // 12,12 +11, 13, 6560, 11, 14, 4607, 12, 13, 47955, 12, 14, 6414, // 12,13 +11, 14, 7204, 11, 15, 5009, 12, 14, 46430, 12, 15, 6893, // 12,14 +11, 15, 7863, 11, 16, 5410, 12, 15, 44907, 12, 16, 7356, // 12,15 +13, 0, 43900, 13, 1, 7812, 14, 0, 8141, 14, 1, 5683, // 13, 0 +13, 1, 45286, 13, 2, 7395, 14, 1, 7539, 14, 2, 5316, // 13, 1 +13, 2, 46650, 13, 3, 6973, 14, 2, 6959, 14, 3, 4954, // 13, 2 +13, 3, 47955, 13, 4, 6560, 14, 3, 6414, 14, 4, 4607, // 13, 3 +13, 4, 49150, 13, 5, 6176, 14, 4, 5920, 14, 5, 4290, // 13, 4 +13, 5, 50171, 13, 6, 5848, 14, 5, 5499, 14, 6, 4018, // 13, 5 +13, 6, 50942, 13, 7, 5606, 14, 6, 5175, 14, 7, 3813, // 13, 6 +13, 7, 51395, 13, 8, 5480, 14, 7, 4970, 14, 8, 3691, // 13, 7 +12, 8, 4978, 12, 9, 3693, 13, 8, 51387, 13, 9, 5478, // 13, 8 +12, 9, 5184, 12, 10, 3815, 13, 9, 50935, 13, 10, 5602, // 13, 9 +12, 10, 5508, 12, 11, 4020, 13, 10, 50165, 13, 11, 5843, // 13,10 +12, 11, 5930, 12, 12, 4291, 13, 11, 49147, 13, 12, 6168, // 13,11 +12, 12, 6426, 12, 13, 4608, 13, 12, 47953, 13, 13, 6549, // 13,12 +12, 13, 6973, 12, 14, 4954, 13, 13, 46650, 13, 14, 6959, // 13,13 +12, 14, 7555, 12, 15, 5315, 13, 14, 45288, 13, 15, 7378, // 13,14 +12, 15, 8159, 12, 16, 5682, 13, 15, 43904, 13, 16, 7791, // 13,15 +14, 0, 42821, 14, 1, 8288, 15, 0, 8452, 15, 1, 5975, // 14, 0 +14, 1, 44074, 14, 2, 7921, 15, 1, 7901, 15, 2, 5640, // 14, 1 +14, 2, 45288, 14, 3, 7555, 15, 2, 7378, 15, 3, 5315, // 14, 2 +14, 3, 46430, 14, 4, 7204, 15, 3, 6892, 15, 4, 5010, // 14, 3 +14, 4, 47458, 14, 5, 6886, 15, 4, 6458, 15, 5, 4734, // 14, 4 +14, 5, 48322, 14, 6, 6620, 15, 5, 6092, 15, 6, 4502, // 14, 5 +14, 6, 48969, 14, 7, 6430, 15, 6, 5809, 15, 7, 4328, // 14, 6 +14, 7, 49358, 14, 8, 6335, 15, 7, 5623, 15, 8, 4220, // 14, 7 +13, 8, 5633, 13, 9, 4224, 14, 8, 49347, 14, 9, 6332, // 14, 8 +13, 9, 5820, 13, 10, 4330, 14, 9, 48960, 14, 10, 6426, // 14, 9 +13, 10, 6104, 13, 11, 4505, 14, 10, 48314, 14, 11, 6613, // 14,10 +13, 11, 6472, 13, 12, 4736, 14, 11, 47453, 14, 12, 6875, // 14,11 +13, 12, 6908, 13, 13, 5011, 14, 12, 46427, 14, 13, 7190, // 14,12 +13, 13, 7395, 13, 14, 5316, 14, 13, 45286, 14, 14, 7539, // 14,13 +13, 14, 7921, 13, 15, 5640, 14, 14, 44074, 14, 15, 7901, // 14,14 +13, 15, 8474, 13, 16, 5974, 14, 15, 42823, 14, 16, 8265, // 14,15 +15, 0, 41693, 15, 1, 8795, 16, 0, 8769, 16, 1, 6279, // 15, 0 +15, 1, 42823, 15, 2, 8474, 16, 1, 8265, 16, 2, 5974, // 15, 1 +15, 2, 43904, 15, 3, 8159, 16, 2, 7791, 16, 3, 5682, // 15, 2 +15, 3, 44907, 15, 4, 7863, 16, 3, 7356, 16, 4, 5410, // 15, 3 +15, 4, 45799, 15, 5, 7599, 16, 4, 6970, 16, 5, 5168, // 15, 4 +15, 5, 46541, 15, 6, 7383, 16, 5, 6644, 16, 6, 4968, // 15, 5 +15, 6, 47098, 15, 7, 7233, 16, 6, 6391, 16, 7, 4814, // 15, 6 +15, 7, 47440, 15, 8, 7161, 16, 7, 6217, 16, 8, 4718, // 15, 7 +14, 8, 6230, 14, 9, 4722, 15, 8, 47426, 15, 9, 7158, // 15, 8 +14, 9, 6405, 14, 10, 4818, 15, 9, 47086, 15, 10, 7227, // 15, 9 +14, 10, 6659, 14, 11, 4971, 15, 10, 46532, 15, 11, 7374, // 15,10 +14, 11, 6986, 14, 12, 5172, 15, 11, 45791, 15, 12, 7587, // 15,11 +14, 12, 7374, 14, 13, 5413, 15, 12, 44901, 15, 13, 7848, // 15,12 +14, 13, 7812, 14, 14, 5684, 15, 13, 43900, 15, 14, 8140, // 15,13 +14, 14, 8288, 14, 15, 5975, 15, 14, 42821, 15, 15, 8452, // 15,14 +14, 15, 8795, 14, 16, 6280, 15, 15, 41693, 15, 16, 8768, // 15,15 +// angle of 1.5 degrees +0, -1, 11440, 0, 0, 34212, 1, -1, 8358, 1, 0, 11526, // 0, 0 +0, 0, 11192, 0, 1, 35502, 1, 0, 7987, 1, 1, 10855, // 0, 1 +0, 1, 10930, 0, 2, 36756, 1, 1, 7626, 1, 2, 10224, // 0, 2 +0, 2, 10670, 0, 3, 37939, 1, 2, 7285, 1, 3, 9642, // 0, 3 +0, 3, 10430, 0, 4, 39009, 1, 3, 6975, 1, 4, 9122, // 0, 4 +0, 4, 10232, 0, 5, 39918, 1, 4, 6710, 1, 5, 8676, // 0, 5 +0, 5, 10100, 0, 6, 40618, 1, 5, 6502, 1, 6, 8316, // 0, 6 +0, 6, 10052, 0, 7, 41072, 1, 6, 6360, 1, 7, 8052, // 0, 7 +-1, 7, 6346, -1, 8, 8018, 0, 7, 10066, 0, 8, 41106, // 0, 8 +-1, 8, 6489, -1, 9, 8278, 0, 8, 10123, 0, 9, 40646, // 0, 9 +-1, 9, 6699, -1, 10, 8632, 0, 9, 10265, 0, 10, 39940, // 0,10 +-1, 10, 6965, -1, 11, 9072, 0, 10, 10473, 0, 11, 39026, // 0,11 +-1, 11, 7276, -1, 12, 9585, 0, 11, 10723, 0, 12, 37952, // 0,12 +-1, 12, 7620, -1, 13, 10158, 0, 12, 10994, 0, 13, 36764, // 0,13 +-1, 13, 7983, -1, 14, 10780, 0, 13, 11267, 0, 14, 35506, // 0,14 +-1, 14, 8358, -1, 15, 11440, 0, 14, 11526, 0, 15, 34212, // 0,15 +1, -1, 10780, 1, 0, 35506, 2, -1, 7983, 2, 0, 11267, // 1, 0 +1, 0, 10467, 1, 1, 36959, 2, 0, 7579, 2, 1, 10531, // 1, 1 +1, 1, 10133, 1, 2, 38390, 2, 1, 7179, 2, 2, 9834, // 1, 2 +1, 2, 9796, 1, 3, 39759, 2, 2, 6797, 2, 3, 9184, // 1, 3 +1, 3, 9478, 1, 4, 41013, 2, 3, 6447, 2, 4, 8598, // 1, 4 +1, 4, 9206, 1, 5, 42087, 2, 4, 6145, 2, 5, 8098, // 1, 5 +1, 5, 9014, 1, 6, 42913, 2, 5, 5910, 2, 6, 7699, // 1, 6 +1, 6, 8929, 1, 7, 43433, 2, 6, 5756, 2, 7, 7418, // 1, 7 +0, 7, 5745, 0, 8, 7390, 1, 7, 8939, 1, 8, 43462, // 1, 8 +0, 8, 5900, 0, 9, 7667, 1, 8, 9032, 1, 9, 42937, // 1, 9 +0, 9, 6137, 0, 10, 8061, 1, 9, 9233, 1, 10, 42105, // 1,10 +0, 10, 6440, 0, 11, 8557, 1, 10, 9513, 1, 11, 41026, // 1,11 +0, 11, 6792, 0, 12, 9135, 1, 11, 9841, 1, 12, 39768, // 1,12 +0, 12, 7177, 0, 13, 9777, 1, 12, 10188, 1, 13, 38394, // 1,13 +0, 13, 7579, 0, 14, 10467, 1, 13, 10532, 1, 14, 36958, // 1,14 +0, 14, 7987, 0, 15, 11192, 1, 14, 10855, 1, 15, 35502, // 1,15 +2, -1, 10158, 2, 0, 36764, 3, -1, 7620, 3, 0, 10994, // 2, 0 +2, 0, 9777, 2, 1, 38394, 3, 0, 7177, 3, 1, 10188, // 2, 1 +2, 1, 9366, 2, 2, 40025, 3, 1, 6732, 3, 2, 9413, // 2, 2 +2, 2, 8941, 2, 3, 41614, 3, 2, 6299, 3, 3, 8682, // 2, 3 +2, 3, 8530, 2, 4, 43096, 3, 3, 5895, 3, 4, 8015, // 2, 4 +2, 4, 8167, 2, 5, 44386, 3, 4, 5543, 3, 5, 7440, // 2, 5 +2, 5, 7899, 2, 6, 45383, 3, 5, 5268, 3, 6, 6986, // 2, 6 +2, 6, 7766, 2, 7, 45995, 3, 6, 5095, 3, 7, 6680, // 2, 7 +1, 7, 5087, 1, 8, 6658, 2, 7, 7773, 2, 8, 46018, // 2, 8 +1, 8, 5261, 1, 9, 6961, 2, 8, 7913, 2, 9, 45401, // 2, 9 +1, 9, 5537, 1, 10, 7411, 2, 9, 8189, 2, 10, 44399, // 2,10 +1, 10, 5891, 1, 11, 7981, 2, 10, 8559, 2, 11, 43105, // 2,11 +1, 11, 6297, 1, 12, 8641, 2, 11, 8979, 2, 12, 41619, // 2,12 +1, 12, 6732, 1, 13, 9366, 2, 12, 9413, 2, 13, 40025, // 2,13 +1, 13, 7179, 1, 14, 10133, 2, 13, 9834, 2, 14, 38390, // 2,14 +1, 14, 7626, 1, 15, 10930, 2, 14, 10224, 2, 15, 36756, // 2,15 +3, -1, 9585, 3, 0, 37951, 4, -1, 7276, 4, 0, 10724, // 3, 0 +3, 0, 9135, 3, 1, 39767, 4, 0, 6792, 4, 1, 9842, // 3, 1 +3, 1, 8641, 3, 2, 41618, 4, 1, 6297, 4, 2, 8980, // 3, 2 +3, 2, 8120, 3, 3, 43461, 4, 2, 5804, 4, 3, 8151, // 3, 3 +3, 3, 7598, 3, 4, 45224, 4, 3, 5331, 4, 4, 7383, // 3, 4 +3, 4, 7121, 3, 5, 46798, 4, 4, 4909, 4, 5, 6708, // 3, 5 +3, 5, 6750, 3, 6, 48037, 4, 5, 4576, 4, 6, 6173, // 3, 6 +3, 6, 6552, 3, 7, 48785, 4, 6, 4372, 4, 7, 5827, // 3, 7 +2, 7, 4366, 2, 8, 5811, 3, 7, 6558, 3, 8, 48801, // 3, 8 +2, 8, 4572, 2, 9, 6154, 3, 8, 6761, 3, 9, 48049, // 3, 9 +2, 9, 4906, 2, 10, 6685, 3, 9, 7138, 3, 10, 46807, // 3,10 +2, 10, 5330, 2, 11, 7356, 3, 10, 7622, 3, 11, 45228, // 3,11 +2, 11, 5804, 2, 12, 8120, 3, 11, 8151, 3, 12, 43461, // 3,12 +2, 12, 6299, 2, 13, 8941, 3, 12, 8681, 3, 13, 41615, // 3,13 +2, 13, 6797, 2, 14, 9796, 3, 13, 9184, 3, 14, 39759, // 3,14 +2, 14, 7285, 2, 15, 10670, 3, 14, 9642, 3, 15, 37939, // 3,15 +4, -1, 9072, 4, 0, 39026, 5, -1, 6965, 5, 0, 10473, // 4, 0 +4, 0, 8557, 4, 1, 41026, 5, 0, 6440, 5, 1, 9513, // 4, 1 +4, 1, 7981, 4, 2, 43105, 5, 1, 5891, 5, 2, 8559, // 4, 2 +4, 2, 7356, 4, 3, 45229, 5, 2, 5330, 5, 3, 7621, // 4, 3 +4, 3, 6708, 4, 4, 47328, 5, 3, 4774, 5, 4, 6726, // 4, 4 +4, 4, 6086, 4, 5, 49275, 5, 4, 4258, 5, 5, 5917, // 4, 5 +4, 5, 5573, 4, 6, 50865, 5, 5, 3837, 5, 6, 5261, // 4, 6 +4, 6, 5280, 4, 7, 51832, 5, 6, 3579, 5, 7, 4845, // 4, 7 +3, 7, 3575, 3, 8, 4835, 4, 7, 5283, 4, 8, 51843, // 4, 8 +3, 8, 3834, 3, 9, 5248, 4, 8, 5581, 4, 9, 50873, // 4, 9 +3, 9, 4257, 3, 10, 5901, 4, 9, 6099, 4, 10, 49279, // 4,10 +3, 10, 4774, 3, 11, 6708, 4, 10, 6727, 4, 11, 47327, // 4,11 +3, 11, 5331, 3, 12, 7598, 4, 11, 7382, 4, 12, 45225, // 4,12 +3, 12, 5895, 3, 13, 8530, 4, 12, 8015, 4, 13, 43096, // 4,13 +3, 13, 6447, 3, 14, 9478, 4, 13, 8599, 4, 14, 41012, // 4,14 +3, 14, 6975, 3, 15, 10430, 4, 14, 9122, 4, 15, 39009, // 4,15 +5, -1, 8632, 5, 0, 39940, 6, -1, 6699, 6, 0, 10265, // 5, 0 +5, 0, 8061, 5, 1, 42105, 6, 0, 6137, 6, 1, 9233, // 5, 1 +5, 1, 7411, 5, 2, 44399, 6, 1, 5537, 6, 2, 8189, // 5, 2 +5, 2, 6685, 5, 3, 46806, 6, 2, 4906, 6, 3, 7139, // 5, 3 +5, 3, 5901, 5, 4, 49279, 6, 3, 4257, 6, 4, 6099, // 5, 4 +5, 4, 5103, 5, 5, 51700, 6, 4, 3621, 6, 5, 5112, // 5, 5 +5, 5, 4388, 5, 6, 53813, 6, 5, 3065, 6, 6, 4270, // 5, 6 +5, 6, 3938, 5, 7, 55162, 6, 6, 2710, 6, 7, 3726, // 5, 7 +4, 7, 2708, 4, 8, 3720, 5, 7, 3940, 5, 8, 55168, // 5, 8 +4, 8, 3064, 4, 9, 4262, 5, 8, 4394, 5, 9, 53816, // 5, 9 +4, 9, 3621, 4, 10, 5103, 5, 9, 5113, 5, 10, 51699, // 5,10 +4, 10, 4258, 4, 11, 6086, 5, 10, 5917, 5, 11, 49275, // 5,11 +4, 11, 4909, 4, 12, 7121, 5, 11, 6707, 5, 12, 46799, // 5,12 +4, 12, 5543, 4, 13, 8167, 5, 12, 7440, 5, 13, 44386, // 5,13 +4, 13, 6145, 4, 14, 9206, 5, 13, 8098, 5, 14, 42087, // 5,14 +4, 14, 6710, 4, 15, 10232, 5, 14, 8676, 5, 15, 39918, // 5,15 +6, -1, 8278, 6, 0, 40646, 7, -1, 6489, 7, 0, 10123, // 6, 0 +6, 0, 7667, 6, 1, 42936, 7, 0, 5900, 7, 1, 9033, // 6, 1 +6, 1, 6961, 6, 2, 45401, 7, 1, 5261, 7, 2, 7913, // 6, 2 +6, 2, 6154, 6, 3, 48049, 7, 2, 4572, 7, 3, 6761, // 6, 3 +6, 3, 5248, 6, 4, 50873, 7, 3, 3834, 7, 4, 5581, // 6, 4 +6, 4, 4262, 6, 5, 53816, 7, 4, 3064, 7, 5, 4394, // 6, 5 +6, 5, 3271, 6, 6, 56673, 7, 5, 2316, 7, 6, 3276, // 6, 6 +6, 6, 2532, 6, 7, 58773, 7, 6, 1767, 7, 7, 2464, // 6, 7 +5, 7, 1766, 5, 8, 2462, 6, 7, 2533, 6, 8, 58775, // 6, 8 +5, 8, 2316, 5, 9, 3271, 6, 8, 3275, 6, 9, 56674, // 6, 9 +5, 9, 3065, 5, 10, 4388, 6, 9, 4269, 6, 10, 53814, // 6,10 +5, 10, 3837, 5, 11, 5573, 6, 10, 5261, 6, 11, 50865, // 6,11 +5, 11, 4576, 5, 12, 6750, 6, 11, 6173, 6, 12, 48037, // 6,12 +5, 12, 5268, 5, 13, 7899, 6, 12, 6986, 6, 13, 45383, // 6,13 +5, 13, 5910, 5, 14, 9014, 6, 13, 7699, 6, 14, 42913, // 6,14 +5, 14, 6502, 5, 15, 10100, 6, 14, 8316, 6, 15, 40618, // 6,15 +7, -1, 8018, 7, 0, 41106, 8, -1, 6346, 8, 0, 10066, // 7, 0 +7, 0, 7390, 7, 1, 43461, 8, 0, 5745, 8, 1, 8940, // 7, 1 +7, 1, 6658, 7, 2, 46017, 8, 1, 5087, 8, 2, 7774, // 7, 2 +7, 2, 5811, 7, 3, 48801, 8, 2, 4366, 8, 3, 6558, // 7, 3 +7, 3, 4835, 7, 4, 51842, 8, 3, 3575, 8, 4, 5284, // 7, 4 +7, 4, 3720, 7, 5, 55168, 8, 4, 2708, 8, 5, 3940, // 7, 5 +7, 5, 2462, 7, 6, 58775, 8, 5, 1766, 8, 6, 2533, // 7, 6 +7, 6, 1170, 7, 7, 62369, 8, 6, 827, 8, 7, 1170, // 7, 7 +6, 7, 827, 6, 8, 1170, 7, 7, 1170, 7, 8, 62369, // 7, 8 +6, 8, 1767, 6, 9, 2532, 7, 8, 2464, 7, 9, 58773, // 7, 9 +6, 9, 2710, 6, 10, 3938, 7, 9, 3726, 7, 10, 55162, // 7,10 +6, 10, 3579, 6, 11, 5280, 7, 10, 4846, 7, 11, 51831, // 7,11 +6, 11, 4372, 6, 12, 6552, 7, 11, 5827, 7, 12, 48785, // 7,12 +6, 12, 5095, 6, 13, 7766, 7, 12, 6680, 7, 13, 45995, // 7,13 +6, 13, 5756, 6, 14, 8929, 7, 13, 7418, 7, 14, 43433, // 7,14 +6, 14, 6360, 6, 15, 10052, 7, 14, 8052, 7, 15, 41072, // 7,15 +8, 0, 41072, 8, 1, 8052, 9, 0, 10052, 9, 1, 6360, // 8, 0 +8, 1, 43433, 8, 2, 7418, 9, 1, 8929, 9, 2, 5756, // 8, 1 +8, 2, 45995, 8, 3, 6680, 9, 2, 7766, 9, 3, 5095, // 8, 2 +8, 3, 48785, 8, 4, 5827, 9, 3, 6552, 9, 4, 4372, // 8, 3 +8, 4, 51832, 8, 5, 4846, 9, 4, 5280, 9, 5, 3578, // 8, 4 +8, 5, 55162, 8, 6, 3726, 9, 5, 3938, 9, 6, 2710, // 8, 5 +8, 6, 58773, 8, 7, 2464, 9, 6, 2532, 9, 7, 1767, // 8, 6 +8, 7, 62369, 8, 8, 1170, 9, 7, 1170, 9, 8, 827, // 8, 7 +7, 8, 1170, 7, 9, 827, 8, 8, 62369, 8, 9, 1170, // 8, 8 +7, 9, 2533, 7, 10, 1766, 8, 9, 58775, 8, 10, 2462, // 8, 9 +7, 10, 3940, 7, 11, 2708, 8, 10, 55168, 8, 11, 3720, // 8,10 +7, 11, 5283, 7, 12, 3575, 8, 11, 51842, 8, 12, 4836, // 8,11 +7, 12, 6558, 7, 13, 4366, 8, 12, 48801, 8, 13, 5811, // 8,12 +7, 13, 7773, 7, 14, 5087, 8, 13, 46017, 8, 14, 6659, // 8,13 +7, 14, 8939, 7, 15, 5745, 8, 14, 43461, 8, 15, 7391, // 8,14 +7, 15, 10066, 7, 16, 6346, 8, 15, 41106, 8, 16, 8018, // 8,15 +9, 0, 40618, 9, 1, 8316, 10, 0, 10100, 10, 1, 6502, // 9, 0 +9, 1, 42913, 9, 2, 7699, 10, 1, 9014, 10, 2, 5910, // 9, 1 +9, 2, 45383, 9, 3, 6986, 10, 2, 7899, 10, 3, 5268, // 9, 2 +9, 3, 48037, 9, 4, 6173, 10, 3, 6750, 10, 4, 4576, // 9, 3 +9, 4, 50865, 9, 5, 5261, 10, 4, 5573, 10, 5, 3837, // 9, 4 +9, 5, 53813, 9, 6, 4269, 10, 5, 4388, 10, 6, 3066, // 9, 5 +9, 6, 56673, 9, 7, 3275, 10, 6, 3271, 10, 7, 2317, // 9, 6 +9, 7, 58775, 9, 8, 2533, 10, 7, 2462, 10, 8, 1766, // 9, 7 +8, 8, 2464, 8, 9, 1767, 9, 8, 58773, 9, 9, 2532, // 9, 8 +8, 9, 3275, 8, 10, 2316, 9, 9, 56673, 9, 10, 3272, // 9, 9 +8, 10, 4394, 8, 11, 3064, 9, 10, 53816, 9, 11, 4262, // 9,10 +8, 11, 5581, 8, 12, 3834, 9, 11, 50873, 9, 12, 5248, // 9,11 +8, 12, 6761, 8, 13, 4572, 9, 12, 48049, 9, 13, 6154, // 9,12 +8, 13, 7913, 8, 14, 5261, 9, 13, 45401, 9, 14, 6961, // 9,13 +8, 14, 9032, 8, 15, 5900, 9, 14, 42936, 9, 15, 7668, // 9,14 +8, 15, 10123, 8, 16, 6489, 9, 15, 40646, 9, 16, 8278, // 9,15 +10, 0, 39918, 10, 1, 8676, 11, 0, 10232, 11, 1, 6710, // 10, 0 +10, 1, 42087, 10, 2, 8098, 11, 1, 9206, 11, 2, 6145, // 10, 1 +10, 2, 44386, 10, 3, 7440, 11, 2, 8167, 11, 3, 5543, // 10, 2 +10, 3, 46798, 10, 4, 6707, 11, 3, 7121, 11, 4, 4910, // 10, 3 +10, 4, 49275, 10, 5, 5917, 11, 4, 6086, 11, 5, 4258, // 10, 4 +10, 5, 51700, 10, 6, 5113, 11, 5, 5103, 11, 6, 3620, // 10, 5 +10, 6, 53816, 10, 7, 4394, 11, 6, 4262, 11, 7, 3064, // 10, 6 +10, 7, 55168, 10, 8, 3940, 11, 7, 3720, 11, 8, 2708, // 10, 7 +9, 8, 3726, 9, 9, 2710, 10, 8, 55162, 10, 9, 3938, // 10, 8 +9, 9, 4269, 9, 10, 3065, 10, 9, 53813, 10, 10, 4389, // 10, 9 +9, 10, 5113, 9, 11, 3621, 10, 10, 51700, 10, 11, 5102, // 10,10 +9, 11, 6099, 9, 12, 4257, 10, 11, 49279, 10, 12, 5901, // 10,11 +9, 12, 7138, 9, 13, 4906, 10, 12, 46806, 10, 13, 6686, // 10,12 +9, 13, 8189, 9, 14, 5537, 10, 13, 44399, 10, 14, 7411, // 10,13 +9, 14, 9233, 9, 15, 6137, 10, 14, 42105, 10, 15, 8061, // 10,14 +9, 15, 10265, 9, 16, 6699, 10, 15, 39940, 10, 16, 8632, // 10,15 +11, 0, 39009, 11, 1, 9122, 12, 0, 10430, 12, 1, 6975, // 11, 0 +11, 1, 41013, 11, 2, 8599, 12, 1, 9478, 12, 2, 6446, // 11, 1 +11, 2, 43096, 11, 3, 8015, 12, 2, 8530, 12, 3, 5895, // 11, 2 +11, 3, 45224, 11, 4, 7382, 12, 3, 7598, 12, 4, 5332, // 11, 3 +11, 4, 47328, 11, 5, 6727, 12, 4, 6708, 12, 5, 4773, // 11, 4 +11, 5, 49279, 11, 6, 6099, 12, 5, 5901, 12, 6, 4257, // 11, 5 +11, 6, 50873, 11, 7, 5581, 12, 6, 5248, 12, 7, 3834, // 11, 6 +11, 7, 51842, 11, 8, 5283, 12, 7, 4835, 12, 8, 3576, // 11, 7 +10, 8, 4846, 10, 9, 3579, 11, 8, 51832, 11, 9, 5279, // 11, 8 +10, 9, 5261, 10, 10, 3837, 11, 9, 50865, 11, 10, 5573, // 11, 9 +10, 10, 5917, 10, 11, 4258, 11, 10, 49275, 11, 11, 6086, // 11,10 +10, 11, 6727, 10, 12, 4774, 11, 11, 47328, 11, 12, 6707, // 11,11 +10, 12, 7622, 10, 13, 5330, 11, 12, 45229, 11, 13, 7355, // 11,12 +10, 13, 8559, 10, 14, 5891, 11, 13, 43105, 11, 14, 7981, // 11,13 +10, 14, 9513, 10, 15, 6440, 11, 14, 41026, 11, 15, 8557, // 11,14 +10, 15, 10473, 10, 16, 6965, 11, 15, 39026, 11, 16, 9072, // 11,15 +12, 0, 37939, 12, 1, 9642, 13, 0, 10670, 13, 1, 7285, // 12, 0 +12, 1, 39759, 12, 2, 9184, 13, 1, 9796, 13, 2, 6797, // 12, 1 +12, 2, 41614, 12, 3, 8681, 13, 2, 8941, 13, 3, 6300, // 12, 2 +12, 3, 43461, 12, 4, 8151, 13, 3, 8120, 13, 4, 5804, // 12, 3 +12, 4, 45229, 12, 5, 7622, 13, 4, 7356, 13, 5, 5329, // 12, 4 +12, 5, 46806, 12, 6, 7138, 13, 5, 6685, 13, 6, 4907, // 12, 5 +12, 6, 48049, 12, 7, 6761, 13, 6, 6154, 13, 7, 4572, // 12, 6 +12, 7, 48801, 12, 8, 6558, 13, 7, 5811, 13, 8, 4366, // 12, 7 +11, 8, 5827, 11, 9, 4372, 12, 8, 48785, 12, 9, 6552, // 12, 8 +11, 9, 6173, 11, 10, 4576, 12, 9, 48037, 12, 10, 6750, // 12, 9 +11, 10, 6707, 11, 11, 4909, 12, 10, 46798, 12, 11, 7122, // 12,10 +11, 11, 7382, 11, 12, 5331, 12, 11, 45224, 12, 12, 7599, // 12,11 +11, 12, 8151, 11, 13, 5804, 12, 12, 43461, 12, 13, 8120, // 12,12 +11, 13, 8979, 11, 14, 6297, 12, 13, 41618, 12, 14, 8642, // 12,13 +11, 14, 9841, 11, 15, 6792, 12, 14, 39767, 12, 15, 9136, // 12,14 +11, 15, 10723, 11, 16, 7276, 12, 15, 37951, 12, 16, 9586, // 12,15 +13, 0, 36756, 13, 1, 10224, 14, 0, 10930, 14, 1, 7626, // 13, 0 +13, 1, 38390, 13, 2, 9834, 14, 1, 10133, 14, 2, 7179, // 13, 1 +13, 2, 40025, 13, 3, 9413, 14, 2, 9366, 14, 3, 6732, // 13, 2 +13, 3, 41618, 13, 4, 8979, 14, 3, 8641, 14, 4, 6298, // 13, 3 +13, 4, 43105, 13, 5, 8559, 14, 4, 7981, 14, 5, 5891, // 13, 4 +13, 5, 44399, 13, 6, 8189, 14, 5, 7411, 14, 6, 5537, // 13, 5 +13, 6, 45401, 13, 7, 7913, 14, 6, 6961, 14, 7, 5261, // 13, 6 +13, 7, 46017, 13, 8, 7773, 14, 7, 6658, 14, 8, 5088, // 13, 7 +12, 8, 6680, 12, 9, 5095, 13, 8, 45995, 13, 9, 7766, // 13, 8 +12, 9, 6986, 12, 10, 5268, 13, 9, 45383, 13, 10, 7899, // 13, 9 +12, 10, 7440, 12, 11, 5543, 13, 10, 44386, 13, 11, 8167, // 13,10 +12, 11, 8015, 12, 12, 5895, 13, 11, 43096, 13, 12, 8530, // 13,11 +12, 12, 8681, 12, 13, 6299, 13, 12, 41614, 13, 13, 8942, // 13,12 +12, 13, 9413, 12, 14, 6732, 13, 13, 40025, 13, 14, 9366, // 13,13 +12, 14, 10188, 12, 15, 7177, 13, 14, 38394, 13, 15, 9777, // 13,14 +12, 15, 10994, 12, 16, 7620, 13, 15, 36764, 13, 16, 10158, // 13,15 +14, 0, 35502, 14, 1, 10855, 15, 0, 11192, 15, 1, 7987, // 14, 0 +14, 1, 36959, 14, 2, 10532, 15, 1, 10467, 15, 2, 7578, // 14, 1 +14, 2, 38394, 14, 3, 10188, 15, 2, 9777, 15, 3, 7177, // 14, 2 +14, 3, 39767, 14, 4, 9841, 15, 3, 9135, 15, 4, 6793, // 14, 3 +14, 4, 41026, 14, 5, 9513, 15, 4, 8557, 15, 5, 6440, // 14, 4 +14, 5, 42105, 14, 6, 9233, 15, 5, 8061, 15, 6, 6137, // 14, 5 +14, 6, 42936, 14, 7, 9032, 15, 6, 7667, 15, 7, 5901, // 14, 6 +14, 7, 43461, 14, 8, 8939, 15, 7, 7390, 15, 8, 5746, // 14, 7 +13, 8, 7418, 13, 9, 5756, 14, 8, 43433, 14, 9, 8929, // 14, 8 +13, 9, 7699, 13, 10, 5910, 14, 9, 42913, 14, 10, 9014, // 14, 9 +13, 10, 8098, 13, 11, 6145, 14, 10, 42087, 14, 11, 9206, // 14,10 +13, 11, 8599, 13, 12, 6447, 14, 11, 41013, 14, 12, 9477, // 14,11 +13, 12, 9184, 13, 13, 6797, 14, 12, 39759, 14, 13, 9796, // 14,12 +13, 13, 9834, 13, 14, 7179, 14, 13, 38390, 14, 14, 10133, // 14,13 +13, 14, 10532, 13, 15, 7579, 14, 14, 36959, 14, 15, 10466, // 14,14 +13, 15, 11267, 13, 16, 7983, 14, 15, 35506, 14, 16, 10780, // 14,15 +15, 0, 34212, 15, 1, 11526, 16, 0, 11440, 16, 1, 8358, // 15, 0 +15, 1, 35506, 15, 2, 11267, 16, 1, 10780, 16, 2, 7983, // 15, 1 +15, 2, 36764, 15, 3, 10994, 16, 2, 10158, 16, 3, 7620, // 15, 2 +15, 3, 37951, 15, 4, 10723, 16, 3, 9585, 16, 4, 7277, // 15, 3 +15, 4, 39026, 15, 5, 10473, 16, 4, 9072, 16, 5, 6965, // 15, 4 +15, 5, 39940, 15, 6, 10265, 16, 5, 8632, 16, 6, 6699, // 15, 5 +15, 6, 40646, 15, 7, 10123, 16, 6, 8278, 16, 7, 6489, // 15, 6 +15, 7, 41106, 15, 8, 10066, 16, 7, 8018, 16, 8, 6346, // 15, 7 +14, 8, 8052, 14, 9, 6360, 15, 8, 41072, 15, 9, 10052, // 15, 8 +14, 9, 8316, 14, 10, 6502, 15, 9, 40618, 15, 10, 10100, // 15, 9 +14, 10, 8676, 14, 11, 6710, 15, 10, 39918, 15, 11, 10232, // 15,10 +14, 11, 9122, 14, 12, 6975, 15, 11, 39009, 15, 12, 10430, // 15,11 +14, 12, 9642, 14, 13, 7285, 15, 12, 37939, 15, 13, 10670, // 15,12 +14, 13, 10224, 14, 14, 7626, 15, 13, 36756, 15, 14, 10930, // 15,13 +14, 14, 10855, 14, 15, 7987, 15, 14, 35502, 15, 15, 11192, // 15,14 +14, 15, 11526, 14, 16, 8358, 15, 15, 34212, 15, 16, 11440, // 15,15 +// angle of 2.0 degrees +0, -1, 13368, 0, 0, 28495, 1, -1, 10104, 1, 0, 13569, // 0, 0 +0, 0, 13291, 0, 1, 29828, 1, 0, 9671, 1, 1, 12746, // 0, 1 +0, 1, 13176, 0, 2, 31138, 1, 1, 9245, 1, 2, 11977, // 0, 2 +0, 2, 13038, 0, 3, 32391, 1, 2, 8838, 1, 3, 11269, // 0, 3 +0, 3, 12899, 0, 4, 33539, 1, 3, 8463, 1, 4, 10635, // 0, 4 +0, 4, 12783, 0, 5, 34532, 1, 4, 8135, 1, 5, 10086, // 0, 5 +0, 5, 12717, 0, 6, 35315, 1, 5, 7868, 1, 6, 9636, // 0, 6 +0, 6, 12728, 0, 7, 35844, 1, 6, 7674, 1, 7, 9290, // 0, 7 +-1, 7, 7643, -1, 8, 9224, 0, 7, 12764, 0, 8, 35905, // 0, 8 +-1, 8, 7839, -1, 9, 9558, 0, 8, 12777, 0, 9, 35362, // 0, 9 +-1, 9, 8107, -1, 10, 9995, 0, 9, 12867, 0, 10, 34567, // 0,10 +-1, 10, 8438, -1, 11, 10528, 0, 10, 13007, 0, 11, 33563, // 0,11 +-1, 11, 8816, -1, 12, 11143, 0, 11, 13171, 0, 12, 32406, // 0,12 +-1, 12, 9229, -1, 13, 11829, 0, 12, 13332, 0, 13, 31146, // 0,13 +-1, 13, 9662, -1, 14, 12574, 0, 13, 13470, 0, 14, 29830, // 0,14 +-1, 14, 10104, -1, 15, 13368, 0, 14, 13569, 0, 15, 28495, // 0,15 +1, -1, 12574, 1, 0, 29831, 2, -1, 9662, 2, 0, 13469, // 1, 0 +1, 0, 12412, 1, 1, 31358, 2, 0, 9202, 2, 1, 12564, // 1, 1 +1, 1, 12203, 1, 2, 32881, 2, 1, 8742, 2, 2, 11710, // 1, 2 +1, 2, 11964, 1, 3, 34358, 2, 2, 8296, 2, 3, 10918, // 1, 3 +1, 3, 11721, 1, 4, 35730, 2, 3, 7881, 2, 4, 10204, // 1, 4 +1, 4, 11507, 1, 5, 36926, 2, 4, 7517, 2, 5, 9586, // 1, 5 +1, 5, 11360, 1, 6, 37866, 2, 5, 7224, 2, 6, 9086, // 1, 6 +1, 6, 11317, 1, 7, 38481, 2, 6, 7020, 2, 7, 8718, // 1, 7 +0, 7, 6997, 0, 8, 8662, 1, 7, 11344, 1, 8, 38533, // 1, 8 +0, 8, 7202, 0, 9, 9020, 1, 8, 11407, 1, 9, 37907, // 1, 9 +0, 9, 7497, 0, 10, 9509, 1, 9, 11575, 1, 10, 36955, // 1,10 +0, 10, 7865, 0, 11, 10111, 1, 10, 11810, 1, 11, 35750, // 1,11 +0, 11, 8284, 0, 12, 10808, 1, 11, 12074, 1, 12, 34370, // 1,12 +0, 12, 8735, 0, 13, 11580, 1, 12, 12334, 1, 13, 32887, // 1,13 +0, 13, 9202, 0, 14, 12412, 1, 13, 12564, 1, 14, 31358, // 1,14 +0, 14, 9671, 0, 15, 13291, 1, 14, 12746, 1, 15, 29828, // 1,15 +2, -1, 11829, 2, 0, 31146, 3, -1, 9229, 3, 0, 13332, // 2, 0 +2, 0, 11580, 2, 1, 32886, 3, 0, 8735, 3, 1, 12335, // 2, 1 +2, 1, 11272, 2, 2, 34650, 3, 1, 8232, 3, 2, 11382, // 2, 2 +2, 2, 10922, 2, 3, 36392, 3, 2, 7734, 3, 3, 10488, // 2, 3 +2, 3, 10559, 2, 4, 38042, 3, 3, 7261, 3, 4, 9674, // 2, 4 +2, 4, 10226, 2, 5, 39503, 3, 4, 6842, 3, 5, 8965, // 2, 5 +2, 5, 9977, 2, 6, 40656, 3, 5, 6506, 3, 6, 8397, // 2, 6 +2, 6, 9867, 2, 7, 41389, 3, 6, 6284, 3, 7, 7996, // 2, 7 +1, 7, 6266, 1, 8, 7951, 2, 7, 9886, 2, 8, 41433, // 2, 8 +1, 8, 6491, 1, 9, 8344, 2, 8, 10013, 2, 9, 40688, // 2, 9 +1, 9, 6829, 1, 10, 8902, 2, 9, 10279, 2, 10, 39526, // 2,10 +1, 10, 7252, 1, 11, 9597, 2, 10, 10630, 2, 11, 38057, // 2,11 +1, 11, 7728, 1, 12, 10397, 2, 11, 11012, 2, 12, 36399, // 2,12 +1, 12, 8232, 1, 13, 11272, 2, 12, 11382, 2, 13, 34650, // 2,13 +1, 13, 8742, 1, 14, 12203, 2, 13, 11709, 2, 14, 32882, // 2,14 +1, 14, 9245, 1, 15, 13176, 2, 14, 11977, 2, 15, 31138, // 2,15 +3, -1, 11143, 3, 0, 32406, 4, -1, 8816, 4, 0, 13171, // 3, 0 +3, 0, 10808, 3, 1, 34369, 4, 0, 8284, 4, 1, 12075, // 3, 1 +3, 1, 10397, 3, 2, 36399, 4, 1, 7728, 4, 2, 11012, // 3, 2 +3, 2, 9924, 3, 3, 38450, 4, 2, 7164, 4, 3, 9998, // 3, 3 +3, 3, 9421, 3, 4, 40444, 4, 3, 6615, 4, 4, 9056, // 3, 4 +3, 4, 8940, 3, 5, 42256, 4, 4, 6116, 4, 5, 8224, // 3, 5 +3, 5, 8558, 3, 6, 43710, 4, 5, 5712, 4, 6, 7556, // 3, 6 +3, 6, 8359, 3, 7, 44616, 4, 6, 5454, 4, 7, 7107, // 3, 7 +2, 7, 5443, 2, 8, 7072, 3, 7, 8373, 3, 8, 44648, // 3, 8 +2, 8, 5703, 2, 9, 7516, 3, 8, 8584, 3, 9, 43733, // 3, 9 +2, 9, 6108, 2, 10, 8175, 3, 9, 8982, 3, 10, 42271, // 3,10 +2, 10, 6611, 2, 11, 8995, 3, 10, 9478, 3, 11, 40452, // 3,11 +2, 11, 7164, 2, 12, 9924, 3, 11, 9998, 3, 12, 38450, // 3,12 +2, 12, 7734, 2, 13, 10922, 3, 12, 10488, 3, 13, 36392, // 3,13 +2, 13, 8296, 2, 14, 11964, 3, 13, 10918, 3, 14, 34358, // 3,14 +2, 14, 8838, 2, 15, 13038, 3, 14, 11269, 3, 15, 32391, // 3,15 +4, -1, 10528, 4, 0, 33564, 5, -1, 8438, 5, 0, 13006, // 4, 0 +4, 0, 10111, 4, 1, 35750, 5, 0, 7865, 5, 1, 11810, // 4, 1 +4, 1, 9597, 4, 2, 38057, 5, 1, 7252, 5, 2, 10630, // 4, 2 +4, 2, 8995, 4, 3, 40452, 5, 2, 6611, 5, 3, 9478, // 4, 3 +4, 3, 8332, 4, 4, 42861, 5, 3, 5965, 5, 4, 8378, // 4, 4 +4, 4, 7667, 4, 5, 45139, 5, 4, 5353, 5, 5, 7377, // 4, 5 +4, 5, 7100, 4, 6, 47035, 5, 5, 4843, 5, 6, 6558, // 4, 6 +4, 6, 6774, 4, 7, 48218, 5, 6, 4521, 5, 7, 6023, // 4, 7 +3, 7, 4513, 3, 8, 6000, 4, 7, 6783, 4, 8, 48240, // 4, 8 +3, 8, 4838, 3, 9, 6530, 4, 8, 7119, 4, 9, 47049, // 4, 9 +3, 9, 5350, 3, 10, 7342, 4, 9, 7698, 4, 10, 45146, // 4,10 +3, 10, 5965, 3, 11, 8332, 4, 10, 8378, 4, 11, 42861, // 4,11 +3, 11, 6615, 3, 12, 9421, 4, 11, 9056, 4, 12, 40444, // 4,12 +3, 12, 7261, 3, 13, 10559, 4, 12, 9674, 4, 13, 38042, // 4,13 +3, 13, 7881, 3, 14, 11721, 4, 13, 10204, 4, 14, 35730, // 4,14 +3, 14, 8463, 3, 15, 12899, 4, 14, 10635, 4, 15, 33539, // 4,15 +5, -1, 9995, 5, 0, 34567, 6, -1, 8107, 6, 0, 12867, // 5, 0 +5, 0, 9509, 5, 1, 36955, 6, 0, 7497, 6, 1, 11575, // 5, 1 +5, 1, 8902, 5, 2, 39526, 6, 1, 6829, 6, 2, 10279, // 5, 2 +5, 2, 8175, 5, 3, 42271, 6, 2, 6108, 6, 3, 8982, // 5, 3 +5, 3, 7342, 5, 4, 45146, 6, 3, 5350, 6, 4, 7698, // 5, 4 +5, 4, 6451, 5, 5, 48019, 6, 4, 4591, 6, 5, 6475, // 5, 5 +5, 5, 5624, 5, 6, 50581, 6, 5, 3913, 6, 6, 5418, // 5, 6 +5, 6, 5092, 5, 7, 52253, 6, 6, 3470, 6, 7, 4721, // 5, 7 +4, 7, 3466, 4, 8, 4708, 5, 7, 5097, 5, 8, 52265, // 5, 8 +4, 8, 3911, 4, 9, 5400, 5, 8, 5637, 5, 9, 50588, // 5, 9 +4, 9, 4591, 4, 10, 6451, 5, 9, 6475, 5, 10, 48019, // 5,10 +4, 10, 5353, 4, 11, 7667, 5, 10, 7377, 5, 11, 45139, // 5,11 +4, 11, 6116, 4, 12, 8940, 5, 11, 8224, 5, 12, 42256, // 5,12 +4, 12, 6842, 4, 13, 10226, 5, 12, 8966, 5, 13, 39502, // 5,13 +4, 13, 7517, 4, 14, 11507, 5, 13, 9587, 5, 14, 36925, // 5,14 +4, 14, 8135, 4, 15, 12783, 5, 14, 10086, 5, 15, 34532, // 5,15 +6, -1, 9558, 6, 0, 35362, 7, -1, 7839, 7, 0, 12777, // 6, 0 +6, 0, 9020, 6, 1, 37906, 7, 0, 7202, 7, 1, 11408, // 6, 1 +6, 1, 8344, 6, 2, 40688, 7, 1, 6491, 7, 2, 10013, // 6, 2 +6, 2, 7516, 6, 3, 43733, 7, 2, 5703, 7, 3, 8584, // 6, 3 +6, 3, 6530, 6, 4, 47049, 7, 3, 4838, 7, 4, 7119, // 6, 4 +6, 4, 5400, 6, 5, 50587, 7, 4, 3911, 7, 5, 5638, // 6, 5 +6, 5, 4217, 6, 6, 54105, 7, 5, 2989, 7, 6, 4225, // 6, 6 +6, 6, 3303, 6, 7, 56751, 7, 6, 2295, 7, 7, 3187, // 6, 7 +5, 7, 2294, 5, 8, 3180, 6, 7, 3306, 6, 8, 56756, // 6, 8 +5, 8, 2989, 5, 9, 4217, 6, 8, 4225, 6, 9, 54105, // 6, 9 +5, 9, 3913, 5, 10, 5624, 6, 9, 5418, 6, 10, 50581, // 6,10 +5, 10, 4843, 5, 11, 7100, 6, 10, 6558, 6, 11, 47035, // 6,11 +5, 11, 5712, 5, 12, 8558, 6, 11, 7556, 6, 12, 43710, // 6,12 +5, 12, 6506, 5, 13, 9977, 6, 12, 8397, 6, 13, 40656, // 6,13 +5, 13, 7224, 5, 14, 11360, 6, 13, 9086, 6, 14, 37866, // 6,14 +5, 14, 7868, 5, 15, 12717, 6, 14, 9635, 6, 15, 35316, // 6,15 +7, -1, 9224, 7, 0, 35905, 8, -1, 7643, 8, 0, 12764, // 7, 0 +7, 0, 8662, 7, 1, 38534, 8, 0, 6997, 8, 1, 11343, // 7, 1 +7, 1, 7951, 7, 2, 41432, 8, 1, 6266, 8, 2, 9887, // 7, 2 +7, 2, 7072, 7, 3, 44649, 8, 2, 5443, 8, 3, 8372, // 7, 3 +7, 3, 6000, 7, 4, 48240, 8, 3, 4513, 8, 4, 6783, // 7, 4 +7, 4, 4708, 7, 5, 52266, 8, 4, 3466, 8, 5, 5096, // 7, 5 +7, 5, 3180, 7, 6, 56756, 8, 5, 2294, 8, 6, 3306, // 7, 6 +7, 6, 1541, 7, 7, 61364, 8, 6, 1090, 8, 7, 1541, // 7, 7 +6, 7, 1090, 6, 8, 1541, 7, 7, 1542, 7, 8, 61363, // 7, 8 +6, 8, 2295, 6, 9, 3303, 7, 8, 3186, 7, 9, 56752, // 7, 9 +6, 9, 3470, 6, 10, 5092, 7, 9, 4721, 7, 10, 52253, // 7,10 +6, 10, 4521, 6, 11, 6774, 7, 10, 6023, 7, 11, 48218, // 7,11 +6, 11, 5454, 6, 12, 8359, 7, 11, 7106, 7, 12, 44617, // 7,12 +6, 12, 6284, 6, 13, 9867, 7, 12, 7996, 7, 13, 41389, // 7,13 +6, 13, 7020, 6, 14, 11317, 7, 13, 8718, 7, 14, 38481, // 7,14 +6, 14, 7674, 6, 15, 12728, 7, 14, 9290, 7, 15, 35844, // 7,15 +8, 0, 35844, 8, 1, 9290, 9, 0, 12728, 9, 1, 7674, // 8, 0 +8, 1, 38481, 8, 2, 8718, 9, 1, 11317, 9, 2, 7020, // 8, 1 +8, 2, 41389, 8, 3, 7996, 9, 2, 9867, 9, 3, 6284, // 8, 2 +8, 3, 44616, 8, 4, 7106, 9, 3, 8359, 9, 4, 5455, // 8, 3 +8, 4, 48218, 8, 5, 6023, 9, 4, 6774, 9, 5, 4521, // 8, 4 +8, 5, 52253, 8, 6, 4721, 9, 5, 5092, 9, 6, 3470, // 8, 5 +8, 6, 56751, 8, 7, 3186, 9, 6, 3303, 9, 7, 2296, // 8, 6 +8, 7, 61364, 8, 8, 1542, 9, 7, 1541, 9, 8, 1089, // 8, 7 +7, 8, 1542, 7, 9, 1090, 8, 8, 61364, 8, 9, 1540, // 8, 8 +7, 9, 3306, 7, 10, 2294, 8, 9, 56756, 8, 10, 3180, // 8, 9 +7, 10, 5097, 7, 11, 3466, 8, 10, 52266, 8, 11, 4707, // 8,10 +7, 11, 6783, 7, 12, 4513, 8, 11, 48240, 8, 12, 6000, // 8,11 +7, 12, 8373, 7, 13, 5443, 8, 12, 44649, 8, 13, 7071, // 8,12 +7, 13, 9886, 7, 14, 6266, 8, 13, 41432, 8, 14, 7952, // 8,13 +7, 14, 11344, 7, 15, 6997, 8, 14, 38534, 8, 15, 8661, // 8,14 +7, 15, 12764, 7, 16, 7643, 8, 15, 35905, 8, 16, 9224, // 8,15 +9, 0, 35315, 9, 1, 9635, 10, 0, 12717, 10, 1, 7869, // 9, 0 +9, 1, 37866, 9, 2, 9086, 10, 1, 11360, 10, 2, 7224, // 9, 1 +9, 2, 40656, 9, 3, 8397, 10, 2, 9977, 10, 3, 6506, // 9, 2 +9, 3, 43710, 9, 4, 7556, 10, 3, 8558, 10, 4, 5712, // 9, 3 +9, 4, 47035, 9, 5, 6558, 10, 4, 7100, 10, 5, 4843, // 9, 4 +9, 5, 50581, 9, 6, 5418, 10, 5, 5624, 10, 6, 3913, // 9, 5 +9, 6, 54105, 9, 7, 4225, 10, 6, 4217, 10, 7, 2989, // 9, 6 +9, 7, 56756, 9, 8, 3306, 10, 7, 3180, 10, 8, 2294, // 9, 7 +8, 8, 3186, 8, 9, 2295, 9, 8, 56751, 9, 9, 3304, // 9, 8 +8, 9, 4225, 8, 10, 2989, 9, 9, 54105, 9, 10, 4217, // 9, 9 +8, 10, 5637, 8, 11, 3911, 9, 10, 50587, 9, 11, 5401, // 9,10 +8, 11, 7119, 8, 12, 4838, 9, 11, 47049, 9, 12, 6530, // 9,11 +8, 12, 8584, 8, 13, 5703, 9, 12, 43733, 9, 13, 7516, // 9,12 +8, 13, 10013, 8, 14, 6491, 9, 13, 40688, 9, 14, 8344, // 9,13 +8, 14, 11407, 8, 15, 7202, 9, 14, 37906, 9, 15, 9021, // 9,14 +8, 15, 12777, 8, 16, 7839, 9, 15, 35362, 9, 16, 9558, // 9,15 +10, 0, 34532, 10, 1, 10086, 11, 0, 12783, 11, 1, 8135, // 10, 0 +10, 1, 36926, 10, 2, 9587, 11, 1, 11507, 11, 2, 7516, // 10, 1 +10, 2, 39503, 10, 3, 8966, 11, 2, 10226, 11, 3, 6841, // 10, 2 +10, 3, 42256, 10, 4, 8224, 11, 3, 8940, 11, 4, 6116, // 10, 3 +10, 4, 45139, 10, 5, 7377, 11, 4, 7667, 11, 5, 5353, // 10, 4 +10, 5, 48019, 10, 6, 6475, 11, 5, 6451, 11, 6, 4591, // 10, 5 +10, 6, 50587, 10, 7, 5637, 11, 6, 5400, 11, 7, 3912, // 10, 6 +10, 7, 52266, 10, 8, 5097, 11, 7, 4708, 11, 8, 3465, // 10, 7 +9, 8, 4721, 9, 9, 3470, 10, 8, 52253, 10, 9, 5092, // 10, 8 +9, 9, 5418, 9, 10, 3913, 10, 9, 50581, 10, 10, 5624, // 10, 9 +9, 10, 6475, 9, 11, 4591, 10, 10, 48019, 10, 11, 6451, // 10,10 +9, 11, 7698, 9, 12, 5350, 10, 11, 45146, 10, 12, 7342, // 10,11 +9, 12, 8982, 9, 13, 6108, 10, 12, 42271, 10, 13, 8175, // 10,12 +9, 13, 10279, 9, 14, 6829, 10, 13, 39526, 10, 14, 8902, // 10,13 +9, 14, 11575, 9, 15, 7497, 10, 14, 36955, 10, 15, 9509, // 10,14 +9, 15, 12867, 9, 16, 8107, 10, 15, 34567, 10, 16, 9995, // 10,15 +11, 0, 33539, 11, 1, 10635, 12, 0, 12899, 12, 1, 8463, // 11, 0 +11, 1, 35730, 11, 2, 10204, 12, 1, 11721, 12, 2, 7881, // 11, 1 +11, 2, 38042, 11, 3, 9674, 12, 2, 10559, 12, 3, 7261, // 11, 2 +11, 3, 40444, 11, 4, 9056, 12, 3, 9421, 12, 4, 6615, // 11, 3 +11, 4, 42861, 11, 5, 8378, 12, 4, 8332, 12, 5, 5965, // 11, 4 +11, 5, 45146, 11, 6, 7698, 12, 5, 7342, 12, 6, 5350, // 11, 5 +11, 6, 47049, 11, 7, 7119, 12, 6, 6530, 12, 7, 4838, // 11, 6 +11, 7, 48240, 11, 8, 6783, 12, 7, 6000, 12, 8, 4513, // 11, 7 +10, 8, 6023, 10, 9, 4521, 11, 8, 48218, 11, 9, 6774, // 11, 8 +10, 9, 6558, 10, 10, 4843, 11, 9, 47035, 11, 10, 7100, // 11, 9 +10, 10, 7377, 10, 11, 5353, 11, 10, 45139, 11, 11, 7667, // 11,10 +10, 11, 8378, 10, 12, 5965, 11, 11, 42861, 11, 12, 8332, // 11,11 +10, 12, 9478, 10, 13, 6611, 11, 12, 40452, 11, 13, 8995, // 11,12 +10, 13, 10630, 10, 14, 7252, 11, 13, 38057, 11, 14, 9597, // 11,13 +10, 14, 11810, 10, 15, 7865, 11, 14, 35750, 11, 15, 10111, // 11,14 +10, 15, 13007, 10, 16, 8438, 11, 15, 33564, 11, 16, 10527, // 11,15 +12, 0, 32391, 12, 1, 11269, 13, 0, 13038, 13, 1, 8838, // 12, 0 +12, 1, 34358, 12, 2, 10918, 13, 1, 11964, 13, 2, 8296, // 12, 1 +12, 2, 36392, 12, 3, 10488, 13, 2, 10922, 13, 3, 7734, // 12, 2 +12, 3, 38450, 12, 4, 9998, 13, 3, 9924, 13, 4, 7164, // 12, 3 +12, 4, 40452, 12, 5, 9478, 13, 4, 8995, 13, 5, 6611, // 12, 4 +12, 5, 42271, 12, 6, 8982, 13, 5, 8175, 13, 6, 6108, // 12, 5 +12, 6, 43733, 12, 7, 8584, 13, 6, 7516, 13, 7, 5703, // 12, 6 +12, 7, 44649, 12, 8, 8373, 13, 7, 7072, 13, 8, 5442, // 12, 7 +11, 8, 7106, 11, 9, 5454, 12, 8, 44616, 12, 9, 8360, // 12, 8 +11, 9, 7556, 11, 10, 5712, 12, 9, 43710, 12, 10, 8558, // 12, 9 +11, 10, 8224, 11, 11, 6116, 12, 10, 42256, 12, 11, 8940, // 12,10 +11, 11, 9056, 11, 12, 6615, 12, 11, 40444, 12, 12, 9421, // 12,11 +11, 12, 9998, 11, 13, 7164, 12, 12, 38450, 12, 13, 9924, // 12,12 +11, 13, 11012, 11, 14, 7728, 12, 13, 36399, 12, 14, 10397, // 12,13 +11, 14, 12074, 11, 15, 8284, 12, 14, 34369, 12, 15, 10809, // 12,14 +11, 15, 13171, 11, 16, 8816, 12, 15, 32406, 12, 16, 11143, // 12,15 +13, 0, 31138, 13, 1, 11977, 14, 0, 13176, 14, 1, 9245, // 13, 0 +13, 1, 32881, 13, 2, 11709, 14, 1, 12203, 14, 2, 8743, // 13, 1 +13, 2, 34650, 13, 3, 11382, 14, 2, 11272, 14, 3, 8232, // 13, 2 +13, 3, 36399, 13, 4, 11012, 14, 3, 10397, 14, 4, 7728, // 13, 3 +13, 4, 38057, 13, 5, 10630, 14, 4, 9597, 14, 5, 7252, // 13, 4 +13, 5, 39526, 13, 6, 10279, 14, 5, 8902, 14, 6, 6829, // 13, 5 +13, 6, 40688, 13, 7, 10013, 14, 6, 8344, 14, 7, 6491, // 13, 6 +13, 7, 41432, 13, 8, 9886, 14, 7, 7951, 14, 8, 6267, // 13, 7 +12, 8, 7996, 12, 9, 6284, 13, 8, 41389, 13, 9, 9867, // 13, 8 +12, 9, 8397, 12, 10, 6506, 13, 9, 40656, 13, 10, 9977, // 13, 9 +12, 10, 8966, 12, 11, 6842, 13, 10, 39503, 13, 11, 10225, // 13,10 +12, 11, 9674, 12, 12, 7261, 13, 11, 38042, 13, 12, 10559, // 13,11 +12, 12, 10488, 12, 13, 7734, 13, 12, 36392, 13, 13, 10922, // 13,12 +12, 13, 11382, 12, 14, 8232, 13, 13, 34650, 13, 14, 11272, // 13,13 +12, 14, 12334, 12, 15, 8735, 13, 14, 32886, 13, 15, 11581, // 13,14 +12, 15, 13332, 12, 16, 9229, 13, 15, 31146, 13, 16, 11829, // 13,15 +14, 0, 29828, 14, 1, 12746, 15, 0, 13291, 15, 1, 9671, // 14, 0 +14, 1, 31358, 14, 2, 12564, 15, 1, 12412, 15, 2, 9202, // 14, 1 +14, 2, 32886, 14, 3, 12334, 15, 2, 11580, 15, 3, 8736, // 14, 2 +14, 3, 34369, 14, 4, 12074, 15, 3, 10808, 15, 4, 8285, // 14, 3 +14, 4, 35750, 14, 5, 11810, 15, 4, 10111, 15, 5, 7865, // 14, 4 +14, 5, 36955, 14, 6, 11575, 15, 5, 9509, 15, 6, 7497, // 14, 5 +14, 6, 37906, 14, 7, 11407, 15, 6, 9020, 15, 7, 7203, // 14, 6 +14, 7, 38534, 14, 8, 11344, 15, 7, 8662, 15, 8, 6996, // 14, 7 +13, 8, 8718, 13, 9, 7020, 14, 8, 38481, 14, 9, 11317, // 14, 8 +13, 9, 9086, 13, 10, 7224, 14, 9, 37866, 14, 10, 11360, // 14, 9 +13, 10, 9587, 13, 11, 7517, 14, 10, 36926, 14, 11, 11506, // 14,10 +13, 11, 10204, 13, 12, 7881, 14, 11, 35730, 14, 12, 11721, // 14,11 +13, 12, 10918, 13, 13, 8296, 14, 12, 34358, 14, 13, 11964, // 14,12 +13, 13, 11709, 13, 14, 8742, 14, 13, 32881, 14, 14, 12204, // 14,13 +13, 14, 12564, 13, 15, 9202, 14, 14, 31358, 14, 15, 12412, // 14,14 +13, 15, 13470, 13, 16, 9662, 14, 15, 29831, 14, 16, 12573, // 14,15 +15, 0, 28495, 15, 1, 13569, 16, 0, 13368, 16, 1, 10104, // 15, 0 +15, 1, 29831, 15, 2, 13470, 16, 1, 12574, 16, 2, 9661, // 15, 1 +15, 2, 31146, 15, 3, 13332, 16, 2, 11829, 16, 3, 9229, // 15, 2 +15, 3, 32406, 15, 4, 13171, 16, 3, 11143, 16, 4, 8816, // 15, 3 +15, 4, 33564, 15, 5, 13007, 16, 4, 10528, 16, 5, 8437, // 15, 4 +15, 5, 34567, 15, 6, 12867, 16, 5, 9995, 16, 6, 8107, // 15, 5 +15, 6, 35362, 15, 7, 12777, 16, 6, 9558, 16, 7, 7839, // 15, 6 +15, 7, 35905, 15, 8, 12764, 16, 7, 9224, 16, 8, 7643, // 15, 7 +14, 8, 9290, 14, 9, 7674, 15, 8, 35844, 15, 9, 12728, // 15, 8 +14, 9, 9635, 14, 10, 7868, 15, 9, 35315, 15, 10, 12718, // 15, 9 +14, 10, 10086, 14, 11, 8135, 15, 10, 34532, 15, 11, 12783, // 15,10 +14, 11, 10635, 14, 12, 8463, 15, 11, 33539, 15, 12, 12899, // 15,11 +14, 12, 11269, 14, 13, 8838, 15, 12, 32391, 15, 13, 13038, // 15,12 +14, 13, 11977, 14, 14, 9245, 15, 13, 31138, 15, 14, 13176, // 15,13 +14, 14, 12746, 14, 15, 9671, 15, 14, 29828, 15, 15, 13291, // 15,14 +14, 15, 13569, 14, 16, 10104, 15, 15, 28495, 15, 16, 13368, // 15,15 +// angle of 2.5 degrees +0, -1, 14696, 0, 0, 24063, 1, -1, 11702, 1, 0, 15075, // 0, 0 +0, 0, 14872, 0, 1, 25368, 1, 0, 11187, 1, 1, 14109, // 0, 1 +0, 1, 14990, 0, 2, 26660, 1, 1, 10676, 1, 2, 13210, // 0, 2 +0, 2, 15060, 0, 3, 27903, 1, 2, 10185, 1, 3, 12388, // 0, 3 +0, 3, 15100, 0, 4, 29055, 1, 3, 9728, 1, 4, 11653, // 0, 4 +0, 4, 15135, 0, 5, 30064, 1, 4, 9323, 1, 5, 11014, // 0, 5 +0, 5, 15193, 0, 6, 30876, 1, 5, 8986, 1, 6, 10481, // 0, 6 +0, 6, 15301, 0, 7, 31444, 1, 6, 8727, 1, 7, 10064, // 0, 7 +-1, 7, 8669, -1, 8, 9959, 0, 7, 15376, 0, 8, 31532, // 0, 8 +-1, 8, 8927, -1, 9, 10351, 0, 8, 15319, 0, 9, 30939, // 0, 9 +-1, 9, 9265, -1, 10, 10855, 0, 9, 15311, 0, 10, 30105, // 0,10 +-1, 10, 9673, -1, 11, 11461, 0, 10, 15325, 0, 11, 29077, // 0,11 +-1, 11, 10135, -1, 12, 12159, 0, 11, 15330, 0, 12, 27912, // 0,12 +-1, 12, 10637, -1, 13, 12938, 0, 12, 15301, 0, 13, 26660, // 0,13 +-1, 13, 11164, -1, 14, 13787, 0, 13, 15220, 0, 14, 25365, // 0,14 +-1, 14, 11702, -1, 15, 14696, 0, 14, 15076, 0, 15, 24062, // 0,15 +1, -1, 13787, 1, 0, 25366, 2, -1, 11164, 2, 0, 15219, // 1, 0 +1, 0, 13853, 1, 1, 26893, 2, 0, 10644, 2, 1, 14146, // 1, 1 +1, 1, 13850, 1, 2, 28427, 2, 1, 10119, 2, 2, 13140, // 1, 2 +1, 2, 13789, 1, 3, 29928, 2, 2, 9603, 2, 3, 12216, // 1, 3 +1, 3, 13694, 1, 4, 31339, 2, 3, 9118, 2, 4, 11385, // 1, 4 +1, 4, 13600, 1, 5, 32586, 2, 4, 8685, 2, 5, 10665, // 1, 5 +1, 5, 13548, 1, 6, 33585, 2, 5, 8329, 2, 6, 10074, // 1, 6 +1, 6, 13582, 1, 7, 34261, 2, 6, 8068, 2, 7, 9625, // 1, 7 +0, 7, 8024, 0, 8, 9534, 1, 7, 13638, 1, 8, 34340, // 1, 8 +0, 8, 8286, 0, 9, 9961, 1, 8, 13647, 1, 9, 33642, // 1, 9 +0, 9, 8645, 0, 10, 10528, 1, 9, 13740, 1, 10, 32623, // 1,10 +0, 10, 9082, 0, 11, 11218, 1, 10, 13875, 1, 11, 31361, // 1,11 +0, 11, 9575, 0, 12, 12014, 1, 11, 14009, 1, 12, 29938, // 1,12 +0, 12, 10102, 0, 13, 12897, 1, 12, 14107, 1, 13, 28430, // 1,13 +0, 13, 10644, 0, 14, 13853, 1, 13, 14145, 1, 14, 26894, // 1,14 +0, 14, 11187, 0, 15, 14872, 1, 14, 14109, 1, 15, 25368, // 1,15 +2, -1, 12938, 2, 0, 26660, 3, -1, 10637, 3, 0, 15301, // 2, 0 +2, 0, 12897, 2, 1, 28430, 3, 0, 10102, 3, 1, 14107, // 2, 1 +2, 1, 12769, 2, 2, 30239, 3, 1, 9546, 3, 2, 12982, // 2, 2 +2, 2, 12569, 2, 3, 32045, 3, 2, 8988, 3, 3, 11934, // 2, 3 +2, 3, 12323, 2, 4, 33777, 3, 3, 8452, 3, 4, 10984, // 2, 4 +2, 4, 12079, 2, 5, 35332, 3, 4, 7969, 3, 5, 10156, // 2, 5 +2, 5, 11897, 2, 6, 36582, 3, 5, 7573, 3, 6, 9484, // 2, 6 +2, 6, 11842, 2, 7, 37402, 3, 6, 7298, 3, 7, 8994, // 2, 7 +1, 7, 7266, 1, 8, 8918, 2, 7, 11883, 2, 8, 37469, // 2, 8 +1, 8, 7543, 1, 9, 9390, 2, 8, 11972, 2, 9, 36631, // 2, 9 +1, 9, 7943, 1, 10, 10041, 2, 9, 12188, 2, 10, 35364, // 2,10 +1, 10, 8432, 1, 11, 10842, 2, 10, 12467, 2, 11, 33795, // 2,11 +1, 11, 8976, 1, 12, 11760, 2, 11, 12747, 2, 12, 32053, // 2,12 +1, 12, 9546, 1, 13, 12769, 2, 12, 12982, 2, 13, 30239, // 2,13 +1, 13, 10119, 1, 14, 13850, 2, 13, 13141, 2, 14, 28426, // 2,14 +1, 14, 10676, 1, 15, 14990, 2, 14, 13211, 2, 15, 26659, // 2,15 +3, -1, 12159, 3, 0, 27912, 4, -1, 10135, 4, 0, 15330, // 3, 0 +3, 0, 12014, 3, 1, 29938, 4, 0, 9575, 4, 1, 14009, // 3, 1 +3, 1, 11760, 3, 2, 32052, 4, 1, 8976, 4, 2, 12748, // 3, 2 +3, 2, 11411, 3, 3, 34213, 4, 2, 8358, 4, 3, 11554, // 3, 3 +3, 3, 10995, 3, 4, 36343, 4, 3, 7746, 4, 4, 10452, // 3, 4 +3, 4, 10569, 3, 5, 38307, 4, 4, 7180, 4, 5, 9480, // 3, 5 +3, 5, 10221, 3, 6, 39912, 4, 5, 6714, 4, 6, 8689, // 3, 6 +3, 6, 10051, 3, 7, 40940, 4, 6, 6403, 4, 7, 8142, // 3, 7 +2, 7, 6381, 2, 8, 8082, 3, 7, 10079, 3, 8, 40994, // 3, 8 +2, 8, 6695, 2, 9, 8617, 3, 8, 10275, 3, 9, 39949, // 3, 9 +2, 9, 7165, 2, 10, 9388, 3, 9, 10653, 3, 10, 38330, // 3,10 +2, 10, 7737, 2, 11, 10337, 3, 10, 11108, 3, 11, 36354, // 3,11 +2, 11, 8358, 2, 12, 11411, 3, 11, 11554, 3, 12, 34213, // 3,12 +2, 12, 8988, 2, 13, 12569, 3, 12, 11934, 3, 13, 32045, // 3,13 +2, 13, 9603, 2, 14, 13789, 3, 13, 12216, 3, 14, 29928, // 3,14 +2, 14, 10185, 2, 15, 15060, 3, 14, 12388, 3, 15, 27903, // 3,15 +4, -1, 11461, 4, 0, 29078, 5, -1, 9673, 5, 0, 15324, // 4, 0 +4, 0, 11218, 4, 1, 31361, 5, 0, 9082, 5, 1, 13875, // 4, 1 +4, 1, 10842, 4, 2, 33795, 5, 1, 8432, 5, 2, 12467, // 4, 2 +4, 2, 10337, 4, 3, 36354, 5, 2, 7737, 5, 3, 11108, // 4, 3 +4, 3, 9730, 4, 4, 38966, 5, 3, 7022, 5, 4, 9818, // 4, 4 +4, 4, 9081, 4, 5, 41475, 5, 4, 6334, 5, 5, 8646, // 4, 5 +4, 5, 8507, 4, 6, 43602, 5, 5, 5749, 5, 6, 7678, // 4, 6 +4, 6, 8177, 4, 7, 44962, 5, 6, 5368, 5, 7, 7029, // 4, 7 +3, 7, 5354, 3, 8, 6987, 4, 7, 8195, 4, 8, 45000, // 4, 8 +3, 8, 5739, 3, 9, 7626, 4, 8, 8545, 4, 9, 43626, // 4, 9 +3, 9, 6328, 3, 10, 8578, 4, 9, 9143, 4, 10, 41487, // 4,10 +3, 10, 7022, 3, 11, 9730, 4, 10, 9818, 4, 11, 38966, // 4,11 +3, 11, 7746, 3, 12, 10995, 4, 11, 10452, 4, 12, 36343, // 4,12 +3, 12, 8452, 3, 13, 12323, 4, 12, 10983, 4, 13, 33778, // 4,13 +3, 13, 9118, 3, 14, 13694, 4, 13, 11385, 4, 14, 31339, // 4,14 +3, 14, 9728, 3, 15, 15100, 4, 14, 11652, 4, 15, 29056, // 4,15 +5, -1, 10855, 5, 0, 30105, 6, -1, 9265, 6, 0, 15311, // 5, 0 +5, 0, 10528, 5, 1, 32624, 6, 0, 8645, 6, 1, 13739, // 5, 1 +5, 1, 10041, 5, 2, 35364, 6, 1, 7943, 6, 2, 12188, // 5, 2 +5, 2, 9388, 5, 3, 38330, 6, 2, 7165, 6, 3, 10653, // 5, 3 +5, 3, 8578, 5, 4, 41487, 6, 3, 6328, 6, 4, 9143, // 5, 4 +5, 4, 7659, 5, 5, 44700, 6, 4, 5472, 6, 5, 7705, // 5, 5 +5, 5, 6768, 5, 6, 47619, 6, 5, 4694, 6, 6, 6455, // 5, 6 +5, 6, 6183, 5, 7, 49566, 6, 6, 4172, 6, 7, 5615, // 5, 7 +4, 7, 4164, 4, 8, 5590, 5, 7, 6193, 5, 8, 49589, // 5, 8 +4, 8, 4690, 4, 9, 6422, 5, 8, 6794, 5, 9, 47630, // 5, 9 +4, 9, 5472, 4, 10, 7659, 5, 9, 7705, 5, 10, 44700, // 5,10 +4, 10, 6334, 4, 11, 9081, 5, 10, 8646, 5, 11, 41475, // 5,11 +4, 11, 7180, 4, 12, 10569, 5, 11, 9479, 5, 12, 38308, // 5,12 +4, 12, 7969, 4, 13, 12079, 5, 12, 10156, 5, 13, 35332, // 5,13 +4, 13, 8685, 4, 14, 13600, 5, 13, 10665, 5, 14, 32586, // 5,14 +4, 14, 9323, 4, 15, 15135, 5, 14, 11013, 5, 15, 30065, // 5,15 +6, -1, 10351, 6, 0, 30939, 7, -1, 8927, 7, 0, 15319, // 6, 0 +6, 0, 9961, 6, 1, 33642, 7, 0, 8286, 7, 1, 13647, // 6, 1 +6, 1, 9390, 6, 2, 36631, 7, 1, 7543, 7, 2, 11972, // 6, 2 +6, 2, 8617, 6, 3, 39949, 7, 2, 6695, 7, 3, 10275, // 6, 3 +6, 3, 7626, 6, 4, 43626, 7, 3, 5739, 7, 4, 8545, // 6, 4 +6, 4, 6422, 6, 5, 47630, 7, 4, 4690, 7, 5, 6794, // 6, 5 +6, 5, 5099, 6, 6, 51701, 7, 5, 3620, 7, 6, 5116, // 6, 6 +6, 6, 4044, 6, 7, 54831, 7, 6, 2797, 7, 7, 3864, // 6, 7 +5, 7, 2795, 5, 8, 3853, 6, 7, 4049, 6, 8, 54839, // 6, 8 +5, 8, 3620, 5, 9, 5099, 6, 8, 5116, 6, 9, 51701, // 6, 9 +5, 9, 4694, 5, 10, 6768, 6, 9, 6455, 6, 10, 47619, // 6,10 +5, 10, 5749, 5, 11, 8507, 6, 10, 7678, 6, 11, 43602, // 6,11 +5, 11, 6714, 5, 12, 10221, 6, 11, 8690, 6, 12, 39911, // 6,12 +5, 12, 7573, 5, 13, 11897, 6, 12, 9484, 6, 13, 36582, // 6,13 +5, 13, 8329, 5, 14, 13548, 6, 13, 10074, 6, 14, 33585, // 6,14 +5, 14, 8986, 5, 15, 15193, 6, 14, 10482, 6, 15, 30875, // 6,15 +7, -1, 9959, 7, 0, 31532, 8, -1, 8669, 8, 0, 15376, // 7, 0 +7, 0, 9534, 7, 1, 34340, 8, 0, 8024, 8, 1, 13638, // 7, 1 +7, 1, 8918, 7, 2, 37470, 8, 1, 7266, 8, 2, 11882, // 7, 2 +7, 2, 8082, 7, 3, 40994, 8, 2, 6381, 8, 3, 10079, // 7, 3 +7, 3, 6987, 7, 4, 44999, 8, 3, 5354, 8, 4, 8196, // 7, 4 +7, 4, 5590, 7, 5, 49588, 8, 4, 4164, 8, 5, 6194, // 7, 5 +7, 5, 3853, 7, 6, 54839, 8, 5, 2795, 8, 6, 4049, // 7, 6 +7, 6, 1903, 7, 7, 60382, 8, 6, 1347, 8, 7, 1904, // 7, 7 +6, 7, 1347, 6, 8, 1903, 7, 7, 1905, 7, 8, 60381, // 7, 8 +6, 8, 2797, 6, 9, 4044, 7, 8, 3864, 7, 9, 54831, // 7, 9 +6, 9, 4172, 6, 10, 6183, 7, 9, 5615, 7, 10, 49566, // 7,10 +6, 10, 5368, 6, 11, 8177, 7, 10, 7029, 7, 11, 44962, // 7,11 +6, 11, 6403, 6, 12, 10051, 7, 11, 8141, 7, 12, 40941, // 7,12 +6, 12, 7298, 6, 13, 11842, 7, 12, 8994, 7, 13, 37402, // 7,13 +6, 13, 8068, 6, 14, 13582, 7, 13, 9626, 7, 14, 34260, // 7,14 +6, 14, 8727, 6, 15, 15301, 7, 14, 10065, 7, 15, 31443, // 7,15 +8, 0, 31444, 8, 1, 10065, 9, 0, 15301, 9, 1, 8726, // 8, 0 +8, 1, 34261, 8, 2, 9626, 9, 1, 13582, 9, 2, 8067, // 8, 1 +8, 2, 37402, 8, 3, 8994, 9, 2, 11842, 9, 3, 7298, // 8, 2 +8, 3, 40940, 8, 4, 8141, 9, 3, 10051, 9, 4, 6404, // 8, 3 +8, 4, 44962, 8, 5, 7029, 9, 4, 8177, 9, 5, 5368, // 8, 4 +8, 5, 49566, 8, 6, 5615, 9, 5, 6183, 9, 6, 4172, // 8, 5 +8, 6, 54831, 8, 7, 3864, 9, 6, 4044, 9, 7, 2797, // 8, 6 +8, 7, 60382, 8, 8, 1905, 9, 7, 1903, 9, 8, 1346, // 8, 7 +7, 8, 1905, 7, 9, 1347, 8, 8, 60382, 8, 9, 1902, // 8, 8 +7, 9, 4049, 7, 10, 2795, 8, 9, 54839, 8, 10, 3853, // 8, 9 +7, 10, 6193, 7, 11, 4164, 8, 10, 49588, 8, 11, 5591, // 8,10 +7, 11, 8195, 7, 12, 5354, 8, 11, 44999, 8, 12, 6988, // 8,11 +7, 12, 10079, 7, 13, 6381, 8, 12, 40994, 8, 13, 8082, // 8,12 +7, 13, 11883, 7, 14, 7266, 8, 13, 37470, 8, 14, 8917, // 8,13 +7, 14, 13638, 7, 15, 8024, 8, 14, 34340, 8, 15, 9534, // 8,14 +7, 15, 15376, 7, 16, 8669, 8, 15, 31532, 8, 16, 9959, // 8,15 +9, 0, 30876, 9, 1, 10482, 10, 0, 15193, 10, 1, 8985, // 9, 0 +9, 1, 33585, 9, 2, 10074, 10, 1, 13548, 10, 2, 8329, // 9, 1 +9, 2, 36582, 9, 3, 9484, 10, 2, 11897, 10, 3, 7573, // 9, 2 +9, 3, 39912, 9, 4, 8690, 10, 3, 10221, 10, 4, 6713, // 9, 3 +9, 4, 43602, 9, 5, 7678, 10, 4, 8507, 10, 5, 5749, // 9, 4 +9, 5, 47619, 9, 6, 6455, 10, 5, 6768, 10, 6, 4694, // 9, 5 +9, 6, 51701, 9, 7, 5116, 10, 6, 5099, 10, 7, 3620, // 9, 6 +9, 7, 54839, 9, 8, 4049, 10, 7, 3853, 10, 8, 2795, // 9, 7 +8, 8, 3864, 8, 9, 2797, 9, 8, 54831, 9, 9, 4044, // 9, 8 +8, 9, 5116, 8, 10, 3620, 9, 9, 51701, 9, 10, 5099, // 9, 9 +8, 10, 6794, 8, 11, 4690, 9, 10, 47630, 9, 11, 6422, // 9,10 +8, 11, 8545, 8, 12, 5739, 9, 11, 43626, 9, 12, 7626, // 9,11 +8, 12, 10275, 8, 13, 6695, 9, 12, 39949, 9, 13, 8617, // 9,12 +8, 13, 11972, 8, 14, 7543, 9, 13, 36631, 9, 14, 9390, // 9,13 +8, 14, 13647, 8, 15, 8286, 9, 14, 33642, 9, 15, 9961, // 9,14 +8, 15, 15319, 8, 16, 8927, 9, 15, 30939, 9, 16, 10351, // 9,15 +10, 0, 30064, 10, 1, 11013, 11, 0, 15135, 11, 1, 9324, // 10, 0 +10, 1, 32586, 10, 2, 10665, 11, 1, 13600, 11, 2, 8685, // 10, 1 +10, 2, 35332, 10, 3, 10156, 11, 2, 12079, 11, 3, 7969, // 10, 2 +10, 3, 38307, 10, 4, 9479, 11, 3, 10569, 11, 4, 7181, // 10, 3 +10, 4, 41475, 10, 5, 8646, 11, 4, 9081, 11, 5, 6334, // 10, 4 +10, 5, 44700, 10, 6, 7705, 11, 5, 7659, 11, 6, 5472, // 10, 5 +10, 6, 47630, 10, 7, 6794, 11, 6, 6422, 11, 7, 4690, // 10, 6 +10, 7, 49588, 10, 8, 6193, 11, 7, 5590, 11, 8, 4165, // 10, 7 +9, 8, 5615, 9, 9, 4172, 10, 8, 49566, 10, 9, 6183, // 10, 8 +9, 9, 6455, 9, 10, 4694, 10, 9, 47619, 10, 10, 6768, // 10, 9 +9, 10, 7705, 9, 11, 5472, 10, 10, 44700, 10, 11, 7659, // 10,10 +9, 11, 9143, 9, 12, 6328, 10, 11, 41487, 10, 12, 8578, // 10,11 +9, 12, 10653, 9, 13, 7165, 10, 12, 38330, 10, 13, 9388, // 10,12 +9, 13, 12188, 9, 14, 7943, 10, 13, 35364, 10, 14, 10041, // 10,13 +9, 14, 13740, 9, 15, 8645, 10, 14, 32624, 10, 15, 10527, // 10,14 +9, 15, 15311, 9, 16, 9265, 10, 15, 30105, 10, 16, 10855, // 10,15 +11, 0, 29055, 11, 1, 11652, 12, 0, 15100, 12, 1, 9729, // 11, 0 +11, 1, 31339, 11, 2, 11385, 12, 1, 13694, 12, 2, 9118, // 11, 1 +11, 2, 33777, 11, 3, 10983, 12, 2, 12323, 12, 3, 8453, // 11, 2 +11, 3, 36343, 11, 4, 10452, 12, 3, 10995, 12, 4, 7746, // 11, 3 +11, 4, 38966, 11, 5, 9818, 12, 4, 9730, 12, 5, 7022, // 11, 4 +11, 5, 41487, 11, 6, 9143, 12, 5, 8578, 12, 6, 6328, // 11, 5 +11, 6, 43626, 11, 7, 8545, 12, 6, 7626, 12, 7, 5739, // 11, 6 +11, 7, 44999, 11, 8, 8195, 12, 7, 6987, 12, 8, 5355, // 11, 7 +10, 8, 7029, 10, 9, 5368, 11, 8, 44962, 11, 9, 8177, // 11, 8 +10, 9, 7678, 10, 10, 5749, 11, 9, 43602, 11, 10, 8507, // 11, 9 +10, 10, 8646, 10, 11, 6334, 11, 10, 41475, 11, 11, 9081, // 11,10 +10, 11, 9818, 10, 12, 7022, 11, 11, 38966, 11, 12, 9730, // 11,11 +10, 12, 11108, 10, 13, 7737, 11, 12, 36354, 11, 13, 10337, // 11,12 +10, 13, 12467, 10, 14, 8432, 11, 13, 33795, 11, 14, 10842, // 11,13 +10, 14, 13875, 10, 15, 9082, 11, 14, 31361, 11, 15, 11218, // 11,14 +10, 15, 15325, 10, 16, 9673, 11, 15, 29078, 11, 16, 11460, // 11,15 +12, 0, 27903, 12, 1, 12388, 13, 0, 15060, 13, 1, 10185, // 12, 0 +12, 1, 29928, 12, 2, 12216, 13, 1, 13789, 13, 2, 9603, // 12, 1 +12, 2, 32045, 12, 3, 11934, 13, 2, 12569, 13, 3, 8988, // 12, 2 +12, 3, 34213, 12, 4, 11554, 13, 3, 11411, 13, 4, 8358, // 12, 3 +12, 4, 36354, 12, 5, 11108, 13, 4, 10337, 13, 5, 7737, // 12, 4 +12, 5, 38330, 12, 6, 10653, 13, 5, 9388, 13, 6, 7165, // 12, 5 +12, 6, 39949, 12, 7, 10275, 13, 6, 8617, 13, 7, 6695, // 12, 6 +12, 7, 40994, 12, 8, 10079, 13, 7, 8082, 13, 8, 6381, // 12, 7 +11, 8, 8141, 11, 9, 6403, 12, 8, 40940, 12, 9, 10052, // 12, 8 +11, 9, 8690, 11, 10, 6714, 12, 9, 39912, 12, 10, 10220, // 12, 9 +11, 10, 9479, 11, 11, 7180, 12, 10, 38307, 12, 11, 10570, // 12,10 +11, 11, 10452, 11, 12, 7746, 12, 11, 36343, 12, 12, 10995, // 12,11 +11, 12, 11554, 11, 13, 8358, 12, 12, 34213, 12, 13, 11411, // 12,12 +11, 13, 12747, 11, 14, 8976, 12, 13, 32052, 12, 14, 11761, // 12,13 +11, 14, 14009, 11, 15, 9575, 12, 14, 29938, 12, 15, 12014, // 12,14 +11, 15, 15330, 11, 16, 10135, 12, 15, 27912, 12, 16, 12159, // 12,15 +13, 0, 26660, 13, 1, 13211, 14, 0, 14990, 14, 1, 10675, // 13, 0 +13, 1, 28427, 13, 2, 13141, 14, 1, 13850, 14, 2, 10118, // 13, 1 +13, 2, 30239, 13, 3, 12982, 14, 2, 12769, 14, 3, 9546, // 13, 2 +13, 3, 32052, 13, 4, 12747, 14, 3, 11760, 14, 4, 8977, // 13, 3 +13, 4, 33795, 13, 5, 12467, 14, 4, 10842, 14, 5, 8432, // 13, 4 +13, 5, 35364, 13, 6, 12188, 14, 5, 10041, 14, 6, 7943, // 13, 5 +13, 6, 36631, 13, 7, 11972, 14, 6, 9390, 14, 7, 7543, // 13, 6 +13, 7, 37470, 13, 8, 11883, 14, 7, 8918, 14, 8, 7265, // 13, 7 +12, 8, 8994, 12, 9, 7298, 13, 8, 37402, 13, 9, 11842, // 13, 8 +12, 9, 9484, 12, 10, 7573, 13, 9, 36582, 13, 10, 11897, // 13, 9 +12, 10, 10156, 12, 11, 7969, 13, 10, 35332, 13, 11, 12079, // 13,10 +12, 11, 10983, 12, 12, 8452, 13, 11, 33777, 13, 12, 12324, // 13,11 +12, 12, 11934, 12, 13, 8988, 13, 12, 32045, 13, 13, 12569, // 13,12 +12, 13, 12982, 12, 14, 9546, 13, 13, 30239, 13, 14, 12769, // 13,13 +12, 14, 14107, 12, 15, 10102, 13, 14, 28430, 13, 15, 12897, // 13,14 +12, 15, 15301, 12, 16, 10637, 13, 15, 26660, 13, 16, 12938, // 13,15 +14, 0, 25368, 14, 1, 14109, 15, 0, 14872, 15, 1, 11187, // 14, 0 +14, 1, 26893, 14, 2, 14145, 15, 1, 13853, 15, 2, 10645, // 14, 1 +14, 2, 28430, 14, 3, 14107, 15, 2, 12897, 15, 3, 10102, // 14, 2 +14, 3, 29938, 14, 4, 14009, 15, 3, 12014, 15, 4, 9575, // 14, 3 +14, 4, 31361, 14, 5, 13875, 15, 4, 11218, 15, 5, 9082, // 14, 4 +14, 5, 32624, 14, 6, 13740, 15, 5, 10528, 15, 6, 8644, // 14, 5 +14, 6, 33642, 14, 7, 13647, 15, 6, 9961, 15, 7, 8286, // 14, 6 +14, 7, 34340, 14, 8, 13638, 15, 7, 9534, 15, 8, 8024, // 14, 7 +13, 8, 9626, 13, 9, 8068, 14, 8, 34261, 14, 9, 13581, // 14, 8 +13, 9, 10074, 13, 10, 8329, 14, 9, 33585, 14, 10, 13548, // 14, 9 +13, 10, 10665, 13, 11, 8685, 14, 10, 32586, 14, 11, 13600, // 14,10 +13, 11, 11385, 13, 12, 9118, 14, 11, 31339, 14, 12, 13694, // 14,11 +13, 12, 12216, 13, 13, 9603, 14, 12, 29928, 14, 13, 13789, // 14,12 +13, 13, 13141, 13, 14, 10119, 14, 13, 28427, 14, 14, 13849, // 14,13 +13, 14, 14145, 13, 15, 10644, 14, 14, 26893, 14, 15, 13854, // 14,14 +13, 15, 15220, 13, 16, 11164, 14, 15, 25366, 14, 16, 13786, // 14,15 +15, 0, 24063, 15, 1, 15076, 16, 0, 14696, 16, 1, 11701, // 15, 0 +15, 1, 25366, 15, 2, 15220, 16, 1, 13787, 16, 2, 11163, // 15, 1 +15, 2, 26660, 15, 3, 15301, 16, 2, 12938, 16, 3, 10637, // 15, 2 +15, 3, 27912, 15, 4, 15330, 16, 3, 12159, 16, 4, 10135, // 15, 3 +15, 4, 29078, 15, 5, 15325, 16, 4, 11461, 16, 5, 9672, // 15, 4 +15, 5, 30105, 15, 6, 15311, 16, 5, 10855, 16, 6, 9265, // 15, 5 +15, 6, 30939, 15, 7, 15319, 16, 6, 10351, 16, 7, 8927, // 15, 6 +15, 7, 31532, 15, 8, 15376, 16, 7, 9959, 16, 8, 8669, // 15, 7 +14, 8, 10065, 14, 9, 8727, 15, 8, 31444, 15, 9, 15300, // 15, 8 +14, 9, 10482, 14, 10, 8986, 15, 9, 30876, 15, 10, 15192, // 15, 9 +14, 10, 11013, 14, 11, 9323, 15, 10, 30064, 15, 11, 15136, // 15,10 +14, 11, 11652, 14, 12, 9728, 15, 11, 29055, 15, 12, 15101, // 15,11 +14, 12, 12388, 14, 13, 10185, 15, 12, 27903, 15, 13, 15060, // 15,12 +14, 13, 13211, 14, 14, 10676, 15, 13, 26660, 15, 14, 14989, // 15,13 +14, 14, 14109, 14, 15, 11187, 15, 14, 25368, 15, 15, 14872, // 15,14 +14, 15, 15076, 14, 16, 11702, 15, 15, 24063, 15, 16, 14695, // 15,15 diff --git a/vp8/common/rotate2.h b/vp8/common/rotate2.h index 580f55279..50080c0ac 100644 --- a/vp8/common/rotate2.h +++ b/vp8/common/rotate2.h @@ -1,2827 +1,2827 @@ - // angle of -2.5 degrees - -1, 0, 14696, -1, 1, 11702, 0, 0, 24063, 0, 1, 15075, // 0, 0 - -1, 1, 13787, -1, 2, 11164, 0, 1, 25366, 0, 2, 15219, // 0, 1 - -1, 2, 12938, -1, 3, 10637, 0, 2, 26660, 0, 3, 15301, // 0, 2 - -1, 3, 12159, -1, 4, 10135, 0, 3, 27912, 0, 4, 15330, // 0, 3 - -1, 4, 11461, -1, 5, 9673, 0, 4, 29078, 0, 5, 15324, // 0, 4 - -1, 5, 10855, -1, 6, 9265, 0, 5, 30105, 0, 6, 15311, // 0, 5 - -1, 6, 10351, -1, 7, 8927, 0, 6, 30939, 0, 7, 15319, // 0, 6 - -1, 7, 9959, -1, 8, 8669, 0, 7, 31532, 0, 8, 15376, // 0, 7 - 0, 8, 31444, 0, 9, 15301, 1, 8, 10065, 1, 9, 8726, // 0, 8 - 0, 9, 30876, 0, 10, 15193, 1, 9, 10482, 1, 10, 8985, // 0, 9 - 0, 10, 30064, 0, 11, 15135, 1, 10, 11013, 1, 11, 9324, // 0,10 - 0, 11, 29055, 0, 12, 15100, 1, 11, 11652, 1, 12, 9729, // 0,11 - 0, 12, 27903, 0, 13, 15060, 1, 12, 12388, 1, 13, 10185, // 0,12 - 0, 13, 26660, 0, 14, 14990, 1, 13, 13211, 1, 14, 10675, // 0,13 - 0, 14, 25368, 0, 15, 14872, 1, 14, 14109, 1, 15, 11187, // 0,14 - 0, 15, 24063, 0, 16, 14696, 1, 15, 15076, 1, 16, 11701, // 0,15 - 0, 0, 14872, 0, 1, 11187, 1, 0, 25368, 1, 1, 14109, // 1, 0 - 0, 1, 13853, 0, 2, 10644, 1, 1, 26893, 1, 2, 14146, // 1, 1 - 0, 2, 12897, 0, 3, 10102, 1, 2, 28430, 1, 3, 14107, // 1, 2 - 0, 3, 12014, 0, 4, 9575, 1, 3, 29938, 1, 4, 14009, // 1, 3 - 0, 4, 11218, 0, 5, 9082, 1, 4, 31361, 1, 5, 13875, // 1, 4 - 0, 5, 10528, 0, 6, 8645, 1, 5, 32624, 1, 6, 13739, // 1, 5 - 0, 6, 9961, 0, 7, 8286, 1, 6, 33642, 1, 7, 13647, // 1, 6 - 0, 7, 9534, 0, 8, 8024, 1, 7, 34340, 1, 8, 13638, // 1, 7 - 1, 8, 34261, 1, 9, 13582, 2, 8, 9626, 2, 9, 8067, // 1, 8 - 1, 9, 33585, 1, 10, 13548, 2, 9, 10074, 2, 10, 8329, // 1, 9 - 1, 10, 32586, 1, 11, 13600, 2, 10, 10665, 2, 11, 8685, // 1,10 - 1, 11, 31339, 1, 12, 13694, 2, 11, 11385, 2, 12, 9118, // 1,11 - 1, 12, 29928, 1, 13, 13789, 2, 12, 12216, 2, 13, 9603, // 1,12 - 1, 13, 28427, 1, 14, 13850, 2, 13, 13141, 2, 14, 10118, // 1,13 - 1, 14, 26893, 1, 15, 13853, 2, 14, 14145, 2, 15, 10645, // 1,14 - 1, 15, 25366, 1, 16, 13787, 2, 15, 15220, 2, 16, 11163, // 1,15 - 1, 0, 14990, 1, 1, 10676, 2, 0, 26660, 2, 1, 13210, // 2, 0 - 1, 1, 13850, 1, 2, 10119, 2, 1, 28427, 2, 2, 13140, // 2, 1 - 1, 2, 12769, 1, 3, 9546, 2, 2, 30239, 2, 3, 12982, // 2, 2 - 1, 3, 11760, 1, 4, 8976, 2, 3, 32052, 2, 4, 12748, // 2, 3 - 1, 4, 10842, 1, 5, 8432, 2, 4, 33795, 2, 5, 12467, // 2, 4 - 1, 5, 10041, 1, 6, 7943, 2, 5, 35364, 2, 6, 12188, // 2, 5 - 1, 6, 9390, 1, 7, 7543, 2, 6, 36631, 2, 7, 11972, // 2, 6 - 1, 7, 8918, 1, 8, 7266, 2, 7, 37470, 2, 8, 11882, // 2, 7 - 2, 8, 37402, 2, 9, 11842, 3, 8, 8994, 3, 9, 7298, // 2, 8 - 2, 9, 36582, 2, 10, 11897, 3, 9, 9484, 3, 10, 7573, // 2, 9 - 2, 10, 35332, 2, 11, 12079, 3, 10, 10156, 3, 11, 7969, // 2,10 - 2, 11, 33777, 2, 12, 12323, 3, 11, 10983, 3, 12, 8453, // 2,11 - 2, 12, 32045, 2, 13, 12569, 3, 12, 11934, 3, 13, 8988, // 2,12 - 2, 13, 30239, 2, 14, 12769, 3, 13, 12982, 3, 14, 9546, // 2,13 - 2, 14, 28430, 2, 15, 12897, 3, 14, 14107, 3, 15, 10102, // 2,14 - 2, 15, 26660, 2, 16, 12938, 3, 15, 15301, 3, 16, 10637, // 2,15 - 2, 0, 15060, 2, 1, 10185, 3, 0, 27903, 3, 1, 12388, // 3, 0 - 2, 1, 13789, 2, 2, 9603, 3, 1, 29928, 3, 2, 12216, // 3, 1 - 2, 2, 12569, 2, 3, 8988, 3, 2, 32045, 3, 3, 11934, // 3, 2 - 2, 3, 11411, 2, 4, 8358, 3, 3, 34213, 3, 4, 11554, // 3, 3 - 2, 4, 10337, 2, 5, 7737, 3, 4, 36354, 3, 5, 11108, // 3, 4 - 2, 5, 9388, 2, 6, 7165, 3, 5, 38330, 3, 6, 10653, // 3, 5 - 2, 6, 8617, 2, 7, 6695, 3, 6, 39949, 3, 7, 10275, // 3, 6 - 2, 7, 8082, 2, 8, 6381, 3, 7, 40994, 3, 8, 10079, // 3, 7 - 3, 8, 40940, 3, 9, 10051, 4, 8, 8141, 4, 9, 6404, // 3, 8 - 3, 9, 39912, 3, 10, 10221, 4, 9, 8690, 4, 10, 6713, // 3, 9 - 3, 10, 38307, 3, 11, 10569, 4, 10, 9479, 4, 11, 7181, // 3,10 - 3, 11, 36343, 3, 12, 10995, 4, 11, 10452, 4, 12, 7746, // 3,11 - 3, 12, 34213, 3, 13, 11411, 4, 12, 11554, 4, 13, 8358, // 3,12 - 3, 13, 32052, 3, 14, 11760, 4, 13, 12747, 4, 14, 8977, // 3,13 - 3, 14, 29938, 3, 15, 12014, 4, 14, 14009, 4, 15, 9575, // 3,14 - 3, 15, 27912, 3, 16, 12159, 4, 15, 15330, 4, 16, 10135, // 3,15 - 3, 0, 15100, 3, 1, 9728, 4, 0, 29055, 4, 1, 11653, // 4, 0 - 3, 1, 13694, 3, 2, 9118, 4, 1, 31339, 4, 2, 11385, // 4, 1 - 3, 2, 12323, 3, 3, 8452, 4, 2, 33777, 4, 3, 10984, // 4, 2 - 3, 3, 10995, 3, 4, 7746, 4, 3, 36343, 4, 4, 10452, // 4, 3 - 3, 4, 9730, 3, 5, 7022, 4, 4, 38966, 4, 5, 9818, // 4, 4 - 3, 5, 8578, 3, 6, 6328, 4, 5, 41487, 4, 6, 9143, // 4, 5 - 3, 6, 7626, 3, 7, 5739, 4, 6, 43626, 4, 7, 8545, // 4, 6 - 3, 7, 6987, 3, 8, 5354, 4, 7, 44999, 4, 8, 8196, // 4, 7 - 4, 8, 44962, 4, 9, 8177, 5, 8, 7029, 5, 9, 5368, // 4, 8 - 4, 9, 43602, 4, 10, 8507, 5, 9, 7678, 5, 10, 5749, // 4, 9 - 4, 10, 41475, 4, 11, 9081, 5, 10, 8646, 5, 11, 6334, // 4,10 - 4, 11, 38966, 4, 12, 9730, 5, 11, 9818, 5, 12, 7022, // 4,11 - 4, 12, 36354, 4, 13, 10337, 5, 12, 11108, 5, 13, 7737, // 4,12 - 4, 13, 33795, 4, 14, 10842, 5, 13, 12467, 5, 14, 8432, // 4,13 - 4, 14, 31361, 4, 15, 11218, 5, 14, 13875, 5, 15, 9082, // 4,14 - 4, 15, 29078, 4, 16, 11461, 5, 15, 15325, 5, 16, 9672, // 4,15 - 4, 0, 15135, 4, 1, 9323, 5, 0, 30064, 5, 1, 11014, // 5, 0 - 4, 1, 13600, 4, 2, 8685, 5, 1, 32586, 5, 2, 10665, // 5, 1 - 4, 2, 12079, 4, 3, 7969, 5, 2, 35332, 5, 3, 10156, // 5, 2 - 4, 3, 10569, 4, 4, 7180, 5, 3, 38307, 5, 4, 9480, // 5, 3 - 4, 4, 9081, 4, 5, 6334, 5, 4, 41475, 5, 5, 8646, // 5, 4 - 4, 5, 7659, 4, 6, 5472, 5, 5, 44700, 5, 6, 7705, // 5, 5 - 4, 6, 6422, 4, 7, 4690, 5, 6, 47630, 5, 7, 6794, // 5, 6 - 4, 7, 5590, 4, 8, 4164, 5, 7, 49588, 5, 8, 6194, // 5, 7 - 5, 8, 49566, 5, 9, 6183, 6, 8, 5615, 6, 9, 4172, // 5, 8 - 5, 9, 47619, 5, 10, 6768, 6, 9, 6455, 6, 10, 4694, // 5, 9 - 5, 10, 44700, 5, 11, 7659, 6, 10, 7705, 6, 11, 5472, // 5,10 - 5, 11, 41487, 5, 12, 8578, 6, 11, 9143, 6, 12, 6328, // 5,11 - 5, 12, 38330, 5, 13, 9388, 6, 12, 10653, 6, 13, 7165, // 5,12 - 5, 13, 35364, 5, 14, 10041, 6, 13, 12188, 6, 14, 7943, // 5,13 - 5, 14, 32624, 5, 15, 10528, 6, 14, 13740, 6, 15, 8644, // 5,14 - 5, 15, 30105, 5, 16, 10855, 6, 15, 15311, 6, 16, 9265, // 5,15 - 5, 0, 15193, 5, 1, 8986, 6, 0, 30876, 6, 1, 10481, // 6, 0 - 5, 1, 13548, 5, 2, 8329, 6, 1, 33585, 6, 2, 10074, // 6, 1 - 5, 2, 11897, 5, 3, 7573, 6, 2, 36582, 6, 3, 9484, // 6, 2 - 5, 3, 10221, 5, 4, 6714, 6, 3, 39912, 6, 4, 8689, // 6, 3 - 5, 4, 8507, 5, 5, 5749, 6, 4, 43602, 6, 5, 7678, // 6, 4 - 5, 5, 6768, 5, 6, 4694, 6, 5, 47619, 6, 6, 6455, // 6, 5 - 5, 6, 5099, 5, 7, 3620, 6, 6, 51701, 6, 7, 5116, // 6, 6 - 5, 7, 3853, 5, 8, 2795, 6, 7, 54839, 6, 8, 4049, // 6, 7 - 6, 8, 54831, 6, 9, 4044, 7, 8, 3864, 7, 9, 2797, // 6, 8 - 6, 9, 51701, 6, 10, 5099, 7, 9, 5116, 7, 10, 3620, // 6, 9 - 6, 10, 47630, 6, 11, 6422, 7, 10, 6794, 7, 11, 4690, // 6,10 - 6, 11, 43626, 6, 12, 7626, 7, 11, 8545, 7, 12, 5739, // 6,11 - 6, 12, 39949, 6, 13, 8617, 7, 12, 10275, 7, 13, 6695, // 6,12 - 6, 13, 36631, 6, 14, 9390, 7, 13, 11972, 7, 14, 7543, // 6,13 - 6, 14, 33642, 6, 15, 9961, 7, 14, 13647, 7, 15, 8286, // 6,14 - 6, 15, 30939, 6, 16, 10351, 7, 15, 15319, 7, 16, 8927, // 6,15 - 6, 0, 15301, 6, 1, 8727, 7, 0, 31444, 7, 1, 10064, // 7, 0 - 6, 1, 13582, 6, 2, 8068, 7, 1, 34261, 7, 2, 9625, // 7, 1 - 6, 2, 11842, 6, 3, 7298, 7, 2, 37402, 7, 3, 8994, // 7, 2 - 6, 3, 10051, 6, 4, 6403, 7, 3, 40940, 7, 4, 8142, // 7, 3 - 6, 4, 8177, 6, 5, 5368, 7, 4, 44962, 7, 5, 7029, // 7, 4 - 6, 5, 6183, 6, 6, 4172, 7, 5, 49566, 7, 6, 5615, // 7, 5 - 6, 6, 4044, 6, 7, 2797, 7, 6, 54831, 7, 7, 3864, // 7, 6 - 6, 7, 1903, 6, 8, 1347, 7, 7, 60382, 7, 8, 1904, // 7, 7 - 7, 8, 60382, 7, 9, 1903, 8, 8, 1905, 8, 9, 1346, // 7, 8 - 7, 9, 54839, 7, 10, 3853, 8, 9, 4049, 8, 10, 2795, // 7, 9 - 7, 10, 49588, 7, 11, 5590, 8, 10, 6193, 8, 11, 4165, // 7,10 - 7, 11, 44999, 7, 12, 6987, 8, 11, 8195, 8, 12, 5355, // 7,11 - 7, 12, 40994, 7, 13, 8082, 8, 12, 10079, 8, 13, 6381, // 7,12 - 7, 13, 37470, 7, 14, 8918, 8, 13, 11883, 8, 14, 7265, // 7,13 - 7, 14, 34340, 7, 15, 9534, 8, 14, 13638, 8, 15, 8024, // 7,14 - 7, 15, 31532, 7, 16, 9959, 8, 15, 15376, 8, 16, 8669, // 7,15 - 7, -1, 8669, 7, 0, 15376, 8, -1, 9959, 8, 0, 31532, // 8, 0 - 7, 0, 8024, 7, 1, 13638, 8, 0, 9534, 8, 1, 34340, // 8, 1 - 7, 1, 7266, 7, 2, 11883, 8, 1, 8918, 8, 2, 37469, // 8, 2 - 7, 2, 6381, 7, 3, 10079, 8, 2, 8082, 8, 3, 40994, // 8, 3 - 7, 3, 5354, 7, 4, 8195, 8, 3, 6987, 8, 4, 45000, // 8, 4 - 7, 4, 4164, 7, 5, 6193, 8, 4, 5590, 8, 5, 49589, // 8, 5 - 7, 5, 2795, 7, 6, 4049, 8, 5, 3853, 8, 6, 54839, // 8, 6 - 7, 6, 1347, 7, 7, 1905, 8, 6, 1903, 8, 7, 60381, // 8, 7 - 8, 7, 1905, 8, 8, 60382, 9, 7, 1347, 9, 8, 1902, // 8, 8 - 8, 8, 3864, 8, 9, 54831, 9, 8, 2797, 9, 9, 4044, // 8, 9 - 8, 9, 5615, 8, 10, 49566, 9, 9, 4172, 9, 10, 6183, // 8,10 - 8, 10, 7029, 8, 11, 44962, 9, 10, 5368, 9, 11, 8177, // 8,11 - 8, 11, 8141, 8, 12, 40940, 9, 11, 6403, 9, 12, 10052, // 8,12 - 8, 12, 8994, 8, 13, 37402, 9, 12, 7298, 9, 13, 11842, // 8,13 - 8, 13, 9626, 8, 14, 34261, 9, 13, 8068, 9, 14, 13581, // 8,14 - 8, 14, 10065, 8, 15, 31444, 9, 14, 8727, 9, 15, 15300, // 8,15 - 8, -1, 8927, 8, 0, 15319, 9, -1, 10351, 9, 0, 30939, // 9, 0 - 8, 0, 8286, 8, 1, 13647, 9, 0, 9961, 9, 1, 33642, // 9, 1 - 8, 1, 7543, 8, 2, 11972, 9, 1, 9390, 9, 2, 36631, // 9, 2 - 8, 2, 6695, 8, 3, 10275, 9, 2, 8617, 9, 3, 39949, // 9, 3 - 8, 3, 5739, 8, 4, 8545, 9, 3, 7626, 9, 4, 43626, // 9, 4 - 8, 4, 4690, 8, 5, 6794, 9, 4, 6422, 9, 5, 47630, // 9, 5 - 8, 5, 3620, 8, 6, 5116, 9, 5, 5099, 9, 6, 51701, // 9, 6 - 8, 6, 2797, 8, 7, 3864, 9, 6, 4044, 9, 7, 54831, // 9, 7 - 9, 7, 4049, 9, 8, 54839, 10, 7, 2795, 10, 8, 3853, // 9, 8 - 9, 8, 5116, 9, 9, 51701, 10, 8, 3620, 10, 9, 5099, // 9, 9 - 9, 9, 6455, 9, 10, 47619, 10, 9, 4694, 10, 10, 6768, // 9,10 - 9, 10, 7678, 9, 11, 43602, 10, 10, 5749, 10, 11, 8507, // 9,11 - 9, 11, 8690, 9, 12, 39912, 10, 11, 6714, 10, 12, 10220, // 9,12 - 9, 12, 9484, 9, 13, 36582, 10, 12, 7573, 10, 13, 11897, // 9,13 - 9, 13, 10074, 9, 14, 33585, 10, 13, 8329, 10, 14, 13548, // 9,14 - 9, 14, 10482, 9, 15, 30876, 10, 14, 8986, 10, 15, 15192, // 9,15 - 9, -1, 9265, 9, 0, 15311, 10, -1, 10855, 10, 0, 30105, // 10, 0 - 9, 0, 8645, 9, 1, 13740, 10, 0, 10528, 10, 1, 32623, // 10, 1 - 9, 1, 7943, 9, 2, 12188, 10, 1, 10041, 10, 2, 35364, // 10, 2 - 9, 2, 7165, 9, 3, 10653, 10, 2, 9388, 10, 3, 38330, // 10, 3 - 9, 3, 6328, 9, 4, 9143, 10, 3, 8578, 10, 4, 41487, // 10, 4 - 9, 4, 5472, 9, 5, 7705, 10, 4, 7659, 10, 5, 44700, // 10, 5 - 9, 5, 4694, 9, 6, 6455, 10, 5, 6768, 10, 6, 47619, // 10, 6 - 9, 6, 4172, 9, 7, 5615, 10, 6, 6183, 10, 7, 49566, // 10, 7 - 10, 7, 6193, 10, 8, 49588, 11, 7, 4164, 11, 8, 5591, // 10, 8 - 10, 8, 6794, 10, 9, 47630, 11, 8, 4690, 11, 9, 6422, // 10, 9 - 10, 9, 7705, 10, 10, 44700, 11, 9, 5472, 11, 10, 7659, // 10,10 - 10, 10, 8646, 10, 11, 41475, 11, 10, 6334, 11, 11, 9081, // 10,11 - 10, 11, 9479, 10, 12, 38307, 11, 11, 7180, 11, 12, 10570, // 10,12 - 10, 12, 10156, 10, 13, 35332, 11, 12, 7969, 11, 13, 12079, // 10,13 - 10, 13, 10665, 10, 14, 32586, 11, 13, 8685, 11, 14, 13600, // 10,14 - 10, 14, 11013, 10, 15, 30064, 11, 14, 9323, 11, 15, 15136, // 10,15 - 10, -1, 9673, 10, 0, 15325, 11, -1, 11461, 11, 0, 29077, // 11, 0 - 10, 0, 9082, 10, 1, 13875, 11, 0, 11218, 11, 1, 31361, // 11, 1 - 10, 1, 8432, 10, 2, 12467, 11, 1, 10842, 11, 2, 33795, // 11, 2 - 10, 2, 7737, 10, 3, 11108, 11, 2, 10337, 11, 3, 36354, // 11, 3 - 10, 3, 7022, 10, 4, 9818, 11, 3, 9730, 11, 4, 38966, // 11, 4 - 10, 4, 6334, 10, 5, 8646, 11, 4, 9081, 11, 5, 41475, // 11, 5 - 10, 5, 5749, 10, 6, 7678, 11, 5, 8507, 11, 6, 43602, // 11, 6 - 10, 6, 5368, 10, 7, 7029, 11, 6, 8177, 11, 7, 44962, // 11, 7 - 11, 7, 8195, 11, 8, 44999, 12, 7, 5354, 12, 8, 6988, // 11, 8 - 11, 8, 8545, 11, 9, 43626, 12, 8, 5739, 12, 9, 7626, // 11, 9 - 11, 9, 9143, 11, 10, 41487, 12, 9, 6328, 12, 10, 8578, // 11,10 - 11, 10, 9818, 11, 11, 38966, 12, 10, 7022, 12, 11, 9730, // 11,11 - 11, 11, 10452, 11, 12, 36343, 12, 11, 7746, 12, 12, 10995, // 11,12 - 11, 12, 10983, 11, 13, 33777, 12, 12, 8452, 12, 13, 12324, // 11,13 - 11, 13, 11385, 11, 14, 31339, 12, 13, 9118, 12, 14, 13694, // 11,14 - 11, 14, 11652, 11, 15, 29055, 12, 14, 9728, 12, 15, 15101, // 11,15 - 11, -1, 10135, 11, 0, 15330, 12, -1, 12159, 12, 0, 27912, // 12, 0 - 11, 0, 9575, 11, 1, 14009, 12, 0, 12014, 12, 1, 29938, // 12, 1 - 11, 1, 8976, 11, 2, 12747, 12, 1, 11760, 12, 2, 32053, // 12, 2 - 11, 2, 8358, 11, 3, 11554, 12, 2, 11411, 12, 3, 34213, // 12, 3 - 11, 3, 7746, 11, 4, 10452, 12, 3, 10995, 12, 4, 36343, // 12, 4 - 11, 4, 7180, 11, 5, 9479, 12, 4, 10569, 12, 5, 38308, // 12, 5 - 11, 5, 6714, 11, 6, 8690, 12, 5, 10221, 12, 6, 39911, // 12, 6 - 11, 6, 6403, 11, 7, 8141, 12, 6, 10051, 12, 7, 40941, // 12, 7 - 12, 7, 10079, 12, 8, 40994, 13, 7, 6381, 13, 8, 8082, // 12, 8 - 12, 8, 10275, 12, 9, 39949, 13, 8, 6695, 13, 9, 8617, // 12, 9 - 12, 9, 10653, 12, 10, 38330, 13, 9, 7165, 13, 10, 9388, // 12,10 - 12, 10, 11108, 12, 11, 36354, 13, 10, 7737, 13, 11, 10337, // 12,11 - 12, 11, 11554, 12, 12, 34213, 13, 11, 8358, 13, 12, 11411, // 12,12 - 12, 12, 11934, 12, 13, 32045, 13, 12, 8988, 13, 13, 12569, // 12,13 - 12, 13, 12216, 12, 14, 29928, 13, 13, 9603, 13, 14, 13789, // 12,14 - 12, 14, 12388, 12, 15, 27903, 13, 14, 10185, 13, 15, 15060, // 12,15 - 12, -1, 10637, 12, 0, 15301, 13, -1, 12938, 13, 0, 26660, // 13, 0 - 12, 0, 10102, 12, 1, 14107, 13, 0, 12897, 13, 1, 28430, // 13, 1 - 12, 1, 9546, 12, 2, 12982, 13, 1, 12769, 13, 2, 30239, // 13, 2 - 12, 2, 8988, 12, 3, 11934, 13, 2, 12569, 13, 3, 32045, // 13, 3 - 12, 3, 8452, 12, 4, 10983, 13, 3, 12323, 13, 4, 33778, // 13, 4 - 12, 4, 7969, 12, 5, 10156, 13, 4, 12079, 13, 5, 35332, // 13, 5 - 12, 5, 7573, 12, 6, 9484, 13, 5, 11897, 13, 6, 36582, // 13, 6 - 12, 6, 7298, 12, 7, 8994, 13, 6, 11842, 13, 7, 37402, // 13, 7 - 13, 7, 11883, 13, 8, 37470, 14, 7, 7266, 14, 8, 8917, // 13, 8 - 13, 8, 11972, 13, 9, 36631, 14, 8, 7543, 14, 9, 9390, // 13, 9 - 13, 9, 12188, 13, 10, 35364, 14, 9, 7943, 14, 10, 10041, // 13,10 - 13, 10, 12467, 13, 11, 33795, 14, 10, 8432, 14, 11, 10842, // 13,11 - 13, 11, 12747, 13, 12, 32052, 14, 11, 8976, 14, 12, 11761, // 13,12 - 13, 12, 12982, 13, 13, 30239, 14, 12, 9546, 14, 13, 12769, // 13,13 - 13, 13, 13141, 13, 14, 28427, 14, 13, 10119, 14, 14, 13849, // 13,14 - 13, 14, 13211, 13, 15, 26660, 14, 14, 10676, 14, 15, 14989, // 13,15 - 13, -1, 11164, 13, 0, 15220, 14, -1, 13787, 14, 0, 25365, // 14, 0 - 13, 0, 10644, 13, 1, 14145, 14, 0, 13853, 14, 1, 26894, // 14, 1 - 13, 1, 10119, 13, 2, 13141, 14, 1, 13850, 14, 2, 28426, // 14, 2 - 13, 2, 9603, 13, 3, 12216, 14, 2, 13789, 14, 3, 29928, // 14, 3 - 13, 3, 9118, 13, 4, 11385, 14, 3, 13694, 14, 4, 31339, // 14, 4 - 13, 4, 8685, 13, 5, 10665, 14, 4, 13600, 14, 5, 32586, // 14, 5 - 13, 5, 8329, 13, 6, 10074, 14, 5, 13548, 14, 6, 33585, // 14, 6 - 13, 6, 8068, 13, 7, 9626, 14, 6, 13582, 14, 7, 34260, // 14, 7 - 14, 7, 13638, 14, 8, 34340, 15, 7, 8024, 15, 8, 9534, // 14, 8 - 14, 8, 13647, 14, 9, 33642, 15, 8, 8286, 15, 9, 9961, // 14, 9 - 14, 9, 13740, 14, 10, 32624, 15, 9, 8645, 15, 10, 10527, // 14,10 - 14, 10, 13875, 14, 11, 31361, 15, 10, 9082, 15, 11, 11218, // 14,11 - 14, 11, 14009, 14, 12, 29938, 15, 11, 9575, 15, 12, 12014, // 14,12 - 14, 12, 14107, 14, 13, 28430, 15, 12, 10102, 15, 13, 12897, // 14,13 - 14, 13, 14145, 14, 14, 26893, 15, 13, 10644, 15, 14, 13854, // 14,14 - 14, 14, 14109, 14, 15, 25368, 15, 14, 11187, 15, 15, 14872, // 14,15 - 14, -1, 11702, 14, 0, 15076, 15, -1, 14696, 15, 0, 24062, // 15, 0 - 14, 0, 11187, 14, 1, 14109, 15, 0, 14872, 15, 1, 25368, // 15, 1 - 14, 1, 10676, 14, 2, 13211, 15, 1, 14990, 15, 2, 26659, // 15, 2 - 14, 2, 10185, 14, 3, 12388, 15, 2, 15060, 15, 3, 27903, // 15, 3 - 14, 3, 9728, 14, 4, 11652, 15, 3, 15100, 15, 4, 29056, // 15, 4 - 14, 4, 9323, 14, 5, 11013, 15, 4, 15135, 15, 5, 30065, // 15, 5 - 14, 5, 8986, 14, 6, 10482, 15, 5, 15193, 15, 6, 30875, // 15, 6 - 14, 6, 8727, 14, 7, 10065, 15, 6, 15301, 15, 7, 31443, // 15, 7 - 15, 7, 15376, 15, 8, 31532, 16, 7, 8669, 16, 8, 9959, // 15, 8 - 15, 8, 15319, 15, 9, 30939, 16, 8, 8927, 16, 9, 10351, // 15, 9 - 15, 9, 15311, 15, 10, 30105, 16, 9, 9265, 16, 10, 10855, // 15,10 - 15, 10, 15325, 15, 11, 29078, 16, 10, 9673, 16, 11, 11460, // 15,11 - 15, 11, 15330, 15, 12, 27912, 16, 11, 10135, 16, 12, 12159, // 15,12 - 15, 12, 15301, 15, 13, 26660, 16, 12, 10637, 16, 13, 12938, // 15,13 - 15, 13, 15220, 15, 14, 25366, 16, 13, 11164, 16, 14, 13786, // 15,14 - 15, 14, 15076, 15, 15, 24063, 16, 14, 11702, 16, 15, 14695, // 15,15 - // angle of -2.0 degrees - -1, 0, 13368, -1, 1, 10104, 0, 0, 28495, 0, 1, 13569, // 0, 0 - -1, 1, 12574, -1, 2, 9662, 0, 1, 29831, 0, 2, 13469, // 0, 1 - -1, 2, 11829, -1, 3, 9229, 0, 2, 31146, 0, 3, 13332, // 0, 2 - -1, 3, 11143, -1, 4, 8816, 0, 3, 32406, 0, 4, 13171, // 0, 3 - -1, 4, 10528, -1, 5, 8438, 0, 4, 33564, 0, 5, 13006, // 0, 4 - -1, 5, 9995, -1, 6, 8107, 0, 5, 34567, 0, 6, 12867, // 0, 5 - -1, 6, 9558, -1, 7, 7839, 0, 6, 35362, 0, 7, 12777, // 0, 6 - -1, 7, 9224, -1, 8, 7643, 0, 7, 35905, 0, 8, 12764, // 0, 7 - 0, 8, 35844, 0, 9, 12728, 1, 8, 9290, 1, 9, 7674, // 0, 8 - 0, 9, 35315, 0, 10, 12717, 1, 9, 9635, 1, 10, 7869, // 0, 9 - 0, 10, 34532, 0, 11, 12783, 1, 10, 10086, 1, 11, 8135, // 0,10 - 0, 11, 33539, 0, 12, 12899, 1, 11, 10635, 1, 12, 8463, // 0,11 - 0, 12, 32391, 0, 13, 13038, 1, 12, 11269, 1, 13, 8838, // 0,12 - 0, 13, 31138, 0, 14, 13176, 1, 13, 11977, 1, 14, 9245, // 0,13 - 0, 14, 29828, 0, 15, 13291, 1, 14, 12746, 1, 15, 9671, // 0,14 - 0, 15, 28495, 0, 16, 13368, 1, 15, 13569, 1, 16, 10104, // 0,15 - 0, 0, 13291, 0, 1, 9671, 1, 0, 29828, 1, 1, 12746, // 1, 0 - 0, 1, 12412, 0, 2, 9202, 1, 1, 31358, 1, 2, 12564, // 1, 1 - 0, 2, 11580, 0, 3, 8735, 1, 2, 32886, 1, 3, 12335, // 1, 2 - 0, 3, 10808, 0, 4, 8284, 1, 3, 34369, 1, 4, 12075, // 1, 3 - 0, 4, 10111, 0, 5, 7865, 1, 4, 35750, 1, 5, 11810, // 1, 4 - 0, 5, 9509, 0, 6, 7497, 1, 5, 36955, 1, 6, 11575, // 1, 5 - 0, 6, 9020, 0, 7, 7202, 1, 6, 37906, 1, 7, 11408, // 1, 6 - 0, 7, 8662, 0, 8, 6997, 1, 7, 38534, 1, 8, 11343, // 1, 7 - 1, 8, 38481, 1, 9, 11317, 2, 8, 8718, 2, 9, 7020, // 1, 8 - 1, 9, 37866, 1, 10, 11360, 2, 9, 9086, 2, 10, 7224, // 1, 9 - 1, 10, 36926, 1, 11, 11507, 2, 10, 9587, 2, 11, 7516, // 1,10 - 1, 11, 35730, 1, 12, 11721, 2, 11, 10204, 2, 12, 7881, // 1,11 - 1, 12, 34358, 1, 13, 11964, 2, 12, 10918, 2, 13, 8296, // 1,12 - 1, 13, 32881, 1, 14, 12203, 2, 13, 11709, 2, 14, 8743, // 1,13 - 1, 14, 31358, 1, 15, 12412, 2, 14, 12564, 2, 15, 9202, // 1,14 - 1, 15, 29831, 1, 16, 12574, 2, 15, 13470, 2, 16, 9661, // 1,15 - 1, 0, 13176, 1, 1, 9245, 2, 0, 31138, 2, 1, 11977, // 2, 0 - 1, 1, 12203, 1, 2, 8742, 2, 1, 32881, 2, 2, 11710, // 2, 1 - 1, 2, 11272, 1, 3, 8232, 2, 2, 34650, 2, 3, 11382, // 2, 2 - 1, 3, 10397, 1, 4, 7728, 2, 3, 36399, 2, 4, 11012, // 2, 3 - 1, 4, 9597, 1, 5, 7252, 2, 4, 38057, 2, 5, 10630, // 2, 4 - 1, 5, 8902, 1, 6, 6829, 2, 5, 39526, 2, 6, 10279, // 2, 5 - 1, 6, 8344, 1, 7, 6491, 2, 6, 40688, 2, 7, 10013, // 2, 6 - 1, 7, 7951, 1, 8, 6266, 2, 7, 41432, 2, 8, 9887, // 2, 7 - 2, 8, 41389, 2, 9, 9867, 3, 8, 7996, 3, 9, 6284, // 2, 8 - 2, 9, 40656, 2, 10, 9977, 3, 9, 8397, 3, 10, 6506, // 2, 9 - 2, 10, 39503, 2, 11, 10226, 3, 10, 8966, 3, 11, 6841, // 2,10 - 2, 11, 38042, 2, 12, 10559, 3, 11, 9674, 3, 12, 7261, // 2,11 - 2, 12, 36392, 2, 13, 10922, 3, 12, 10488, 3, 13, 7734, // 2,12 - 2, 13, 34650, 2, 14, 11272, 3, 13, 11382, 3, 14, 8232, // 2,13 - 2, 14, 32886, 2, 15, 11580, 3, 14, 12334, 3, 15, 8736, // 2,14 - 2, 15, 31146, 2, 16, 11829, 3, 15, 13332, 3, 16, 9229, // 2,15 - 2, 0, 13038, 2, 1, 8838, 3, 0, 32391, 3, 1, 11269, // 3, 0 - 2, 1, 11964, 2, 2, 8296, 3, 1, 34358, 3, 2, 10918, // 3, 1 - 2, 2, 10922, 2, 3, 7734, 3, 2, 36392, 3, 3, 10488, // 3, 2 - 2, 3, 9924, 2, 4, 7164, 3, 3, 38450, 3, 4, 9998, // 3, 3 - 2, 4, 8995, 2, 5, 6611, 3, 4, 40452, 3, 5, 9478, // 3, 4 - 2, 5, 8175, 2, 6, 6108, 3, 5, 42271, 3, 6, 8982, // 3, 5 - 2, 6, 7516, 2, 7, 5703, 3, 6, 43733, 3, 7, 8584, // 3, 6 - 2, 7, 7072, 2, 8, 5443, 3, 7, 44649, 3, 8, 8372, // 3, 7 - 3, 8, 44616, 3, 9, 8359, 4, 8, 7106, 4, 9, 5455, // 3, 8 - 3, 9, 43710, 3, 10, 8558, 4, 9, 7556, 4, 10, 5712, // 3, 9 - 3, 10, 42256, 3, 11, 8940, 4, 10, 8224, 4, 11, 6116, // 3,10 - 3, 11, 40444, 3, 12, 9421, 4, 11, 9056, 4, 12, 6615, // 3,11 - 3, 12, 38450, 3, 13, 9924, 4, 12, 9998, 4, 13, 7164, // 3,12 - 3, 13, 36399, 3, 14, 10397, 4, 13, 11012, 4, 14, 7728, // 3,13 - 3, 14, 34369, 3, 15, 10808, 4, 14, 12074, 4, 15, 8285, // 3,14 - 3, 15, 32406, 3, 16, 11143, 4, 15, 13171, 4, 16, 8816, // 3,15 - 3, 0, 12899, 3, 1, 8463, 4, 0, 33539, 4, 1, 10635, // 4, 0 - 3, 1, 11721, 3, 2, 7881, 4, 1, 35730, 4, 2, 10204, // 4, 1 - 3, 2, 10559, 3, 3, 7261, 4, 2, 38042, 4, 3, 9674, // 4, 2 - 3, 3, 9421, 3, 4, 6615, 4, 3, 40444, 4, 4, 9056, // 4, 3 - 3, 4, 8332, 3, 5, 5965, 4, 4, 42861, 4, 5, 8378, // 4, 4 - 3, 5, 7342, 3, 6, 5350, 4, 5, 45146, 4, 6, 7698, // 4, 5 - 3, 6, 6530, 3, 7, 4838, 4, 6, 47049, 4, 7, 7119, // 4, 6 - 3, 7, 6000, 3, 8, 4513, 4, 7, 48240, 4, 8, 6783, // 4, 7 - 4, 8, 48218, 4, 9, 6774, 5, 8, 6023, 5, 9, 4521, // 4, 8 - 4, 9, 47035, 4, 10, 7100, 5, 9, 6558, 5, 10, 4843, // 4, 9 - 4, 10, 45139, 4, 11, 7667, 5, 10, 7377, 5, 11, 5353, // 4,10 - 4, 11, 42861, 4, 12, 8332, 5, 11, 8378, 5, 12, 5965, // 4,11 - 4, 12, 40452, 4, 13, 8995, 5, 12, 9478, 5, 13, 6611, // 4,12 - 4, 13, 38057, 4, 14, 9597, 5, 13, 10630, 5, 14, 7252, // 4,13 - 4, 14, 35750, 4, 15, 10111, 5, 14, 11810, 5, 15, 7865, // 4,14 - 4, 15, 33564, 4, 16, 10528, 5, 15, 13007, 5, 16, 8437, // 4,15 - 4, 0, 12783, 4, 1, 8135, 5, 0, 34532, 5, 1, 10086, // 5, 0 - 4, 1, 11507, 4, 2, 7517, 5, 1, 36926, 5, 2, 9586, // 5, 1 - 4, 2, 10226, 4, 3, 6842, 5, 2, 39503, 5, 3, 8965, // 5, 2 - 4, 3, 8940, 4, 4, 6116, 5, 3, 42256, 5, 4, 8224, // 5, 3 - 4, 4, 7667, 4, 5, 5353, 5, 4, 45139, 5, 5, 7377, // 5, 4 - 4, 5, 6451, 4, 6, 4591, 5, 5, 48019, 5, 6, 6475, // 5, 5 - 4, 6, 5400, 4, 7, 3911, 5, 6, 50587, 5, 7, 5638, // 5, 6 - 4, 7, 4708, 4, 8, 3466, 5, 7, 52266, 5, 8, 5096, // 5, 7 - 5, 8, 52253, 5, 9, 5092, 6, 8, 4721, 6, 9, 3470, // 5, 8 - 5, 9, 50581, 5, 10, 5624, 6, 9, 5418, 6, 10, 3913, // 5, 9 - 5, 10, 48019, 5, 11, 6451, 6, 10, 6475, 6, 11, 4591, // 5,10 - 5, 11, 45146, 5, 12, 7342, 6, 11, 7698, 6, 12, 5350, // 5,11 - 5, 12, 42271, 5, 13, 8175, 6, 12, 8982, 6, 13, 6108, // 5,12 - 5, 13, 39526, 5, 14, 8902, 6, 13, 10279, 6, 14, 6829, // 5,13 - 5, 14, 36955, 5, 15, 9509, 6, 14, 11575, 6, 15, 7497, // 5,14 - 5, 15, 34567, 5, 16, 9995, 6, 15, 12867, 6, 16, 8107, // 5,15 - 5, 0, 12717, 5, 1, 7868, 6, 0, 35315, 6, 1, 9636, // 6, 0 - 5, 1, 11360, 5, 2, 7224, 6, 1, 37866, 6, 2, 9086, // 6, 1 - 5, 2, 9977, 5, 3, 6506, 6, 2, 40656, 6, 3, 8397, // 6, 2 - 5, 3, 8558, 5, 4, 5712, 6, 3, 43710, 6, 4, 7556, // 6, 3 - 5, 4, 7100, 5, 5, 4843, 6, 4, 47035, 6, 5, 6558, // 6, 4 - 5, 5, 5624, 5, 6, 3913, 6, 5, 50581, 6, 6, 5418, // 6, 5 - 5, 6, 4217, 5, 7, 2989, 6, 6, 54105, 6, 7, 4225, // 6, 6 - 5, 7, 3180, 5, 8, 2294, 6, 7, 56756, 6, 8, 3306, // 6, 7 - 6, 8, 56751, 6, 9, 3303, 7, 8, 3186, 7, 9, 2296, // 6, 8 - 6, 9, 54105, 6, 10, 4217, 7, 9, 4225, 7, 10, 2989, // 6, 9 - 6, 10, 50587, 6, 11, 5400, 7, 10, 5637, 7, 11, 3912, // 6,10 - 6, 11, 47049, 6, 12, 6530, 7, 11, 7119, 7, 12, 4838, // 6,11 - 6, 12, 43733, 6, 13, 7516, 7, 12, 8584, 7, 13, 5703, // 6,12 - 6, 13, 40688, 6, 14, 8344, 7, 13, 10013, 7, 14, 6491, // 6,13 - 6, 14, 37906, 6, 15, 9020, 7, 14, 11407, 7, 15, 7203, // 6,14 - 6, 15, 35362, 6, 16, 9558, 7, 15, 12777, 7, 16, 7839, // 6,15 - 6, 0, 12728, 6, 1, 7674, 7, 0, 35844, 7, 1, 9290, // 7, 0 - 6, 1, 11317, 6, 2, 7020, 7, 1, 38481, 7, 2, 8718, // 7, 1 - 6, 2, 9867, 6, 3, 6284, 7, 2, 41389, 7, 3, 7996, // 7, 2 - 6, 3, 8359, 6, 4, 5454, 7, 3, 44616, 7, 4, 7107, // 7, 3 - 6, 4, 6774, 6, 5, 4521, 7, 4, 48218, 7, 5, 6023, // 7, 4 - 6, 5, 5092, 6, 6, 3470, 7, 5, 52253, 7, 6, 4721, // 7, 5 - 6, 6, 3303, 6, 7, 2295, 7, 6, 56751, 7, 7, 3187, // 7, 6 - 6, 7, 1541, 6, 8, 1090, 7, 7, 61364, 7, 8, 1541, // 7, 7 - 7, 8, 61364, 7, 9, 1541, 8, 8, 1542, 8, 9, 1089, // 7, 8 - 7, 9, 56756, 7, 10, 3180, 8, 9, 3306, 8, 10, 2294, // 7, 9 - 7, 10, 52266, 7, 11, 4708, 8, 10, 5097, 8, 11, 3465, // 7,10 - 7, 11, 48240, 7, 12, 6000, 8, 11, 6783, 8, 12, 4513, // 7,11 - 7, 12, 44649, 7, 13, 7072, 8, 12, 8373, 8, 13, 5442, // 7,12 - 7, 13, 41432, 7, 14, 7951, 8, 13, 9886, 8, 14, 6267, // 7,13 - 7, 14, 38534, 7, 15, 8662, 8, 14, 11344, 8, 15, 6996, // 7,14 - 7, 15, 35905, 7, 16, 9224, 8, 15, 12764, 8, 16, 7643, // 7,15 - 7, -1, 7643, 7, 0, 12764, 8, -1, 9224, 8, 0, 35905, // 8, 0 - 7, 0, 6997, 7, 1, 11344, 8, 0, 8662, 8, 1, 38533, // 8, 1 - 7, 1, 6266, 7, 2, 9886, 8, 1, 7951, 8, 2, 41433, // 8, 2 - 7, 2, 5443, 7, 3, 8373, 8, 2, 7072, 8, 3, 44648, // 8, 3 - 7, 3, 4513, 7, 4, 6783, 8, 3, 6000, 8, 4, 48240, // 8, 4 - 7, 4, 3466, 7, 5, 5097, 8, 4, 4708, 8, 5, 52265, // 8, 5 - 7, 5, 2294, 7, 6, 3306, 8, 5, 3180, 8, 6, 56756, // 8, 6 - 7, 6, 1090, 7, 7, 1542, 8, 6, 1541, 8, 7, 61363, // 8, 7 - 8, 7, 1542, 8, 8, 61364, 9, 7, 1090, 9, 8, 1540, // 8, 8 - 8, 8, 3186, 8, 9, 56751, 9, 8, 2295, 9, 9, 3304, // 8, 9 - 8, 9, 4721, 8, 10, 52253, 9, 9, 3470, 9, 10, 5092, // 8,10 - 8, 10, 6023, 8, 11, 48218, 9, 10, 4521, 9, 11, 6774, // 8,11 - 8, 11, 7106, 8, 12, 44616, 9, 11, 5454, 9, 12, 8360, // 8,12 - 8, 12, 7996, 8, 13, 41389, 9, 12, 6284, 9, 13, 9867, // 8,13 - 8, 13, 8718, 8, 14, 38481, 9, 13, 7020, 9, 14, 11317, // 8,14 - 8, 14, 9290, 8, 15, 35844, 9, 14, 7674, 9, 15, 12728, // 8,15 - 8, -1, 7839, 8, 0, 12777, 9, -1, 9558, 9, 0, 35362, // 9, 0 - 8, 0, 7202, 8, 1, 11407, 9, 0, 9020, 9, 1, 37907, // 9, 1 - 8, 1, 6491, 8, 2, 10013, 9, 1, 8344, 9, 2, 40688, // 9, 2 - 8, 2, 5703, 8, 3, 8584, 9, 2, 7516, 9, 3, 43733, // 9, 3 - 8, 3, 4838, 8, 4, 7119, 9, 3, 6530, 9, 4, 47049, // 9, 4 - 8, 4, 3911, 8, 5, 5637, 9, 4, 5400, 9, 5, 50588, // 9, 5 - 8, 5, 2989, 8, 6, 4225, 9, 5, 4217, 9, 6, 54105, // 9, 6 - 8, 6, 2295, 8, 7, 3186, 9, 6, 3303, 9, 7, 56752, // 9, 7 - 9, 7, 3306, 9, 8, 56756, 10, 7, 2294, 10, 8, 3180, // 9, 8 - 9, 8, 4225, 9, 9, 54105, 10, 8, 2989, 10, 9, 4217, // 9, 9 - 9, 9, 5418, 9, 10, 50581, 10, 9, 3913, 10, 10, 5624, // 9,10 - 9, 10, 6558, 9, 11, 47035, 10, 10, 4843, 10, 11, 7100, // 9,11 - 9, 11, 7556, 9, 12, 43710, 10, 11, 5712, 10, 12, 8558, // 9,12 - 9, 12, 8397, 9, 13, 40656, 10, 12, 6506, 10, 13, 9977, // 9,13 - 9, 13, 9086, 9, 14, 37866, 10, 13, 7224, 10, 14, 11360, // 9,14 - 9, 14, 9635, 9, 15, 35315, 10, 14, 7868, 10, 15, 12718, // 9,15 - 9, -1, 8107, 9, 0, 12867, 10, -1, 9995, 10, 0, 34567, // 10, 0 - 9, 0, 7497, 9, 1, 11575, 10, 0, 9509, 10, 1, 36955, // 10, 1 - 9, 1, 6829, 9, 2, 10279, 10, 1, 8902, 10, 2, 39526, // 10, 2 - 9, 2, 6108, 9, 3, 8982, 10, 2, 8175, 10, 3, 42271, // 10, 3 - 9, 3, 5350, 9, 4, 7698, 10, 3, 7342, 10, 4, 45146, // 10, 4 - 9, 4, 4591, 9, 5, 6475, 10, 4, 6451, 10, 5, 48019, // 10, 5 - 9, 5, 3913, 9, 6, 5418, 10, 5, 5624, 10, 6, 50581, // 10, 6 - 9, 6, 3470, 9, 7, 4721, 10, 6, 5092, 10, 7, 52253, // 10, 7 - 10, 7, 5097, 10, 8, 52266, 11, 7, 3466, 11, 8, 4707, // 10, 8 - 10, 8, 5637, 10, 9, 50587, 11, 8, 3911, 11, 9, 5401, // 10, 9 - 10, 9, 6475, 10, 10, 48019, 11, 9, 4591, 11, 10, 6451, // 10,10 - 10, 10, 7377, 10, 11, 45139, 11, 10, 5353, 11, 11, 7667, // 10,11 - 10, 11, 8224, 10, 12, 42256, 11, 11, 6116, 11, 12, 8940, // 10,12 - 10, 12, 8966, 10, 13, 39503, 11, 12, 6842, 11, 13, 10225, // 10,13 - 10, 13, 9587, 10, 14, 36926, 11, 13, 7517, 11, 14, 11506, // 10,14 - 10, 14, 10086, 10, 15, 34532, 11, 14, 8135, 11, 15, 12783, // 10,15 - 10, -1, 8438, 10, 0, 13007, 11, -1, 10528, 11, 0, 33563, // 11, 0 - 10, 0, 7865, 10, 1, 11810, 11, 0, 10111, 11, 1, 35750, // 11, 1 - 10, 1, 7252, 10, 2, 10630, 11, 1, 9597, 11, 2, 38057, // 11, 2 - 10, 2, 6611, 10, 3, 9478, 11, 2, 8995, 11, 3, 40452, // 11, 3 - 10, 3, 5965, 10, 4, 8378, 11, 3, 8332, 11, 4, 42861, // 11, 4 - 10, 4, 5353, 10, 5, 7377, 11, 4, 7667, 11, 5, 45139, // 11, 5 - 10, 5, 4843, 10, 6, 6558, 11, 5, 7100, 11, 6, 47035, // 11, 6 - 10, 6, 4521, 10, 7, 6023, 11, 6, 6774, 11, 7, 48218, // 11, 7 - 11, 7, 6783, 11, 8, 48240, 12, 7, 4513, 12, 8, 6000, // 11, 8 - 11, 8, 7119, 11, 9, 47049, 12, 8, 4838, 12, 9, 6530, // 11, 9 - 11, 9, 7698, 11, 10, 45146, 12, 9, 5350, 12, 10, 7342, // 11,10 - 11, 10, 8378, 11, 11, 42861, 12, 10, 5965, 12, 11, 8332, // 11,11 - 11, 11, 9056, 11, 12, 40444, 12, 11, 6615, 12, 12, 9421, // 11,12 - 11, 12, 9674, 11, 13, 38042, 12, 12, 7261, 12, 13, 10559, // 11,13 - 11, 13, 10204, 11, 14, 35730, 12, 13, 7881, 12, 14, 11721, // 11,14 - 11, 14, 10635, 11, 15, 33539, 12, 14, 8463, 12, 15, 12899, // 11,15 - 11, -1, 8816, 11, 0, 13171, 12, -1, 11143, 12, 0, 32406, // 12, 0 - 11, 0, 8284, 11, 1, 12074, 12, 0, 10808, 12, 1, 34370, // 12, 1 - 11, 1, 7728, 11, 2, 11012, 12, 1, 10397, 12, 2, 36399, // 12, 2 - 11, 2, 7164, 11, 3, 9998, 12, 2, 9924, 12, 3, 38450, // 12, 3 - 11, 3, 6615, 11, 4, 9056, 12, 3, 9421, 12, 4, 40444, // 12, 4 - 11, 4, 6116, 11, 5, 8224, 12, 4, 8940, 12, 5, 42256, // 12, 5 - 11, 5, 5712, 11, 6, 7556, 12, 5, 8558, 12, 6, 43710, // 12, 6 - 11, 6, 5454, 11, 7, 7106, 12, 6, 8359, 12, 7, 44617, // 12, 7 - 12, 7, 8373, 12, 8, 44649, 13, 7, 5443, 13, 8, 7071, // 12, 8 - 12, 8, 8584, 12, 9, 43733, 13, 8, 5703, 13, 9, 7516, // 12, 9 - 12, 9, 8982, 12, 10, 42271, 13, 9, 6108, 13, 10, 8175, // 12,10 - 12, 10, 9478, 12, 11, 40452, 13, 10, 6611, 13, 11, 8995, // 12,11 - 12, 11, 9998, 12, 12, 38450, 13, 11, 7164, 13, 12, 9924, // 12,12 - 12, 12, 10488, 12, 13, 36392, 13, 12, 7734, 13, 13, 10922, // 12,13 - 12, 13, 10918, 12, 14, 34358, 13, 13, 8296, 13, 14, 11964, // 12,14 - 12, 14, 11269, 12, 15, 32391, 13, 14, 8838, 13, 15, 13038, // 12,15 - 12, -1, 9229, 12, 0, 13332, 13, -1, 11829, 13, 0, 31146, // 13, 0 - 12, 0, 8735, 12, 1, 12334, 13, 0, 11580, 13, 1, 32887, // 13, 1 - 12, 1, 8232, 12, 2, 11382, 13, 1, 11272, 13, 2, 34650, // 13, 2 - 12, 2, 7734, 12, 3, 10488, 13, 2, 10922, 13, 3, 36392, // 13, 3 - 12, 3, 7261, 12, 4, 9674, 13, 3, 10559, 13, 4, 38042, // 13, 4 - 12, 4, 6842, 12, 5, 8966, 13, 4, 10226, 13, 5, 39502, // 13, 5 - 12, 5, 6506, 12, 6, 8397, 13, 5, 9977, 13, 6, 40656, // 13, 6 - 12, 6, 6284, 12, 7, 7996, 13, 6, 9867, 13, 7, 41389, // 13, 7 - 13, 7, 9886, 13, 8, 41432, 14, 7, 6266, 14, 8, 7952, // 13, 8 - 13, 8, 10013, 13, 9, 40688, 14, 8, 6491, 14, 9, 8344, // 13, 9 - 13, 9, 10279, 13, 10, 39526, 14, 9, 6829, 14, 10, 8902, // 13,10 - 13, 10, 10630, 13, 11, 38057, 14, 10, 7252, 14, 11, 9597, // 13,11 - 13, 11, 11012, 13, 12, 36399, 14, 11, 7728, 14, 12, 10397, // 13,12 - 13, 12, 11382, 13, 13, 34650, 14, 12, 8232, 14, 13, 11272, // 13,13 - 13, 13, 11709, 13, 14, 32881, 14, 13, 8742, 14, 14, 12204, // 13,14 - 13, 14, 11977, 13, 15, 31138, 14, 14, 9245, 14, 15, 13176, // 13,15 - 13, -1, 9662, 13, 0, 13470, 14, -1, 12574, 14, 0, 29830, // 14, 0 - 13, 0, 9202, 13, 1, 12564, 14, 0, 12412, 14, 1, 31358, // 14, 1 - 13, 1, 8742, 13, 2, 11709, 14, 1, 12203, 14, 2, 32882, // 14, 2 - 13, 2, 8296, 13, 3, 10918, 14, 2, 11964, 14, 3, 34358, // 14, 3 - 13, 3, 7881, 13, 4, 10204, 14, 3, 11721, 14, 4, 35730, // 14, 4 - 13, 4, 7517, 13, 5, 9587, 14, 4, 11507, 14, 5, 36925, // 14, 5 - 13, 5, 7224, 13, 6, 9086, 14, 5, 11360, 14, 6, 37866, // 14, 6 - 13, 6, 7020, 13, 7, 8718, 14, 6, 11317, 14, 7, 38481, // 14, 7 - 14, 7, 11344, 14, 8, 38534, 15, 7, 6997, 15, 8, 8661, // 14, 8 - 14, 8, 11407, 14, 9, 37906, 15, 8, 7202, 15, 9, 9021, // 14, 9 - 14, 9, 11575, 14, 10, 36955, 15, 9, 7497, 15, 10, 9509, // 14,10 - 14, 10, 11810, 14, 11, 35750, 15, 10, 7865, 15, 11, 10111, // 14,11 - 14, 11, 12074, 14, 12, 34369, 15, 11, 8284, 15, 12, 10809, // 14,12 - 14, 12, 12334, 14, 13, 32886, 15, 12, 8735, 15, 13, 11581, // 14,13 - 14, 13, 12564, 14, 14, 31358, 15, 13, 9202, 15, 14, 12412, // 14,14 - 14, 14, 12746, 14, 15, 29828, 15, 14, 9671, 15, 15, 13291, // 14,15 - 14, -1, 10104, 14, 0, 13569, 15, -1, 13368, 15, 0, 28495, // 15, 0 - 14, 0, 9671, 14, 1, 12746, 15, 0, 13291, 15, 1, 29828, // 15, 1 - 14, 1, 9245, 14, 2, 11977, 15, 1, 13176, 15, 2, 31138, // 15, 2 - 14, 2, 8838, 14, 3, 11269, 15, 2, 13038, 15, 3, 32391, // 15, 3 - 14, 3, 8463, 14, 4, 10635, 15, 3, 12899, 15, 4, 33539, // 15, 4 - 14, 4, 8135, 14, 5, 10086, 15, 4, 12783, 15, 5, 34532, // 15, 5 - 14, 5, 7868, 14, 6, 9635, 15, 5, 12717, 15, 6, 35316, // 15, 6 - 14, 6, 7674, 14, 7, 9290, 15, 6, 12728, 15, 7, 35844, // 15, 7 - 15, 7, 12764, 15, 8, 35905, 16, 7, 7643, 16, 8, 9224, // 15, 8 - 15, 8, 12777, 15, 9, 35362, 16, 8, 7839, 16, 9, 9558, // 15, 9 - 15, 9, 12867, 15, 10, 34567, 16, 9, 8107, 16, 10, 9995, // 15,10 - 15, 10, 13007, 15, 11, 33564, 16, 10, 8438, 16, 11, 10527, // 15,11 - 15, 11, 13171, 15, 12, 32406, 16, 11, 8816, 16, 12, 11143, // 15,12 - 15, 12, 13332, 15, 13, 31146, 16, 12, 9229, 16, 13, 11829, // 15,13 - 15, 13, 13470, 15, 14, 29831, 16, 13, 9662, 16, 14, 12573, // 15,14 - 15, 14, 13569, 15, 15, 28495, 16, 14, 10104, 16, 15, 13368, // 15,15 - // angle of -1.5 degrees - -1, 0, 11440, -1, 1, 8358, 0, 0, 34212, 0, 1, 11526, // 0, 0 - -1, 1, 10780, -1, 2, 7983, 0, 1, 35506, 0, 2, 11267, // 0, 1 - -1, 2, 10158, -1, 3, 7620, 0, 2, 36764, 0, 3, 10994, // 0, 2 - -1, 3, 9585, -1, 4, 7276, 0, 3, 37951, 0, 4, 10724, // 0, 3 - -1, 4, 9072, -1, 5, 6965, 0, 4, 39026, 0, 5, 10473, // 0, 4 - -1, 5, 8632, -1, 6, 6699, 0, 5, 39940, 0, 6, 10265, // 0, 5 - -1, 6, 8278, -1, 7, 6489, 0, 6, 40646, 0, 7, 10123, // 0, 6 - -1, 7, 8018, -1, 8, 6346, 0, 7, 41106, 0, 8, 10066, // 0, 7 - 0, 8, 41072, 0, 9, 10052, 1, 8, 8052, 1, 9, 6360, // 0, 8 - 0, 9, 40618, 0, 10, 10100, 1, 9, 8316, 1, 10, 6502, // 0, 9 - 0, 10, 39918, 0, 11, 10232, 1, 10, 8676, 1, 11, 6710, // 0,10 - 0, 11, 39009, 0, 12, 10430, 1, 11, 9122, 1, 12, 6975, // 0,11 - 0, 12, 37939, 0, 13, 10670, 1, 12, 9642, 1, 13, 7285, // 0,12 - 0, 13, 36756, 0, 14, 10930, 1, 13, 10224, 1, 14, 7626, // 0,13 - 0, 14, 35502, 0, 15, 11192, 1, 14, 10855, 1, 15, 7987, // 0,14 - 0, 15, 34212, 0, 16, 11440, 1, 15, 11526, 1, 16, 8358, // 0,15 - 0, 0, 11192, 0, 1, 7987, 1, 0, 35502, 1, 1, 10855, // 1, 0 - 0, 1, 10467, 0, 2, 7579, 1, 1, 36959, 1, 2, 10531, // 1, 1 - 0, 2, 9777, 0, 3, 7177, 1, 2, 38394, 1, 3, 10188, // 1, 2 - 0, 3, 9135, 0, 4, 6792, 1, 3, 39767, 1, 4, 9842, // 1, 3 - 0, 4, 8557, 0, 5, 6440, 1, 4, 41026, 1, 5, 9513, // 1, 4 - 0, 5, 8061, 0, 6, 6137, 1, 5, 42105, 1, 6, 9233, // 1, 5 - 0, 6, 7667, 0, 7, 5900, 1, 6, 42936, 1, 7, 9033, // 1, 6 - 0, 7, 7390, 0, 8, 5745, 1, 7, 43461, 1, 8, 8940, // 1, 7 - 1, 8, 43433, 1, 9, 8929, 2, 8, 7418, 2, 9, 5756, // 1, 8 - 1, 9, 42913, 1, 10, 9014, 2, 9, 7699, 2, 10, 5910, // 1, 9 - 1, 10, 42087, 1, 11, 9206, 2, 10, 8098, 2, 11, 6145, // 1,10 - 1, 11, 41013, 1, 12, 9478, 2, 11, 8599, 2, 12, 6446, // 1,11 - 1, 12, 39759, 1, 13, 9796, 2, 12, 9184, 2, 13, 6797, // 1,12 - 1, 13, 38390, 1, 14, 10133, 2, 13, 9834, 2, 14, 7179, // 1,13 - 1, 14, 36959, 1, 15, 10467, 2, 14, 10532, 2, 15, 7578, // 1,14 - 1, 15, 35506, 1, 16, 10780, 2, 15, 11267, 2, 16, 7983, // 1,15 - 1, 0, 10930, 1, 1, 7626, 2, 0, 36756, 2, 1, 10224, // 2, 0 - 1, 1, 10133, 1, 2, 7179, 2, 1, 38390, 2, 2, 9834, // 2, 1 - 1, 2, 9366, 1, 3, 6732, 2, 2, 40025, 2, 3, 9413, // 2, 2 - 1, 3, 8641, 1, 4, 6297, 2, 3, 41618, 2, 4, 8980, // 2, 3 - 1, 4, 7981, 1, 5, 5891, 2, 4, 43105, 2, 5, 8559, // 2, 4 - 1, 5, 7411, 1, 6, 5537, 2, 5, 44399, 2, 6, 8189, // 2, 5 - 1, 6, 6961, 1, 7, 5261, 2, 6, 45401, 2, 7, 7913, // 2, 6 - 1, 7, 6658, 1, 8, 5087, 2, 7, 46017, 2, 8, 7774, // 2, 7 - 2, 8, 45995, 2, 9, 7766, 3, 8, 6680, 3, 9, 5095, // 2, 8 - 2, 9, 45383, 2, 10, 7899, 3, 9, 6986, 3, 10, 5268, // 2, 9 - 2, 10, 44386, 2, 11, 8167, 3, 10, 7440, 3, 11, 5543, // 2,10 - 2, 11, 43096, 2, 12, 8530, 3, 11, 8015, 3, 12, 5895, // 2,11 - 2, 12, 41614, 2, 13, 8941, 3, 12, 8681, 3, 13, 6300, // 2,12 - 2, 13, 40025, 2, 14, 9366, 3, 13, 9413, 3, 14, 6732, // 2,13 - 2, 14, 38394, 2, 15, 9777, 3, 14, 10188, 3, 15, 7177, // 2,14 - 2, 15, 36764, 2, 16, 10158, 3, 15, 10994, 3, 16, 7620, // 2,15 - 2, 0, 10670, 2, 1, 7285, 3, 0, 37939, 3, 1, 9642, // 3, 0 - 2, 1, 9796, 2, 2, 6797, 3, 1, 39759, 3, 2, 9184, // 3, 1 - 2, 2, 8941, 2, 3, 6299, 3, 2, 41614, 3, 3, 8682, // 3, 2 - 2, 3, 8120, 2, 4, 5804, 3, 3, 43461, 3, 4, 8151, // 3, 3 - 2, 4, 7356, 2, 5, 5330, 3, 4, 45229, 3, 5, 7621, // 3, 4 - 2, 5, 6685, 2, 6, 4906, 3, 5, 46806, 3, 6, 7139, // 3, 5 - 2, 6, 6154, 2, 7, 4572, 3, 6, 48049, 3, 7, 6761, // 3, 6 - 2, 7, 5811, 2, 8, 4366, 3, 7, 48801, 3, 8, 6558, // 3, 7 - 3, 8, 48785, 3, 9, 6552, 4, 8, 5827, 4, 9, 4372, // 3, 8 - 3, 9, 48037, 3, 10, 6750, 4, 9, 6173, 4, 10, 4576, // 3, 9 - 3, 10, 46798, 3, 11, 7121, 4, 10, 6707, 4, 11, 4910, // 3,10 - 3, 11, 45224, 3, 12, 7598, 4, 11, 7382, 4, 12, 5332, // 3,11 - 3, 12, 43461, 3, 13, 8120, 4, 12, 8151, 4, 13, 5804, // 3,12 - 3, 13, 41618, 3, 14, 8641, 4, 13, 8979, 4, 14, 6298, // 3,13 - 3, 14, 39767, 3, 15, 9135, 4, 14, 9841, 4, 15, 6793, // 3,14 - 3, 15, 37951, 3, 16, 9585, 4, 15, 10723, 4, 16, 7277, // 3,15 - 3, 0, 10430, 3, 1, 6975, 4, 0, 39009, 4, 1, 9122, // 4, 0 - 3, 1, 9478, 3, 2, 6447, 4, 1, 41013, 4, 2, 8598, // 4, 1 - 3, 2, 8530, 3, 3, 5895, 4, 2, 43096, 4, 3, 8015, // 4, 2 - 3, 3, 7598, 3, 4, 5331, 4, 3, 45224, 4, 4, 7383, // 4, 3 - 3, 4, 6708, 3, 5, 4774, 4, 4, 47328, 4, 5, 6726, // 4, 4 - 3, 5, 5901, 3, 6, 4257, 4, 5, 49279, 4, 6, 6099, // 4, 5 - 3, 6, 5248, 3, 7, 3834, 4, 6, 50873, 4, 7, 5581, // 4, 6 - 3, 7, 4835, 3, 8, 3575, 4, 7, 51842, 4, 8, 5284, // 4, 7 - 4, 8, 51832, 4, 9, 5280, 5, 8, 4846, 5, 9, 3578, // 4, 8 - 4, 9, 50865, 4, 10, 5573, 5, 9, 5261, 5, 10, 3837, // 4, 9 - 4, 10, 49275, 4, 11, 6086, 5, 10, 5917, 5, 11, 4258, // 4,10 - 4, 11, 47328, 4, 12, 6708, 5, 11, 6727, 5, 12, 4773, // 4,11 - 4, 12, 45229, 4, 13, 7356, 5, 12, 7622, 5, 13, 5329, // 4,12 - 4, 13, 43105, 4, 14, 7981, 5, 13, 8559, 5, 14, 5891, // 4,13 - 4, 14, 41026, 4, 15, 8557, 5, 14, 9513, 5, 15, 6440, // 4,14 - 4, 15, 39026, 4, 16, 9072, 5, 15, 10473, 5, 16, 6965, // 4,15 - 4, 0, 10232, 4, 1, 6710, 5, 0, 39918, 5, 1, 8676, // 5, 0 - 4, 1, 9206, 4, 2, 6145, 5, 1, 42087, 5, 2, 8098, // 5, 1 - 4, 2, 8167, 4, 3, 5543, 5, 2, 44386, 5, 3, 7440, // 5, 2 - 4, 3, 7121, 4, 4, 4909, 5, 3, 46798, 5, 4, 6708, // 5, 3 - 4, 4, 6086, 4, 5, 4258, 5, 4, 49275, 5, 5, 5917, // 5, 4 - 4, 5, 5103, 4, 6, 3621, 5, 5, 51700, 5, 6, 5112, // 5, 5 - 4, 6, 4262, 4, 7, 3064, 5, 6, 53816, 5, 7, 4394, // 5, 6 - 4, 7, 3720, 4, 8, 2708, 5, 7, 55168, 5, 8, 3940, // 5, 7 - 5, 8, 55162, 5, 9, 3938, 6, 8, 3726, 6, 9, 2710, // 5, 8 - 5, 9, 53813, 5, 10, 4388, 6, 9, 4269, 6, 10, 3066, // 5, 9 - 5, 10, 51700, 5, 11, 5103, 6, 10, 5113, 6, 11, 3620, // 5,10 - 5, 11, 49279, 5, 12, 5901, 6, 11, 6099, 6, 12, 4257, // 5,11 - 5, 12, 46806, 5, 13, 6685, 6, 12, 7138, 6, 13, 4907, // 5,12 - 5, 13, 44399, 5, 14, 7411, 6, 13, 8189, 6, 14, 5537, // 5,13 - 5, 14, 42105, 5, 15, 8061, 6, 14, 9233, 6, 15, 6137, // 5,14 - 5, 15, 39940, 5, 16, 8632, 6, 15, 10265, 6, 16, 6699, // 5,15 - 5, 0, 10100, 5, 1, 6502, 6, 0, 40618, 6, 1, 8316, // 6, 0 - 5, 1, 9014, 5, 2, 5910, 6, 1, 42913, 6, 2, 7699, // 6, 1 - 5, 2, 7899, 5, 3, 5268, 6, 2, 45383, 6, 3, 6986, // 6, 2 - 5, 3, 6750, 5, 4, 4576, 6, 3, 48037, 6, 4, 6173, // 6, 3 - 5, 4, 5573, 5, 5, 3837, 6, 4, 50865, 6, 5, 5261, // 6, 4 - 5, 5, 4388, 5, 6, 3065, 6, 5, 53813, 6, 6, 4270, // 6, 5 - 5, 6, 3271, 5, 7, 2316, 6, 6, 56673, 6, 7, 3276, // 6, 6 - 5, 7, 2462, 5, 8, 1766, 6, 7, 58775, 6, 8, 2533, // 6, 7 - 6, 8, 58773, 6, 9, 2532, 7, 8, 2464, 7, 9, 1767, // 6, 8 - 6, 9, 56673, 6, 10, 3271, 7, 9, 3275, 7, 10, 2317, // 6, 9 - 6, 10, 53816, 6, 11, 4262, 7, 10, 4394, 7, 11, 3064, // 6,10 - 6, 11, 50873, 6, 12, 5248, 7, 11, 5581, 7, 12, 3834, // 6,11 - 6, 12, 48049, 6, 13, 6154, 7, 12, 6761, 7, 13, 4572, // 6,12 - 6, 13, 45401, 6, 14, 6961, 7, 13, 7913, 7, 14, 5261, // 6,13 - 6, 14, 42936, 6, 15, 7667, 7, 14, 9032, 7, 15, 5901, // 6,14 - 6, 15, 40646, 6, 16, 8278, 7, 15, 10123, 7, 16, 6489, // 6,15 - 6, 0, 10052, 6, 1, 6360, 7, 0, 41072, 7, 1, 8052, // 7, 0 - 6, 1, 8929, 6, 2, 5756, 7, 1, 43433, 7, 2, 7418, // 7, 1 - 6, 2, 7766, 6, 3, 5095, 7, 2, 45995, 7, 3, 6680, // 7, 2 - 6, 3, 6552, 6, 4, 4372, 7, 3, 48785, 7, 4, 5827, // 7, 3 - 6, 4, 5280, 6, 5, 3579, 7, 4, 51832, 7, 5, 4845, // 7, 4 - 6, 5, 3938, 6, 6, 2710, 7, 5, 55162, 7, 6, 3726, // 7, 5 - 6, 6, 2532, 6, 7, 1767, 7, 6, 58773, 7, 7, 2464, // 7, 6 - 6, 7, 1170, 6, 8, 827, 7, 7, 62369, 7, 8, 1170, // 7, 7 - 7, 8, 62369, 7, 9, 1170, 8, 8, 1170, 8, 9, 827, // 7, 8 - 7, 9, 58775, 7, 10, 2462, 8, 9, 2533, 8, 10, 1766, // 7, 9 - 7, 10, 55168, 7, 11, 3720, 8, 10, 3940, 8, 11, 2708, // 7,10 - 7, 11, 51842, 7, 12, 4835, 8, 11, 5283, 8, 12, 3576, // 7,11 - 7, 12, 48801, 7, 13, 5811, 8, 12, 6558, 8, 13, 4366, // 7,12 - 7, 13, 46017, 7, 14, 6658, 8, 13, 7773, 8, 14, 5088, // 7,13 - 7, 14, 43461, 7, 15, 7390, 8, 14, 8939, 8, 15, 5746, // 7,14 - 7, 15, 41106, 7, 16, 8018, 8, 15, 10066, 8, 16, 6346, // 7,15 - 7, -1, 6346, 7, 0, 10066, 8, -1, 8018, 8, 0, 41106, // 8, 0 - 7, 0, 5745, 7, 1, 8939, 8, 0, 7390, 8, 1, 43462, // 8, 1 - 7, 1, 5087, 7, 2, 7773, 8, 1, 6658, 8, 2, 46018, // 8, 2 - 7, 2, 4366, 7, 3, 6558, 8, 2, 5811, 8, 3, 48801, // 8, 3 - 7, 3, 3575, 7, 4, 5283, 8, 3, 4835, 8, 4, 51843, // 8, 4 - 7, 4, 2708, 7, 5, 3940, 8, 4, 3720, 8, 5, 55168, // 8, 5 - 7, 5, 1766, 7, 6, 2533, 8, 5, 2462, 8, 6, 58775, // 8, 6 - 7, 6, 827, 7, 7, 1170, 8, 6, 1170, 8, 7, 62369, // 8, 7 - 8, 7, 1170, 8, 8, 62369, 9, 7, 827, 9, 8, 1170, // 8, 8 - 8, 8, 2464, 8, 9, 58773, 9, 8, 1767, 9, 9, 2532, // 8, 9 - 8, 9, 3726, 8, 10, 55162, 9, 9, 2710, 9, 10, 3938, // 8,10 - 8, 10, 4846, 8, 11, 51832, 9, 10, 3579, 9, 11, 5279, // 8,11 - 8, 11, 5827, 8, 12, 48785, 9, 11, 4372, 9, 12, 6552, // 8,12 - 8, 12, 6680, 8, 13, 45995, 9, 12, 5095, 9, 13, 7766, // 8,13 - 8, 13, 7418, 8, 14, 43433, 9, 13, 5756, 9, 14, 8929, // 8,14 - 8, 14, 8052, 8, 15, 41072, 9, 14, 6360, 9, 15, 10052, // 8,15 - 8, -1, 6489, 8, 0, 10123, 9, -1, 8278, 9, 0, 40646, // 9, 0 - 8, 0, 5900, 8, 1, 9032, 9, 0, 7667, 9, 1, 42937, // 9, 1 - 8, 1, 5261, 8, 2, 7913, 9, 1, 6961, 9, 2, 45401, // 9, 2 - 8, 2, 4572, 8, 3, 6761, 9, 2, 6154, 9, 3, 48049, // 9, 3 - 8, 3, 3834, 8, 4, 5581, 9, 3, 5248, 9, 4, 50873, // 9, 4 - 8, 4, 3064, 8, 5, 4394, 9, 4, 4262, 9, 5, 53816, // 9, 5 - 8, 5, 2316, 8, 6, 3275, 9, 5, 3271, 9, 6, 56674, // 9, 6 - 8, 6, 1767, 8, 7, 2464, 9, 6, 2532, 9, 7, 58773, // 9, 7 - 9, 7, 2533, 9, 8, 58775, 10, 7, 1766, 10, 8, 2462, // 9, 8 - 9, 8, 3275, 9, 9, 56673, 10, 8, 2316, 10, 9, 3272, // 9, 9 - 9, 9, 4269, 9, 10, 53813, 10, 9, 3065, 10, 10, 4389, // 9,10 - 9, 10, 5261, 9, 11, 50865, 10, 10, 3837, 10, 11, 5573, // 9,11 - 9, 11, 6173, 9, 12, 48037, 10, 11, 4576, 10, 12, 6750, // 9,12 - 9, 12, 6986, 9, 13, 45383, 10, 12, 5268, 10, 13, 7899, // 9,13 - 9, 13, 7699, 9, 14, 42913, 10, 13, 5910, 10, 14, 9014, // 9,14 - 9, 14, 8316, 9, 15, 40618, 10, 14, 6502, 10, 15, 10100, // 9,15 - 9, -1, 6699, 9, 0, 10265, 10, -1, 8632, 10, 0, 39940, // 10, 0 - 9, 0, 6137, 9, 1, 9233, 10, 0, 8061, 10, 1, 42105, // 10, 1 - 9, 1, 5537, 9, 2, 8189, 10, 1, 7411, 10, 2, 44399, // 10, 2 - 9, 2, 4906, 9, 3, 7138, 10, 2, 6685, 10, 3, 46807, // 10, 3 - 9, 3, 4257, 9, 4, 6099, 10, 3, 5901, 10, 4, 49279, // 10, 4 - 9, 4, 3621, 9, 5, 5113, 10, 4, 5103, 10, 5, 51699, // 10, 5 - 9, 5, 3065, 9, 6, 4269, 10, 5, 4388, 10, 6, 53814, // 10, 6 - 9, 6, 2710, 9, 7, 3726, 10, 6, 3938, 10, 7, 55162, // 10, 7 - 10, 7, 3940, 10, 8, 55168, 11, 7, 2708, 11, 8, 3720, // 10, 8 - 10, 8, 4394, 10, 9, 53816, 11, 8, 3064, 11, 9, 4262, // 10, 9 - 10, 9, 5113, 10, 10, 51700, 11, 9, 3621, 11, 10, 5102, // 10,10 - 10, 10, 5917, 10, 11, 49275, 11, 10, 4258, 11, 11, 6086, // 10,11 - 10, 11, 6707, 10, 12, 46798, 11, 11, 4909, 11, 12, 7122, // 10,12 - 10, 12, 7440, 10, 13, 44386, 11, 12, 5543, 11, 13, 8167, // 10,13 - 10, 13, 8098, 10, 14, 42087, 11, 13, 6145, 11, 14, 9206, // 10,14 - 10, 14, 8676, 10, 15, 39918, 11, 14, 6710, 11, 15, 10232, // 10,15 - 10, -1, 6965, 10, 0, 10473, 11, -1, 9072, 11, 0, 39026, // 11, 0 - 10, 0, 6440, 10, 1, 9513, 11, 0, 8557, 11, 1, 41026, // 11, 1 - 10, 1, 5891, 10, 2, 8559, 11, 1, 7981, 11, 2, 43105, // 11, 2 - 10, 2, 5330, 10, 3, 7622, 11, 2, 7356, 11, 3, 45228, // 11, 3 - 10, 3, 4774, 10, 4, 6727, 11, 3, 6708, 11, 4, 47327, // 11, 4 - 10, 4, 4258, 10, 5, 5917, 11, 4, 6086, 11, 5, 49275, // 11, 5 - 10, 5, 3837, 10, 6, 5261, 11, 5, 5573, 11, 6, 50865, // 11, 6 - 10, 6, 3579, 10, 7, 4846, 11, 6, 5280, 11, 7, 51831, // 11, 7 - 11, 7, 5283, 11, 8, 51842, 12, 7, 3575, 12, 8, 4836, // 11, 8 - 11, 8, 5581, 11, 9, 50873, 12, 8, 3834, 12, 9, 5248, // 11, 9 - 11, 9, 6099, 11, 10, 49279, 12, 9, 4257, 12, 10, 5901, // 11,10 - 11, 10, 6727, 11, 11, 47328, 12, 10, 4774, 12, 11, 6707, // 11,11 - 11, 11, 7382, 11, 12, 45224, 12, 11, 5331, 12, 12, 7599, // 11,12 - 11, 12, 8015, 11, 13, 43096, 12, 12, 5895, 12, 13, 8530, // 11,13 - 11, 13, 8599, 11, 14, 41013, 12, 13, 6447, 12, 14, 9477, // 11,14 - 11, 14, 9122, 11, 15, 39009, 12, 14, 6975, 12, 15, 10430, // 11,15 - 11, -1, 7276, 11, 0, 10723, 12, -1, 9585, 12, 0, 37952, // 12, 0 - 11, 0, 6792, 11, 1, 9841, 12, 0, 9135, 12, 1, 39768, // 12, 1 - 11, 1, 6297, 11, 2, 8979, 12, 1, 8641, 12, 2, 41619, // 12, 2 - 11, 2, 5804, 11, 3, 8151, 12, 2, 8120, 12, 3, 43461, // 12, 3 - 11, 3, 5331, 11, 4, 7382, 12, 3, 7598, 12, 4, 45225, // 12, 4 - 11, 4, 4909, 11, 5, 6707, 12, 4, 7121, 12, 5, 46799, // 12, 5 - 11, 5, 4576, 11, 6, 6173, 12, 5, 6750, 12, 6, 48037, // 12, 6 - 11, 6, 4372, 11, 7, 5827, 12, 6, 6552, 12, 7, 48785, // 12, 7 - 12, 7, 6558, 12, 8, 48801, 13, 7, 4366, 13, 8, 5811, // 12, 8 - 12, 8, 6761, 12, 9, 48049, 13, 8, 4572, 13, 9, 6154, // 12, 9 - 12, 9, 7138, 12, 10, 46806, 13, 9, 4906, 13, 10, 6686, // 12,10 - 12, 10, 7622, 12, 11, 45229, 13, 10, 5330, 13, 11, 7355, // 12,11 - 12, 11, 8151, 12, 12, 43461, 13, 11, 5804, 13, 12, 8120, // 12,12 - 12, 12, 8681, 12, 13, 41614, 13, 12, 6299, 13, 13, 8942, // 12,13 - 12, 13, 9184, 12, 14, 39759, 13, 13, 6797, 13, 14, 9796, // 12,14 - 12, 14, 9642, 12, 15, 37939, 13, 14, 7285, 13, 15, 10670, // 12,15 - 12, -1, 7620, 12, 0, 10994, 13, -1, 10158, 13, 0, 36764, // 13, 0 - 12, 0, 7177, 12, 1, 10188, 13, 0, 9777, 13, 1, 38394, // 13, 1 - 12, 1, 6732, 12, 2, 9413, 13, 1, 9366, 13, 2, 40025, // 13, 2 - 12, 2, 6299, 12, 3, 8681, 13, 2, 8941, 13, 3, 41615, // 13, 3 - 12, 3, 5895, 12, 4, 8015, 13, 3, 8530, 13, 4, 43096, // 13, 4 - 12, 4, 5543, 12, 5, 7440, 13, 4, 8167, 13, 5, 44386, // 13, 5 - 12, 5, 5268, 12, 6, 6986, 13, 5, 7899, 13, 6, 45383, // 13, 6 - 12, 6, 5095, 12, 7, 6680, 13, 6, 7766, 13, 7, 45995, // 13, 7 - 13, 7, 7773, 13, 8, 46017, 14, 7, 5087, 14, 8, 6659, // 13, 8 - 13, 8, 7913, 13, 9, 45401, 14, 8, 5261, 14, 9, 6961, // 13, 9 - 13, 9, 8189, 13, 10, 44399, 14, 9, 5537, 14, 10, 7411, // 13,10 - 13, 10, 8559, 13, 11, 43105, 14, 10, 5891, 14, 11, 7981, // 13,11 - 13, 11, 8979, 13, 12, 41618, 14, 11, 6297, 14, 12, 8642, // 13,12 - 13, 12, 9413, 13, 13, 40025, 14, 12, 6732, 14, 13, 9366, // 13,13 - 13, 13, 9834, 13, 14, 38390, 14, 13, 7179, 14, 14, 10133, // 13,14 - 13, 14, 10224, 13, 15, 36756, 14, 14, 7626, 14, 15, 10930, // 13,15 - 13, -1, 7983, 13, 0, 11267, 14, -1, 10780, 14, 0, 35506, // 14, 0 - 13, 0, 7579, 13, 1, 10532, 14, 0, 10467, 14, 1, 36958, // 14, 1 - 13, 1, 7179, 13, 2, 9834, 14, 1, 10133, 14, 2, 38390, // 14, 2 - 13, 2, 6797, 13, 3, 9184, 14, 2, 9796, 14, 3, 39759, // 14, 3 - 13, 3, 6447, 13, 4, 8599, 14, 3, 9478, 14, 4, 41012, // 14, 4 - 13, 4, 6145, 13, 5, 8098, 14, 4, 9206, 14, 5, 42087, // 14, 5 - 13, 5, 5910, 13, 6, 7699, 14, 5, 9014, 14, 6, 42913, // 14, 6 - 13, 6, 5756, 13, 7, 7418, 14, 6, 8929, 14, 7, 43433, // 14, 7 - 14, 7, 8939, 14, 8, 43461, 15, 7, 5745, 15, 8, 7391, // 14, 8 - 14, 8, 9032, 14, 9, 42936, 15, 8, 5900, 15, 9, 7668, // 14, 9 - 14, 9, 9233, 14, 10, 42105, 15, 9, 6137, 15, 10, 8061, // 14,10 - 14, 10, 9513, 14, 11, 41026, 15, 10, 6440, 15, 11, 8557, // 14,11 - 14, 11, 9841, 14, 12, 39767, 15, 11, 6792, 15, 12, 9136, // 14,12 - 14, 12, 10188, 14, 13, 38394, 15, 12, 7177, 15, 13, 9777, // 14,13 - 14, 13, 10532, 14, 14, 36959, 15, 13, 7579, 15, 14, 10466, // 14,14 - 14, 14, 10855, 14, 15, 35502, 15, 14, 7987, 15, 15, 11192, // 14,15 - 14, -1, 8358, 14, 0, 11526, 15, -1, 11440, 15, 0, 34212, // 15, 0 - 14, 0, 7987, 14, 1, 10855, 15, 0, 11192, 15, 1, 35502, // 15, 1 - 14, 1, 7626, 14, 2, 10224, 15, 1, 10930, 15, 2, 36756, // 15, 2 - 14, 2, 7285, 14, 3, 9642, 15, 2, 10670, 15, 3, 37939, // 15, 3 - 14, 3, 6975, 14, 4, 9122, 15, 3, 10430, 15, 4, 39009, // 15, 4 - 14, 4, 6710, 14, 5, 8676, 15, 4, 10232, 15, 5, 39918, // 15, 5 - 14, 5, 6502, 14, 6, 8316, 15, 5, 10100, 15, 6, 40618, // 15, 6 - 14, 6, 6360, 14, 7, 8052, 15, 6, 10052, 15, 7, 41072, // 15, 7 - 15, 7, 10066, 15, 8, 41106, 16, 7, 6346, 16, 8, 8018, // 15, 8 - 15, 8, 10123, 15, 9, 40646, 16, 8, 6489, 16, 9, 8278, // 15, 9 - 15, 9, 10265, 15, 10, 39940, 16, 9, 6699, 16, 10, 8632, // 15,10 - 15, 10, 10473, 15, 11, 39026, 16, 10, 6965, 16, 11, 9072, // 15,11 - 15, 11, 10723, 15, 12, 37951, 16, 11, 7276, 16, 12, 9586, // 15,12 - 15, 12, 10994, 15, 13, 36764, 16, 12, 7620, 16, 13, 10158, // 15,13 - 15, 13, 11267, 15, 14, 35506, 16, 13, 7983, 16, 14, 10780, // 15,14 - 15, 14, 11526, 15, 15, 34212, 16, 14, 8358, 16, 15, 11440, // 15,15 - // angle of -1.0 degrees - -1, 0, 8769, -1, 1, 6280, 0, 0, 41693, 0, 1, 8794, // 0, 0 - -1, 1, 8265, -1, 2, 5974, 0, 1, 42823, 0, 2, 8474, // 0, 1 - -1, 2, 7791, -1, 3, 5682, 0, 2, 43904, 0, 3, 8159, // 0, 2 - -1, 3, 7356, -1, 4, 5410, 0, 3, 44907, 0, 4, 7863, // 0, 3 - -1, 4, 6970, -1, 5, 5169, 0, 4, 45799, 0, 5, 7598, // 0, 4 - -1, 5, 6644, -1, 6, 4967, 0, 5, 46541, 0, 6, 7384, // 0, 5 - -1, 6, 6391, -1, 7, 4814, 0, 6, 47098, 0, 7, 7233, // 0, 6 - -1, 7, 6217, -1, 8, 4718, 0, 7, 47440, 0, 8, 7161, // 0, 7 - 0, 8, 47426, 0, 9, 7158, 1, 8, 6230, 1, 9, 4722, // 0, 8 - 0, 9, 47086, 0, 10, 7227, 1, 9, 6405, 1, 10, 4818, // 0, 9 - 0, 10, 46532, 0, 11, 7374, 1, 10, 6659, 1, 11, 4971, // 0,10 - 0, 11, 45791, 0, 12, 7587, 1, 11, 6986, 1, 12, 5172, // 0,11 - 0, 12, 44901, 0, 13, 7848, 1, 12, 7374, 1, 13, 5413, // 0,12 - 0, 13, 43900, 0, 14, 8141, 1, 13, 7812, 1, 14, 5683, // 0,13 - 0, 14, 42821, 0, 15, 8452, 1, 14, 8288, 1, 15, 5975, // 0,14 - 0, 15, 41693, 0, 16, 8769, 1, 15, 8795, 1, 16, 6279, // 0,15 - 0, 0, 8452, 0, 1, 5975, 1, 0, 42821, 1, 1, 8288, // 1, 0 - 0, 1, 7901, 0, 2, 5640, 1, 1, 44074, 1, 2, 7921, // 1, 1 - 0, 2, 7378, 0, 3, 5315, 1, 2, 45288, 1, 3, 7555, // 1, 2 - 0, 3, 6892, 0, 4, 5009, 1, 3, 46430, 1, 4, 7205, // 1, 3 - 0, 4, 6458, 0, 5, 4734, 1, 4, 47458, 1, 5, 6886, // 1, 4 - 0, 5, 6092, 0, 6, 4502, 1, 5, 48322, 1, 6, 6620, // 1, 5 - 0, 6, 5809, 0, 7, 4327, 1, 6, 48969, 1, 7, 6431, // 1, 6 - 0, 7, 5623, 0, 8, 4221, 1, 7, 49358, 1, 8, 6334, // 1, 7 - 1, 8, 49347, 1, 9, 6332, 2, 8, 5633, 2, 9, 4224, // 1, 8 - 1, 9, 48960, 1, 10, 6425, 2, 9, 5820, 2, 10, 4331, // 1, 9 - 1, 10, 48314, 1, 11, 6613, 2, 10, 6104, 2, 11, 4505, // 1,10 - 1, 11, 47453, 1, 12, 6875, 2, 11, 6472, 2, 12, 4736, // 1,11 - 1, 12, 46427, 1, 13, 7191, 2, 12, 6908, 2, 13, 5010, // 1,12 - 1, 13, 45286, 1, 14, 7539, 2, 13, 7395, 2, 14, 5316, // 1,13 - 1, 14, 44074, 1, 15, 7901, 2, 14, 7921, 2, 15, 5640, // 1,14 - 1, 15, 42823, 1, 16, 8265, 2, 15, 8474, 2, 16, 5974, // 1,15 - 1, 0, 8141, 1, 1, 5684, 2, 0, 43900, 2, 1, 7811, // 2, 0 - 1, 1, 7539, 1, 2, 5316, 2, 1, 45286, 2, 2, 7395, // 2, 1 - 1, 2, 6959, 1, 3, 4954, 2, 2, 46650, 2, 3, 6973, // 2, 2 - 1, 3, 6414, 1, 4, 4607, 2, 3, 47955, 2, 4, 6560, // 2, 3 - 1, 4, 5920, 1, 5, 4290, 2, 4, 49150, 2, 5, 6176, // 2, 4 - 1, 5, 5499, 1, 6, 4019, 2, 5, 50171, 2, 6, 5847, // 2, 5 - 1, 6, 5175, 1, 7, 3813, 2, 6, 50942, 2, 7, 5606, // 2, 6 - 1, 7, 4970, 1, 8, 3691, 2, 7, 51395, 2, 8, 5480, // 2, 7 - 2, 8, 51387, 2, 9, 5478, 3, 8, 4978, 3, 9, 3693, // 2, 8 - 2, 9, 50935, 2, 10, 5602, 3, 9, 5184, 3, 10, 3815, // 2, 9 - 2, 10, 50165, 2, 11, 5842, 3, 10, 5508, 3, 11, 4021, // 2,10 - 2, 11, 49147, 2, 12, 6168, 3, 11, 5930, 3, 12, 4291, // 2,11 - 2, 12, 47953, 2, 13, 6549, 3, 12, 6426, 3, 13, 4608, // 2,12 - 2, 13, 46650, 2, 14, 6959, 3, 13, 6973, 3, 14, 4954, // 2,13 - 2, 14, 45288, 2, 15, 7378, 3, 14, 7555, 3, 15, 5315, // 2,14 - 2, 15, 43904, 2, 16, 7791, 3, 15, 8159, 3, 16, 5682, // 2,15 - 2, 0, 7848, 2, 1, 5413, 3, 0, 44901, 3, 1, 7374, // 3, 0 - 2, 1, 7191, 2, 2, 5011, 3, 1, 46427, 3, 2, 6907, // 3, 1 - 2, 2, 6549, 2, 3, 4608, 3, 2, 47953, 3, 3, 6426, // 3, 2 - 2, 3, 5934, 2, 4, 4214, 3, 3, 49445, 3, 4, 5943, // 3, 3 - 2, 4, 5365, 2, 5, 3845, 3, 4, 50844, 3, 5, 5482, // 3, 4 - 2, 5, 4872, 2, 6, 3522, 3, 5, 52069, 3, 6, 5073, // 3, 5 - 2, 6, 4489, 2, 7, 3273, 3, 6, 53012, 3, 7, 4762, // 3, 6 - 2, 7, 4254, 2, 8, 3126, 3, 7, 53562, 3, 8, 4594, // 3, 7 - 3, 8, 53557, 3, 9, 4592, 4, 8, 4259, 4, 9, 3128, // 3, 8 - 3, 9, 53008, 3, 10, 4759, 4, 9, 4495, 4, 10, 3274, // 3, 9 - 3, 10, 52066, 3, 11, 5069, 4, 10, 4879, 4, 11, 3522, // 3,10 - 3, 11, 50843, 3, 12, 5474, 4, 11, 5373, 4, 12, 3846, // 3,11 - 3, 12, 49445, 3, 13, 5934, 4, 12, 5943, 4, 13, 4214, // 3,12 - 3, 13, 47955, 3, 14, 6414, 4, 13, 6560, 4, 14, 4607, // 3,13 - 3, 14, 46430, 3, 15, 6892, 4, 14, 7204, 4, 15, 5010, // 3,14 - 3, 15, 44907, 3, 16, 7356, 4, 15, 7863, 4, 16, 5410, // 3,15 - 3, 0, 7587, 3, 1, 5172, 4, 0, 45791, 4, 1, 6986, // 4, 0 - 3, 1, 6875, 3, 2, 4736, 4, 1, 47453, 4, 2, 6472, // 4, 1 - 3, 2, 6168, 3, 3, 4291, 4, 2, 49147, 4, 3, 5930, // 4, 2 - 3, 3, 5474, 3, 4, 3846, 4, 3, 50843, 4, 4, 5373, // 4, 3 - 3, 4, 4816, 3, 5, 3415, 4, 4, 52484, 4, 5, 4821, // 4, 4 - 3, 5, 4226, 3, 6, 3023, 4, 5, 53975, 4, 6, 4312, // 4, 5 - 3, 6, 3755, 3, 7, 2710, 4, 6, 55166, 4, 7, 3905, // 4, 6 - 3, 7, 3469, 3, 8, 2524, 4, 7, 55870, 4, 8, 3673, // 4, 7 - 4, 8, 55867, 4, 9, 3671, 5, 8, 3473, 5, 9, 2525, // 4, 8 - 4, 9, 55164, 4, 10, 3902, 5, 9, 3759, 5, 10, 2711, // 4, 9 - 4, 10, 53973, 4, 11, 4309, 5, 10, 4230, 5, 11, 3024, // 4,10 - 4, 11, 52484, 4, 12, 4816, 5, 11, 4822, 5, 12, 3414, // 4,11 - 4, 12, 50844, 4, 13, 5365, 5, 12, 5481, 5, 13, 3846, // 4,12 - 4, 13, 49150, 4, 14, 5920, 5, 13, 6176, 5, 14, 4290, // 4,13 - 4, 14, 47458, 4, 15, 6458, 5, 14, 6886, 5, 15, 4734, // 4,14 - 4, 15, 45799, 4, 16, 6970, 5, 15, 7599, 5, 16, 5168, // 4,15 - 4, 0, 7374, 4, 1, 4971, 5, 0, 46532, 5, 1, 6659, // 5, 0 - 4, 1, 6613, 4, 2, 4505, 5, 1, 48314, 5, 2, 6104, // 5, 1 - 4, 2, 5842, 4, 3, 4020, 5, 2, 50165, 5, 3, 5509, // 5, 2 - 4, 3, 5069, 4, 4, 3523, 5, 3, 52066, 5, 4, 4878, // 5, 3 - 4, 4, 4309, 4, 5, 3023, 5, 4, 53973, 5, 5, 4231, // 5, 4 - 4, 5, 3595, 4, 6, 2546, 5, 5, 55798, 5, 6, 3597, // 5, 5 - 4, 6, 2993, 4, 7, 2138, 5, 6, 57354, 5, 7, 3051, // 5, 6 - 4, 7, 2615, 4, 8, 1884, 5, 7, 58324, 5, 8, 2713, // 5, 7 - 5, 8, 58322, 5, 9, 2713, 6, 8, 2616, 6, 9, 1885, // 5, 8 - 5, 9, 57353, 5, 10, 3050, 6, 9, 2995, 6, 10, 2138, // 5, 9 - 5, 10, 55798, 5, 11, 3595, 6, 10, 3598, 6, 11, 2545, // 5,10 - 5, 11, 53975, 5, 12, 4226, 6, 11, 4313, 6, 12, 3022, // 5,11 - 5, 12, 52069, 5, 13, 4872, 6, 12, 5073, 6, 13, 3522, // 5,12 - 5, 13, 50171, 5, 14, 5499, 6, 13, 5848, 6, 14, 4018, // 5,13 - 5, 14, 48322, 5, 15, 6092, 6, 14, 6620, 6, 15, 4502, // 5,14 - 5, 15, 46541, 5, 16, 6644, 6, 15, 7383, 6, 16, 4968, // 5,15 - 5, 0, 7227, 5, 1, 4818, 6, 0, 47086, 6, 1, 6405, // 6, 0 - 5, 1, 6425, 5, 2, 4330, 6, 1, 48960, 6, 2, 5821, // 6, 1 - 5, 2, 5602, 5, 3, 3815, 6, 2, 50935, 6, 3, 5184, // 6, 2 - 5, 3, 4759, 5, 4, 3274, 6, 3, 53008, 6, 4, 4495, // 6, 3 - 5, 4, 3902, 5, 5, 2711, 6, 4, 55164, 6, 5, 3759, // 6, 4 - 5, 5, 3050, 5, 6, 2138, 6, 5, 57353, 6, 6, 2995, // 6, 5 - 5, 6, 2258, 5, 7, 1597, 6, 6, 59422, 6, 7, 2259, // 6, 6 - 5, 7, 1695, 5, 8, 1209, 6, 7, 60906, 6, 8, 1726, // 6, 7 - 6, 8, 60905, 6, 9, 1726, 7, 8, 1695, 7, 9, 1210, // 6, 8 - 6, 9, 59422, 6, 10, 2258, 7, 9, 2259, 7, 10, 1597, // 6, 9 - 6, 10, 57354, 6, 11, 2993, 7, 10, 3051, 7, 11, 2138, // 6,10 - 6, 11, 55166, 6, 12, 3755, 7, 11, 3904, 7, 12, 2711, // 6,11 - 6, 12, 53012, 6, 13, 4489, 7, 12, 4762, 7, 13, 3273, // 6,12 - 6, 13, 50942, 6, 14, 5175, 7, 13, 5606, 7, 14, 3813, // 6,13 - 6, 14, 48969, 6, 15, 5809, 7, 14, 6430, 7, 15, 4328, // 6,14 - 6, 15, 47098, 6, 16, 6391, 7, 15, 7233, 7, 16, 4814, // 6,15 - 6, 0, 7158, 6, 1, 4722, 7, 0, 47426, 7, 1, 6230, // 7, 0 - 6, 1, 6332, 6, 2, 4224, 7, 1, 49347, 7, 2, 5633, // 7, 1 - 6, 2, 5478, 6, 3, 3693, 7, 2, 51387, 7, 3, 4978, // 7, 2 - 6, 3, 4592, 6, 4, 3128, 7, 3, 53557, 7, 4, 4259, // 7, 3 - 6, 4, 3671, 6, 5, 2525, 7, 4, 55867, 7, 5, 3473, // 7, 4 - 6, 5, 2713, 6, 6, 1884, 7, 5, 58322, 7, 6, 2617, // 7, 5 - 6, 6, 1726, 6, 7, 1210, 7, 6, 60905, 7, 7, 1695, // 7, 6 - 6, 7, 789, 6, 8, 558, 7, 7, 63399, 7, 8, 790, // 7, 7 - 7, 8, 63399, 7, 9, 789, 8, 8, 789, 8, 9, 559, // 7, 8 - 7, 9, 60906, 7, 10, 1695, 8, 9, 1726, 8, 10, 1209, // 7, 9 - 7, 10, 58324, 7, 11, 2615, 8, 10, 2714, 8, 11, 1883, // 7,10 - 7, 11, 55870, 7, 12, 3469, 8, 11, 3672, 8, 12, 2525, // 7,11 - 7, 12, 53562, 7, 13, 4254, 8, 12, 4594, 8, 13, 3126, // 7,12 - 7, 13, 51395, 7, 14, 4970, 8, 13, 5480, 8, 14, 3691, // 7,13 - 7, 14, 49358, 7, 15, 5623, 8, 14, 6335, 8, 15, 4220, // 7,14 - 7, 15, 47440, 7, 16, 6217, 8, 15, 7161, 8, 16, 4718, // 7,15 - 7, -1, 4718, 7, 0, 7161, 8, -1, 6217, 8, 0, 47440, // 8, 0 - 7, 0, 4221, 7, 1, 6335, 8, 0, 5623, 8, 1, 49357, // 8, 1 - 7, 1, 3691, 7, 2, 5480, 8, 1, 4970, 8, 2, 51395, // 8, 2 - 7, 2, 3126, 7, 3, 4594, 8, 2, 4254, 8, 3, 53562, // 8, 3 - 7, 3, 2524, 7, 4, 3672, 8, 3, 3469, 8, 4, 55871, // 8, 4 - 7, 4, 1884, 7, 5, 2714, 8, 4, 2615, 8, 5, 58323, // 8, 5 - 7, 5, 1209, 7, 6, 1726, 8, 5, 1695, 8, 6, 60906, // 8, 6 - 7, 6, 558, 7, 7, 789, 8, 6, 789, 8, 7, 63400, // 8, 7 - 8, 7, 789, 8, 8, 63399, 9, 7, 558, 9, 8, 790, // 8, 8 - 8, 8, 1695, 8, 9, 60905, 9, 8, 1210, 9, 9, 1726, // 8, 9 - 8, 9, 2616, 8, 10, 58322, 9, 9, 1884, 9, 10, 2714, // 8,10 - 8, 10, 3473, 8, 11, 55867, 9, 10, 2525, 9, 11, 3671, // 8,11 - 8, 11, 4259, 8, 12, 53557, 9, 11, 3128, 9, 12, 4592, // 8,12 - 8, 12, 4978, 8, 13, 51387, 9, 12, 3693, 9, 13, 5478, // 8,13 - 8, 13, 5633, 8, 14, 49347, 9, 13, 4224, 9, 14, 6332, // 8,14 - 8, 14, 6230, 8, 15, 47426, 9, 14, 4722, 9, 15, 7158, // 8,15 - 8, -1, 4814, 8, 0, 7233, 9, -1, 6391, 9, 0, 47098, // 9, 0 - 8, 0, 4327, 8, 1, 6430, 9, 0, 5809, 9, 1, 48970, // 9, 1 - 8, 1, 3813, 8, 2, 5606, 9, 1, 5175, 9, 2, 50942, // 9, 2 - 8, 2, 3273, 8, 3, 4762, 9, 2, 4489, 9, 3, 53012, // 9, 3 - 8, 3, 2710, 8, 4, 3904, 9, 3, 3755, 9, 4, 55167, // 9, 4 - 8, 4, 2138, 8, 5, 3051, 9, 4, 2993, 9, 5, 57354, // 9, 5 - 8, 5, 1597, 8, 6, 2259, 9, 5, 2258, 9, 6, 59422, // 9, 6 - 8, 6, 1210, 8, 7, 1695, 9, 6, 1726, 9, 7, 60905, // 9, 7 - 9, 7, 1726, 9, 8, 60906, 10, 7, 1209, 10, 8, 1695, // 9, 8 - 9, 8, 2259, 9, 9, 59422, 10, 8, 1597, 10, 9, 2258, // 9, 9 - 9, 9, 2995, 9, 10, 57353, 10, 9, 2138, 10, 10, 3050, // 9,10 - 9, 10, 3759, 9, 11, 55164, 10, 10, 2711, 10, 11, 3902, // 9,11 - 9, 11, 4495, 9, 12, 53008, 10, 11, 3274, 10, 12, 4759, // 9,12 - 9, 12, 5184, 9, 13, 50935, 10, 12, 3815, 10, 13, 5602, // 9,13 - 9, 13, 5820, 9, 14, 48960, 10, 13, 4330, 10, 14, 6426, // 9,14 - 9, 14, 6405, 9, 15, 47086, 10, 14, 4818, 10, 15, 7227, // 9,15 - 9, -1, 4967, 9, 0, 7383, 10, -1, 6644, 10, 0, 46542, // 10, 0 - 9, 0, 4502, 9, 1, 6620, 10, 0, 6092, 10, 1, 48322, // 10, 1 - 9, 1, 4019, 9, 2, 5848, 10, 1, 5499, 10, 2, 50170, // 10, 2 - 9, 2, 3522, 9, 3, 5073, 10, 2, 4872, 10, 3, 52069, // 10, 3 - 9, 3, 3023, 9, 4, 4313, 10, 3, 4226, 10, 4, 53974, // 10, 4 - 9, 4, 2546, 9, 5, 3598, 10, 4, 3595, 10, 5, 55797, // 10, 5 - 9, 5, 2138, 9, 6, 2995, 10, 5, 3050, 10, 6, 57353, // 10, 6 - 9, 6, 1884, 9, 7, 2616, 10, 6, 2713, 10, 7, 58323, // 10, 7 - 10, 7, 2714, 10, 8, 58324, 11, 7, 1884, 11, 8, 2614, // 10, 8 - 10, 8, 3051, 10, 9, 57354, 11, 8, 2138, 11, 9, 2993, // 10, 9 - 10, 9, 3598, 10, 10, 55798, 11, 9, 2546, 11, 10, 3594, // 10,10 - 10, 10, 4230, 10, 11, 53973, 11, 10, 3023, 11, 11, 4310, // 10,11 - 10, 11, 4879, 10, 12, 52066, 11, 11, 3523, 11, 12, 5068, // 10,12 - 10, 12, 5508, 10, 13, 50165, 11, 12, 4020, 11, 13, 5843, // 10,13 - 10, 13, 6104, 10, 14, 48314, 11, 13, 4505, 11, 14, 6613, // 10,14 - 10, 14, 6659, 10, 15, 46532, 11, 14, 4971, 11, 15, 7374, // 10,15 - 10, -1, 5169, 10, 0, 7599, 11, -1, 6970, 11, 0, 45798, // 11, 0 - 10, 0, 4734, 10, 1, 6886, 11, 0, 6458, 11, 1, 47458, // 11, 1 - 10, 1, 4290, 10, 2, 6176, 11, 1, 5920, 11, 2, 49150, // 11, 2 - 10, 2, 3845, 10, 3, 5481, 11, 2, 5365, 11, 3, 50845, // 11, 3 - 10, 3, 3415, 10, 4, 4822, 11, 3, 4816, 11, 4, 52483, // 11, 4 - 10, 4, 3023, 10, 5, 4230, 11, 4, 4309, 11, 5, 53974, // 11, 5 - 10, 5, 2711, 10, 6, 3759, 11, 5, 3902, 11, 6, 55164, // 11, 6 - 10, 6, 2525, 10, 7, 3473, 11, 6, 3671, 11, 7, 55867, // 11, 7 - 11, 7, 3672, 11, 8, 55870, 12, 7, 2524, 12, 8, 3470, // 11, 8 - 11, 8, 3904, 11, 9, 55166, 12, 8, 2710, 12, 9, 3756, // 11, 9 - 11, 9, 4313, 11, 10, 53975, 12, 9, 3023, 12, 10, 4225, // 11,10 - 11, 10, 4822, 11, 11, 52484, 12, 10, 3415, 12, 11, 4815, // 11,11 - 11, 11, 5373, 11, 12, 50843, 12, 11, 3846, 12, 12, 5474, // 11,12 - 11, 12, 5930, 11, 13, 49147, 12, 12, 4291, 12, 13, 6168, // 11,13 - 11, 13, 6472, 11, 14, 47453, 12, 13, 4736, 12, 14, 6875, // 11,14 - 11, 14, 6986, 11, 15, 45791, 12, 14, 5172, 12, 15, 7587, // 11,15 - 11, -1, 5410, 11, 0, 7863, 12, -1, 7356, 12, 0, 44907, // 12, 0 - 11, 0, 5009, 11, 1, 7204, 12, 0, 6892, 12, 1, 46431, // 12, 1 - 11, 1, 4607, 11, 2, 6560, 12, 1, 6414, 12, 2, 47955, // 12, 2 - 11, 2, 4214, 11, 3, 5943, 12, 2, 5934, 12, 3, 49445, // 12, 3 - 11, 3, 3846, 11, 4, 5373, 12, 3, 5474, 12, 4, 50843, // 12, 4 - 11, 4, 3523, 11, 5, 4879, 12, 4, 5069, 12, 5, 52065, // 12, 5 - 11, 5, 3274, 11, 6, 4495, 12, 5, 4759, 12, 6, 53008, // 12, 6 - 11, 6, 3128, 11, 7, 4259, 12, 6, 4592, 12, 7, 53557, // 12, 7 - 12, 7, 4594, 12, 8, 53562, 13, 7, 3126, 13, 8, 4254, // 12, 8 - 12, 8, 4762, 12, 9, 53012, 13, 8, 3273, 13, 9, 4489, // 12, 9 - 12, 9, 5073, 12, 10, 52069, 13, 9, 3522, 13, 10, 4872, // 12,10 - 12, 10, 5481, 12, 11, 50844, 13, 10, 3845, 13, 11, 5366, // 12,11 - 12, 11, 5943, 12, 12, 49445, 13, 11, 4214, 13, 12, 5934, // 12,12 - 12, 12, 6426, 12, 13, 47953, 13, 12, 4608, 13, 13, 6549, // 12,13 - 12, 13, 6908, 12, 14, 46427, 13, 13, 5011, 13, 14, 7190, // 12,14 - 12, 14, 7374, 12, 15, 44901, 13, 14, 5413, 13, 15, 7848, // 12,15 - 12, -1, 5682, 12, 0, 8159, 13, -1, 7791, 13, 0, 43904, // 13, 0 - 12, 0, 5315, 12, 1, 7555, 13, 0, 7378, 13, 1, 45288, // 13, 1 - 12, 1, 4954, 12, 2, 6973, 13, 1, 6959, 13, 2, 46650, // 13, 2 - 12, 2, 4608, 12, 3, 6426, 13, 2, 6549, 13, 3, 47953, // 13, 3 - 12, 3, 4291, 12, 4, 5930, 13, 3, 6168, 13, 4, 49147, // 13, 4 - 12, 4, 4020, 12, 5, 5508, 13, 4, 5842, 13, 5, 50166, // 13, 5 - 12, 5, 3815, 12, 6, 5184, 13, 5, 5602, 13, 6, 50935, // 13, 6 - 12, 6, 3693, 12, 7, 4978, 13, 6, 5478, 13, 7, 51387, // 13, 7 - 13, 7, 5480, 13, 8, 51395, 14, 7, 3691, 14, 8, 4970, // 13, 8 - 13, 8, 5606, 13, 9, 50942, 14, 8, 3813, 14, 9, 5175, // 13, 9 - 13, 9, 5848, 13, 10, 50171, 14, 9, 4019, 14, 10, 5498, // 13,10 - 13, 10, 6176, 13, 11, 49150, 14, 10, 4290, 14, 11, 5920, // 13,11 - 13, 11, 6560, 13, 12, 47955, 14, 11, 4607, 14, 12, 6414, // 13,12 - 13, 12, 6973, 13, 13, 46650, 14, 12, 4954, 14, 13, 6959, // 13,13 - 13, 13, 7395, 13, 14, 45286, 14, 13, 5316, 14, 14, 7539, // 13,14 - 13, 14, 7812, 13, 15, 43900, 14, 14, 5684, 14, 15, 8140, // 13,15 - 13, -1, 5974, 13, 0, 8474, 14, -1, 8265, 14, 0, 42823, // 14, 0 - 13, 0, 5640, 13, 1, 7921, 14, 0, 7901, 14, 1, 44074, // 14, 1 - 13, 1, 5316, 13, 2, 7395, 14, 1, 7539, 14, 2, 45286, // 14, 2 - 13, 2, 5011, 13, 3, 6908, 14, 2, 7191, 14, 3, 46426, // 14, 3 - 13, 3, 4736, 13, 4, 6472, 14, 3, 6875, 14, 4, 47453, // 14, 4 - 13, 4, 4505, 13, 5, 6104, 14, 4, 6613, 14, 5, 48314, // 14, 5 - 13, 5, 4330, 13, 6, 5820, 14, 5, 6425, 14, 6, 48961, // 14, 6 - 13, 6, 4224, 13, 7, 5633, 14, 6, 6332, 14, 7, 49347, // 14, 7 - 14, 7, 6335, 14, 8, 49358, 15, 7, 4221, 15, 8, 5622, // 14, 8 - 14, 8, 6430, 14, 9, 48969, 15, 8, 4327, 15, 9, 5810, // 14, 9 - 14, 9, 6620, 14, 10, 48322, 15, 9, 4502, 15, 10, 6092, // 14,10 - 14, 10, 6886, 14, 11, 47458, 15, 10, 4734, 15, 11, 6458, // 14,11 - 14, 11, 7204, 14, 12, 46430, 15, 11, 5009, 15, 12, 6893, // 14,12 - 14, 12, 7555, 14, 13, 45288, 15, 12, 5315, 15, 13, 7378, // 14,13 - 14, 13, 7921, 14, 14, 44074, 15, 13, 5640, 15, 14, 7901, // 14,14 - 14, 14, 8288, 14, 15, 42821, 15, 14, 5975, 15, 15, 8452, // 14,15 - 14, -1, 6280, 14, 0, 8795, 15, -1, 8769, 15, 0, 41692, // 15, 0 - 14, 0, 5975, 14, 1, 8288, 15, 0, 8452, 15, 1, 42821, // 15, 1 - 14, 1, 5684, 14, 2, 7812, 15, 1, 8141, 15, 2, 43899, // 15, 2 - 14, 2, 5413, 14, 3, 7374, 15, 2, 7848, 15, 3, 44901, // 15, 3 - 14, 3, 5172, 14, 4, 6986, 15, 3, 7587, 15, 4, 45791, // 15, 4 - 14, 4, 4971, 14, 5, 6659, 15, 4, 7374, 15, 5, 46532, // 15, 5 - 14, 5, 4818, 14, 6, 6405, 15, 5, 7227, 15, 6, 47086, // 15, 6 - 14, 6, 4722, 14, 7, 6230, 15, 6, 7158, 15, 7, 47426, // 15, 7 - 15, 7, 7161, 15, 8, 47440, 16, 7, 4718, 16, 8, 6217, // 15, 8 - 15, 8, 7233, 15, 9, 47098, 16, 8, 4814, 16, 9, 6391, // 15, 9 - 15, 9, 7383, 15, 10, 46541, 16, 9, 4967, 16, 10, 6645, // 15,10 - 15, 10, 7599, 15, 11, 45799, 16, 10, 5169, 16, 11, 6969, // 15,11 - 15, 11, 7863, 15, 12, 44907, 16, 11, 5410, 16, 12, 7356, // 15,12 - 15, 12, 8159, 15, 13, 43904, 16, 12, 5682, 16, 13, 7791, // 15,13 - 15, 13, 8474, 15, 14, 42823, 16, 13, 5974, 16, 14, 8265, // 15,14 - 15, 14, 8795, 15, 15, 41693, 16, 14, 6280, 16, 15, 8768, // 15,15 - // angle of -0.5 degrees - -1, 0, 5106, -1, 1, 3621, 0, 0, 51699, 0, 1, 5110, // 0, 0 - -1, 1, 4803, -1, 2, 3421, 0, 1, 52457, 0, 2, 4855, // 0, 1 - -1, 2, 4521, -1, 3, 3235, 0, 2, 53168, 0, 3, 4612, // 0, 2 - -1, 3, 4264, -1, 4, 3064, 0, 3, 53815, 0, 4, 4393, // 0, 3 - -1, 4, 4041, -1, 5, 2916, 0, 4, 54378, 0, 5, 4201, // 0, 4 - -1, 5, 3858, -1, 6, 2796, 0, 5, 54835, 0, 6, 4047, // 0, 5 - -1, 6, 3722, -1, 7, 2709, 0, 6, 55166, 0, 7, 3939, // 0, 6 - -1, 7, 3638, -1, 8, 2659, 0, 7, 55354, 0, 8, 3885, // 0, 7 - 0, 8, 55352, 0, 9, 3885, 1, 8, 3640, 1, 9, 2659, // 0, 8 - 0, 9, 55164, 0, 10, 3939, 1, 9, 3724, 1, 10, 2709, // 0, 9 - 0, 10, 54833, 0, 11, 4046, 1, 10, 3860, 1, 11, 2797, // 0,10 - 0, 11, 54376, 0, 12, 4200, 1, 11, 4043, 1, 12, 2917, // 0,11 - 0, 12, 53814, 0, 13, 4390, 1, 12, 4267, 1, 13, 3065, // 0,12 - 0, 13, 53168, 0, 14, 4610, 1, 13, 4523, 1, 14, 3235, // 0,13 - 0, 14, 52457, 0, 15, 4851, 1, 14, 4806, 1, 15, 3422, // 0,14 - 0, 15, 51699, 0, 16, 5106, 1, 15, 5110, 1, 16, 3621, // 0,15 - 0, 0, 4851, 0, 1, 3422, 1, 0, 52457, 1, 1, 4806, // 1, 0 - 0, 1, 4522, 0, 2, 3204, 1, 1, 53285, 1, 2, 4525, // 1, 1 - 0, 2, 4212, 0, 3, 2998, 1, 2, 54072, 1, 3, 4254, // 1, 2 - 0, 3, 3927, 0, 4, 2808, 1, 3, 54796, 1, 4, 4005, // 1, 3 - 0, 4, 3677, 0, 5, 2640, 1, 4, 55435, 1, 5, 3784, // 1, 4 - 0, 5, 3470, 0, 6, 2502, 1, 5, 55959, 1, 6, 3605, // 1, 5 - 0, 6, 3317, 0, 7, 2402, 1, 6, 56340, 1, 7, 3477, // 1, 6 - 0, 7, 3225, 0, 8, 2346, 1, 7, 56554, 1, 8, 3411, // 1, 7 - 1, 8, 56552, 1, 9, 3411, 2, 8, 3227, 2, 9, 2346, // 1, 8 - 1, 9, 56339, 1, 10, 3476, 2, 9, 3319, 2, 10, 2402, // 1, 9 - 1, 10, 55958, 1, 11, 3604, 2, 10, 3472, 2, 11, 2502, // 1,10 - 1, 11, 55434, 1, 12, 3783, 2, 11, 3678, 2, 12, 2641, // 1,11 - 1, 12, 54796, 1, 13, 4003, 2, 12, 3929, 2, 13, 2808, // 1,12 - 1, 13, 54071, 1, 14, 4253, 2, 13, 4214, 2, 14, 2998, // 1,13 - 1, 14, 53285, 1, 15, 4522, 2, 14, 4525, 2, 15, 3204, // 1,14 - 1, 15, 52457, 1, 16, 4803, 2, 15, 4854, 2, 16, 3422, // 1,15 - 1, 0, 4610, 1, 1, 3235, 2, 0, 53168, 2, 1, 4523, // 2, 0 - 1, 1, 4253, 1, 2, 2998, 2, 1, 54071, 2, 2, 4214, // 2, 1 - 1, 2, 3911, 1, 3, 2770, 2, 2, 54941, 2, 3, 3914, // 2, 2 - 1, 3, 3594, 1, 4, 2556, 2, 3, 55756, 2, 4, 3630, // 2, 3 - 1, 4, 3310, 1, 5, 2365, 2, 4, 56487, 2, 5, 3374, // 2, 4 - 1, 5, 3073, 1, 6, 2205, 2, 5, 57096, 2, 6, 3162, // 2, 5 - 1, 6, 2897, 1, 7, 2088, 2, 6, 57545, 2, 7, 3006, // 2, 6 - 1, 7, 2794, 1, 8, 2022, 2, 7, 57795, 2, 8, 2925, // 2, 7 - 2, 8, 57793, 2, 9, 2926, 3, 8, 2795, 3, 9, 2022, // 2, 8 - 2, 9, 57544, 2, 10, 3007, 3, 9, 2898, 3, 10, 2087, // 2, 9 - 2, 10, 57095, 2, 11, 3161, 3, 10, 3074, 3, 11, 2206, // 2,10 - 2, 11, 56486, 2, 12, 3373, 3, 11, 3311, 3, 12, 2366, // 2,11 - 2, 12, 55756, 2, 13, 3628, 3, 12, 3595, 3, 13, 2557, // 2,12 - 2, 13, 54941, 2, 14, 3911, 3, 13, 3913, 3, 14, 2771, // 2,13 - 2, 14, 54072, 2, 15, 4212, 3, 14, 4255, 3, 15, 2997, // 2,14 - 2, 15, 53168, 2, 16, 4521, 3, 15, 4612, 3, 16, 3235, // 2,15 - 2, 0, 4390, 2, 1, 3065, 3, 0, 53814, 3, 1, 4267, // 3, 0 - 2, 1, 4003, 2, 2, 2808, 3, 1, 54796, 3, 2, 3929, // 3, 1 - 2, 2, 3628, 2, 3, 2557, 3, 2, 55756, 3, 3, 3595, // 3, 2 - 2, 3, 3273, 2, 4, 2317, 3, 3, 56673, 3, 4, 3273, // 3, 3 - 2, 4, 2948, 2, 5, 2096, 3, 4, 57514, 3, 5, 2978, // 3, 4 - 2, 5, 2672, 2, 6, 1908, 3, 5, 58234, 3, 6, 2722, // 3, 5 - 2, 6, 2463, 2, 7, 1766, 3, 6, 58775, 3, 7, 2532, // 3, 6 - 2, 7, 2342, 2, 8, 1687, 3, 7, 59077, 3, 8, 2430, // 3, 7 - 3, 8, 59076, 3, 9, 2430, 4, 8, 2343, 4, 9, 1687, // 3, 8 - 3, 9, 58774, 3, 10, 2532, 4, 9, 2464, 4, 10, 1766, // 3, 9 - 3, 10, 58233, 3, 11, 2722, 4, 10, 2673, 4, 11, 1908, // 3,10 - 3, 11, 57514, 3, 12, 2976, 4, 11, 2950, 4, 12, 2096, // 3,11 - 3, 12, 56673, 3, 13, 3273, 4, 12, 3274, 4, 13, 2316, // 3,12 - 3, 13, 55756, 3, 14, 3594, 4, 13, 3630, 4, 14, 2556, // 3,13 - 3, 14, 54796, 3, 15, 3927, 4, 14, 4005, 4, 15, 2808, // 3,14 - 3, 15, 53815, 3, 16, 4264, 4, 15, 4392, 4, 16, 3065, // 3,15 - 3, 0, 4200, 3, 1, 2917, 4, 0, 54376, 4, 1, 4043, // 4, 0 - 3, 1, 3783, 3, 2, 2640, 4, 1, 55434, 4, 2, 3679, // 4, 1 - 3, 2, 3373, 3, 3, 2365, 4, 2, 56486, 4, 3, 3312, // 4, 2 - 3, 3, 2976, 3, 4, 2096, 4, 3, 57514, 4, 4, 2950, // 4, 3 - 3, 4, 2604, 3, 5, 1843, 4, 4, 58484, 4, 5, 2605, // 4, 4 - 3, 5, 2276, 3, 6, 1617, 4, 5, 59346, 4, 6, 2297, // 4, 5 - 3, 6, 2020, 3, 7, 1442, 4, 6, 60018, 4, 7, 2056, // 4, 6 - 3, 7, 1871, 3, 8, 1341, 4, 7, 60402, 4, 8, 1922, // 4, 7 - 4, 8, 60402, 4, 9, 1922, 5, 8, 1871, 5, 9, 1341, // 4, 8 - 4, 9, 60017, 4, 10, 2057, 5, 9, 2020, 5, 10, 1442, // 4, 9 - 4, 10, 59345, 4, 11, 2297, 5, 10, 2276, 5, 11, 1618, // 4,10 - 4, 11, 58484, 4, 12, 2604, 5, 11, 2605, 5, 12, 1843, // 4,11 - 4, 12, 57514, 4, 13, 2948, 5, 12, 2977, 5, 13, 2097, // 4,12 - 4, 13, 56487, 4, 14, 3310, 5, 13, 3374, 5, 14, 2365, // 4,13 - 4, 14, 55435, 4, 15, 3677, 5, 14, 3785, 5, 15, 2639, // 4,14 - 4, 15, 54378, 4, 16, 4041, 5, 15, 4201, 5, 16, 2916, // 4,15 - 4, 0, 4046, 4, 1, 2797, 5, 0, 54833, 5, 1, 3860, // 5, 0 - 4, 1, 3604, 4, 2, 2503, 5, 1, 55958, 5, 2, 3471, // 5, 1 - 4, 2, 3161, 4, 3, 2205, 5, 2, 57095, 5, 3, 3075, // 5, 2 - 4, 3, 2722, 4, 4, 1908, 5, 3, 58233, 5, 4, 2673, // 5, 3 - 4, 4, 2297, 4, 5, 1617, 5, 4, 59345, 5, 5, 2277, // 5, 4 - 4, 5, 1904, 4, 6, 1347, 5, 5, 60381, 5, 6, 1904, // 5, 5 - 4, 6, 1578, 4, 7, 1121, 5, 6, 61243, 5, 7, 1594, // 5, 6 - 4, 7, 1380, 4, 8, 985, 5, 7, 61767, 5, 8, 1404, // 5, 7 - 5, 8, 61767, 5, 9, 1405, 6, 8, 1380, 6, 9, 984, // 5, 8 - 5, 9, 61243, 5, 10, 1593, 6, 9, 1579, 6, 10, 1121, // 5, 9 - 5, 10, 60381, 5, 11, 1904, 6, 10, 1904, 6, 11, 1347, // 5,10 - 5, 11, 59346, 5, 12, 2276, 6, 11, 2297, 6, 12, 1617, // 5,11 - 5, 12, 58234, 5, 13, 2672, 6, 12, 2723, 6, 13, 1907, // 5,12 - 5, 13, 57096, 5, 14, 3073, 6, 13, 3161, 6, 14, 2206, // 5,13 - 5, 14, 55959, 5, 15, 3470, 6, 14, 3605, 6, 15, 2502, // 5,14 - 5, 15, 54835, 5, 16, 3858, 6, 15, 4047, 6, 16, 2796, // 5,15 - 5, 0, 3939, 5, 1, 2709, 6, 0, 55164, 6, 1, 3724, // 6, 0 - 5, 1, 3476, 5, 2, 2403, 6, 1, 56339, 6, 2, 3318, // 6, 1 - 5, 2, 3007, 5, 3, 2088, 6, 2, 57544, 6, 3, 2897, // 6, 2 - 5, 3, 2532, 5, 4, 1767, 6, 3, 58774, 6, 4, 2463, // 6, 3 - 5, 4, 2057, 5, 5, 1442, 6, 4, 60017, 6, 5, 2020, // 6, 4 - 5, 5, 1593, 5, 6, 1121, 6, 5, 61243, 6, 6, 1579, // 6, 5 - 5, 6, 1170, 5, 7, 827, 6, 6, 62369, 6, 7, 1170, // 6, 6 - 5, 7, 875, 5, 8, 622, 6, 7, 63156, 6, 8, 883, // 6, 7 - 6, 8, 63156, 6, 9, 883, 7, 8, 875, 7, 9, 622, // 6, 8 - 6, 9, 62369, 6, 10, 1170, 7, 9, 1170, 7, 10, 827, // 6, 9 - 6, 10, 61243, 6, 11, 1578, 7, 10, 1593, 7, 11, 1122, // 6,10 - 6, 11, 60018, 6, 12, 2020, 7, 11, 2057, 7, 12, 1441, // 6,11 - 6, 12, 58775, 6, 13, 2463, 7, 12, 2532, 7, 13, 1766, // 6,12 - 6, 13, 57545, 6, 14, 2897, 7, 13, 3007, 7, 14, 2087, // 6,13 - 6, 14, 56340, 6, 15, 3317, 7, 14, 3477, 7, 15, 2402, // 6,14 - 6, 15, 55166, 6, 16, 3722, 7, 15, 3940, 7, 16, 2708, // 6,15 - 6, 0, 3885, 6, 1, 2659, 7, 0, 55352, 7, 1, 3640, // 7, 0 - 6, 1, 3411, 6, 2, 2346, 7, 1, 56552, 7, 2, 3227, // 7, 1 - 6, 2, 2926, 6, 3, 2022, 7, 2, 57793, 7, 3, 2795, // 7, 2 - 6, 3, 2430, 6, 4, 1687, 7, 3, 59076, 7, 4, 2343, // 7, 3 - 6, 4, 1922, 6, 5, 1341, 7, 4, 60402, 7, 5, 1871, // 7, 4 - 6, 5, 1405, 6, 6, 985, 7, 5, 61767, 7, 6, 1379, // 7, 5 - 6, 6, 883, 6, 7, 622, 7, 6, 63156, 7, 7, 875, // 7, 6 - 6, 7, 399, 6, 8, 282, 7, 7, 64455, 7, 8, 400, // 7, 7 - 7, 8, 64455, 7, 9, 399, 8, 8, 399, 8, 9, 283, // 7, 8 - 7, 9, 63156, 7, 10, 875, 8, 9, 883, 8, 10, 622, // 7, 9 - 7, 10, 61767, 7, 11, 1380, 8, 10, 1405, 8, 11, 984, // 7,10 - 7, 11, 60402, 7, 12, 1871, 8, 11, 1922, 8, 12, 1341, // 7,11 - 7, 12, 59077, 7, 13, 2342, 8, 12, 2430, 8, 13, 1687, // 7,12 - 7, 13, 57795, 7, 14, 2794, 8, 13, 2926, 8, 14, 2021, // 7,13 - 7, 14, 56554, 7, 15, 3225, 8, 14, 3411, 8, 15, 2346, // 7,14 - 7, 15, 55354, 7, 16, 3638, 8, 15, 3885, 8, 16, 2659, // 7,15 - 7, -1, 2659, 7, 0, 3885, 8, -1, 3638, 8, 0, 55354, // 8, 0 - 7, 0, 2346, 7, 1, 3411, 8, 0, 3225, 8, 1, 56554, // 8, 1 - 7, 1, 2022, 7, 2, 2926, 8, 1, 2794, 8, 2, 57794, // 8, 2 - 7, 2, 1687, 7, 3, 2430, 8, 2, 2342, 8, 3, 59077, // 8, 3 - 7, 3, 1341, 7, 4, 1922, 8, 3, 1871, 8, 4, 60402, // 8, 4 - 7, 4, 985, 7, 5, 1405, 8, 4, 1380, 8, 5, 61766, // 8, 5 - 7, 5, 622, 7, 6, 883, 8, 5, 875, 8, 6, 63156, // 8, 6 - 7, 6, 282, 7, 7, 399, 8, 6, 399, 8, 7, 64456, // 8, 7 - 8, 7, 399, 8, 8, 64455, 9, 7, 282, 9, 8, 400, // 8, 8 - 8, 8, 875, 8, 9, 63156, 9, 8, 622, 9, 9, 883, // 8, 9 - 8, 9, 1380, 8, 10, 61767, 9, 9, 985, 9, 10, 1404, // 8,10 - 8, 10, 1871, 8, 11, 60402, 9, 10, 1341, 9, 11, 1922, // 8,11 - 8, 11, 2343, 8, 12, 59076, 9, 11, 1687, 9, 12, 2430, // 8,12 - 8, 12, 2795, 8, 13, 57793, 9, 12, 2022, 9, 13, 2926, // 8,13 - 8, 13, 3227, 8, 14, 56552, 9, 13, 2346, 9, 14, 3411, // 8,14 - 8, 14, 3640, 8, 15, 55352, 9, 14, 2659, 9, 15, 3885, // 8,15 - 8, -1, 2709, 8, 0, 3940, 9, -1, 3722, 9, 0, 55165, // 9, 0 - 8, 0, 2402, 8, 1, 3477, 9, 0, 3317, 9, 1, 56340, // 9, 1 - 8, 1, 2088, 8, 2, 3007, 9, 1, 2897, 9, 2, 57544, // 9, 2 - 8, 2, 1766, 8, 3, 2532, 9, 2, 2463, 9, 3, 58775, // 9, 3 - 8, 3, 1442, 8, 4, 2057, 9, 3, 2020, 9, 4, 60017, // 9, 4 - 8, 4, 1121, 8, 5, 1593, 9, 4, 1578, 9, 5, 61244, // 9, 5 - 8, 5, 827, 8, 6, 1170, 9, 5, 1170, 9, 6, 62369, // 9, 6 - 8, 6, 622, 8, 7, 875, 9, 6, 883, 9, 7, 63156, // 9, 7 - 9, 7, 883, 9, 8, 63156, 10, 7, 622, 10, 8, 875, // 9, 8 - 9, 8, 1170, 9, 9, 62369, 10, 8, 827, 10, 9, 1170, // 9, 9 - 9, 9, 1579, 9, 10, 61243, 10, 9, 1121, 10, 10, 1593, // 9,10 - 9, 10, 2020, 9, 11, 60017, 10, 10, 1442, 10, 11, 2057, // 9,11 - 9, 11, 2464, 9, 12, 58774, 10, 11, 1767, 10, 12, 2531, // 9,12 - 9, 12, 2898, 9, 13, 57544, 10, 12, 2088, 10, 13, 3006, // 9,13 - 9, 13, 3319, 9, 14, 56339, 10, 13, 2403, 10, 14, 3475, // 9,14 - 9, 14, 3724, 9, 15, 55164, 10, 14, 2709, 10, 15, 3939, // 9,15 - 9, -1, 2796, 9, 0, 4047, 10, -1, 3858, 10, 0, 54835, // 10, 0 - 9, 0, 2502, 9, 1, 3605, 10, 0, 3470, 10, 1, 55959, // 10, 1 - 9, 1, 2205, 9, 2, 3161, 10, 1, 3073, 10, 2, 57097, // 10, 2 - 9, 2, 1908, 9, 3, 2723, 10, 2, 2672, 10, 3, 58233, // 10, 3 - 9, 3, 1617, 9, 4, 2297, 10, 3, 2276, 10, 4, 59346, // 10, 4 - 9, 4, 1347, 9, 5, 1904, 10, 4, 1904, 10, 5, 60381, // 10, 5 - 9, 5, 1121, 9, 6, 1579, 10, 5, 1593, 10, 6, 61243, // 10, 6 - 9, 6, 985, 9, 7, 1380, 10, 6, 1405, 10, 7, 61766, // 10, 7 - 10, 7, 1405, 10, 8, 61767, 11, 7, 985, 11, 8, 1379, // 10, 8 - 10, 8, 1593, 10, 9, 61243, 11, 8, 1121, 11, 9, 1579, // 10, 9 - 10, 9, 1904, 10, 10, 60381, 11, 9, 1347, 11, 10, 1904, // 10,10 - 10, 10, 2276, 10, 11, 59345, 11, 10, 1617, 11, 11, 2298, // 10,11 - 10, 11, 2673, 10, 12, 58233, 11, 11, 1908, 11, 12, 2722, // 10,12 - 10, 12, 3074, 10, 13, 57095, 11, 12, 2205, 11, 13, 3162, // 10,13 - 10, 13, 3472, 10, 14, 55958, 11, 13, 2503, 11, 14, 3603, // 10,14 - 10, 14, 3860, 10, 15, 54833, 11, 14, 2797, 11, 15, 4046, // 10,15 - 10, -1, 2916, 10, 0, 4201, 11, -1, 4041, 11, 0, 54378, // 11, 0 - 10, 0, 2640, 10, 1, 3785, 11, 0, 3677, 11, 1, 55434, // 11, 1 - 10, 1, 2365, 10, 2, 3374, 11, 1, 3310, 11, 2, 56487, // 11, 2 - 10, 2, 2096, 10, 3, 2977, 11, 2, 2948, 11, 3, 57515, // 11, 3 - 10, 3, 1843, 10, 4, 2605, 11, 3, 2604, 11, 4, 58484, // 11, 4 - 10, 4, 1617, 10, 5, 2276, 11, 4, 2297, 11, 5, 59346, // 11, 5 - 10, 5, 1442, 10, 6, 2020, 11, 5, 2057, 11, 6, 60017, // 11, 6 - 10, 6, 1341, 10, 7, 1871, 11, 6, 1922, 11, 7, 60402, // 11, 7 - 11, 7, 1922, 11, 8, 60402, 12, 7, 1341, 12, 8, 1871, // 11, 8 - 11, 8, 2057, 11, 9, 60018, 12, 8, 1442, 12, 9, 2019, // 11, 9 - 11, 9, 2297, 11, 10, 59346, 12, 9, 1617, 12, 10, 2276, // 11,10 - 11, 10, 2605, 11, 11, 58484, 12, 10, 1843, 12, 11, 2604, // 11,11 - 11, 11, 2950, 11, 12, 57514, 12, 11, 2096, 12, 12, 2976, // 11,12 - 11, 12, 3311, 11, 13, 56486, 12, 12, 2365, 12, 13, 3374, // 11,13 - 11, 13, 3678, 11, 14, 55434, 12, 13, 2640, 12, 14, 3784, // 11,14 - 11, 14, 4043, 11, 15, 54376, 12, 14, 2917, 12, 15, 4200, // 11,15 - 11, -1, 3064, 11, 0, 4392, 12, -1, 4264, 12, 0, 53816, // 12, 0 - 11, 0, 2808, 11, 1, 4005, 12, 0, 3927, 12, 1, 54796, // 12, 1 - 11, 1, 2556, 11, 2, 3630, 12, 1, 3594, 12, 2, 55756, // 12, 2 - 11, 2, 2317, 11, 3, 3274, 12, 2, 3273, 12, 3, 56672, // 12, 3 - 11, 3, 2096, 11, 4, 2950, 12, 3, 2976, 12, 4, 57514, // 12, 4 - 11, 4, 1908, 11, 5, 2673, 12, 4, 2722, 12, 5, 58233, // 12, 5 - 11, 5, 1767, 11, 6, 2464, 12, 5, 2532, 12, 6, 58773, // 12, 6 - 11, 6, 1687, 11, 7, 2343, 12, 6, 2430, 12, 7, 59076, // 12, 7 - 12, 7, 2430, 12, 8, 59077, 13, 7, 1687, 13, 8, 2342, // 12, 8 - 12, 8, 2532, 12, 9, 58775, 13, 8, 1766, 13, 9, 2463, // 12, 9 - 12, 9, 2723, 12, 10, 58234, 13, 9, 1908, 13, 10, 2671, // 12,10 - 12, 10, 2977, 12, 11, 57514, 13, 10, 2096, 13, 11, 2949, // 12,11 - 12, 11, 3274, 12, 12, 56673, 13, 11, 2317, 13, 12, 3272, // 12,12 - 12, 12, 3595, 12, 13, 55756, 13, 12, 2557, 13, 13, 3628, // 12,13 - 12, 13, 3929, 12, 14, 54796, 13, 13, 2808, 13, 14, 4003, // 12,14 - 12, 14, 4267, 12, 15, 53814, 13, 14, 3065, 13, 15, 4390, // 12,15 - 12, -1, 3235, 12, 0, 4612, 13, -1, 4521, 13, 0, 53168, // 13, 0 - 12, 0, 2998, 12, 1, 4255, 13, 0, 4212, 13, 1, 54071, // 13, 1 - 12, 1, 2770, 12, 2, 3913, 13, 1, 3911, 13, 2, 54942, // 13, 2 - 12, 2, 2557, 12, 3, 3595, 13, 2, 3628, 13, 3, 55756, // 13, 3 - 12, 3, 2365, 12, 4, 3311, 13, 3, 3373, 13, 4, 56487, // 13, 4 - 12, 4, 2205, 12, 5, 3074, 13, 4, 3161, 13, 5, 57096, // 13, 5 - 12, 5, 2088, 12, 6, 2898, 13, 5, 3007, 13, 6, 57543, // 13, 6 - 12, 6, 2022, 12, 7, 2795, 13, 6, 2926, 13, 7, 57793, // 13, 7 - 13, 7, 2926, 13, 8, 57795, 14, 7, 2022, 14, 8, 2793, // 13, 8 - 13, 8, 3007, 13, 9, 57545, 14, 8, 2088, 14, 9, 2896, // 13, 9 - 13, 9, 3161, 13, 10, 57096, 14, 9, 2205, 14, 10, 3074, // 13,10 - 13, 10, 3374, 13, 11, 56487, 14, 10, 2365, 14, 11, 3310, // 13,11 - 13, 11, 3630, 13, 12, 55756, 14, 11, 2556, 14, 12, 3594, // 13,12 - 13, 12, 3913, 13, 13, 54941, 14, 12, 2770, 14, 13, 3912, // 13,13 - 13, 13, 4214, 13, 14, 54071, 14, 13, 2998, 14, 14, 4253, // 13,14 - 13, 14, 4523, 13, 15, 53168, 14, 14, 3235, 14, 15, 4610, // 13,15 - 13, -1, 3421, 13, 0, 4854, 14, -1, 4803, 14, 0, 52458, // 14, 0 - 13, 0, 3204, 13, 1, 4525, 14, 0, 4522, 14, 1, 53285, // 14, 1 - 13, 1, 2998, 13, 2, 4214, 14, 1, 4253, 14, 2, 54071, // 14, 2 - 13, 2, 2808, 13, 3, 3929, 14, 2, 4003, 14, 3, 54796, // 14, 3 - 13, 3, 2640, 13, 4, 3678, 14, 3, 3783, 14, 4, 55435, // 14, 4 - 13, 4, 2503, 13, 5, 3472, 14, 4, 3604, 14, 5, 55957, // 14, 5 - 13, 5, 2403, 13, 6, 3319, 14, 5, 3476, 14, 6, 56338, // 14, 6 - 13, 6, 2346, 13, 7, 3227, 14, 6, 3411, 14, 7, 56552, // 14, 7 - 14, 7, 3411, 14, 8, 56554, 15, 7, 2346, 15, 8, 3225, // 14, 8 - 14, 8, 3477, 14, 9, 56340, 15, 8, 2402, 15, 9, 3317, // 14, 9 - 14, 9, 3605, 14, 10, 55959, 15, 9, 2502, 15, 10, 3470, // 14,10 - 14, 10, 3785, 14, 11, 55435, 15, 10, 2640, 15, 11, 3676, // 14,11 - 14, 11, 4005, 14, 12, 54796, 15, 11, 2808, 15, 12, 3927, // 14,12 - 14, 12, 4255, 14, 13, 54072, 15, 12, 2998, 15, 13, 4211, // 14,13 - 14, 13, 4525, 14, 14, 53285, 15, 13, 3204, 15, 14, 4522, // 14,14 - 14, 14, 4806, 14, 15, 52457, 15, 14, 3422, 15, 15, 4851, // 14,15 - 14, -1, 3621, 14, 0, 5110, 15, -1, 5106, 15, 0, 51699, // 15, 0 - 14, 0, 3422, 14, 1, 4806, 15, 0, 4851, 15, 1, 52457, // 15, 1 - 14, 1, 3235, 14, 2, 4523, 15, 1, 4610, 15, 2, 53168, // 15, 2 - 14, 2, 3065, 14, 3, 4267, 15, 2, 4390, 15, 3, 53814, // 15, 3 - 14, 3, 2917, 14, 4, 4043, 15, 3, 4200, 15, 4, 54376, // 15, 4 - 14, 4, 2797, 14, 5, 3860, 15, 4, 4046, 15, 5, 54833, // 15, 5 - 14, 5, 2709, 14, 6, 3724, 15, 5, 3939, 15, 6, 55164, // 15, 6 - 14, 6, 2659, 14, 7, 3640, 15, 6, 3885, 15, 7, 55352, // 15, 7 - 15, 7, 3885, 15, 8, 55354, 16, 7, 2659, 16, 8, 3638, // 15, 8 - 15, 8, 3940, 15, 9, 55166, 16, 8, 2709, 16, 9, 3721, // 15, 9 - 15, 9, 4047, 15, 10, 54835, 16, 9, 2796, 16, 10, 3858, // 15,10 - 15, 10, 4201, 15, 11, 54378, 16, 10, 2916, 16, 11, 4041, // 15,11 - 15, 11, 4392, 15, 12, 53815, 16, 11, 3064, 16, 12, 4265, // 15,12 - 15, 12, 4612, 15, 13, 53168, 16, 12, 3235, 16, 13, 4521, // 15,13 - 15, 13, 4854, 15, 14, 52457, 16, 13, 3421, 16, 14, 4804, // 15,14 - 15, 14, 5110, 15, 15, 51699, 16, 14, 3621, 16, 15, 5106, // 15,15 - // angle of 0.0 degrees - 0, 0, 16384, 0, 0, 16384, 0, 0, 16384, 0, 0, 16384, // 0, 0 - 0, 1, 16384, 0, 1, 16384, 0, 1, 16384, 0, 1, 16384, // 0, 1 - 0, 2, 16384, 0, 2, 16384, 0, 2, 16384, 0, 2, 16384, // 0, 2 - 0, 3, 16384, 0, 3, 16384, 0, 3, 16384, 0, 3, 16384, // 0, 3 - 0, 4, 16384, 0, 4, 16384, 0, 4, 16384, 0, 4, 16384, // 0, 4 - 0, 5, 16384, 0, 5, 16384, 0, 5, 16384, 0, 5, 16384, // 0, 5 - 0, 6, 16384, 0, 6, 16384, 0, 6, 16384, 0, 6, 16384, // 0, 6 - 0, 7, 16384, 0, 7, 16384, 0, 7, 16384, 0, 7, 16384, // 0, 7 - 0, 8, 16384, 0, 8, 16384, 0, 8, 16384, 0, 8, 16384, // 0, 8 - 0, 9, 16384, 0, 9, 16384, 0, 9, 16384, 0, 9, 16384, // 0, 9 - 0, 10, 16384, 0, 10, 16384, 0, 10, 16384, 0, 10, 16384, // 0,10 - 0, 11, 16384, 0, 11, 16384, 0, 11, 16384, 0, 11, 16384, // 0,11 - 0, 12, 16384, 0, 12, 16384, 0, 12, 16384, 0, 12, 16384, // 0,12 - 0, 13, 16384, 0, 13, 16384, 0, 13, 16384, 0, 13, 16384, // 0,13 - 0, 14, 16384, 0, 14, 16384, 0, 14, 16384, 0, 14, 16384, // 0,14 - 0, 15, 16384, 0, 15, 16384, 0, 15, 16384, 0, 15, 16384, // 0,15 - 1, 0, 16384, 1, 0, 16384, 1, 0, 16384, 1, 0, 16384, // 1, 0 - 1, 1, 16384, 1, 1, 16384, 1, 1, 16384, 1, 1, 16384, // 1, 1 - 1, 2, 16384, 1, 2, 16384, 1, 2, 16384, 1, 2, 16384, // 1, 2 - 1, 3, 16384, 1, 3, 16384, 1, 3, 16384, 1, 3, 16384, // 1, 3 - 1, 4, 16384, 1, 4, 16384, 1, 4, 16384, 1, 4, 16384, // 1, 4 - 1, 5, 16384, 1, 5, 16384, 1, 5, 16384, 1, 5, 16384, // 1, 5 - 1, 6, 16384, 1, 6, 16384, 1, 6, 16384, 1, 6, 16384, // 1, 6 - 1, 7, 16384, 1, 7, 16384, 1, 7, 16384, 1, 7, 16384, // 1, 7 - 1, 8, 16384, 1, 8, 16384, 1, 8, 16384, 1, 8, 16384, // 1, 8 - 1, 9, 16384, 1, 9, 16384, 1, 9, 16384, 1, 9, 16384, // 1, 9 - 1, 10, 16384, 1, 10, 16384, 1, 10, 16384, 1, 10, 16384, // 1,10 - 1, 11, 16384, 1, 11, 16384, 1, 11, 16384, 1, 11, 16384, // 1,11 - 1, 12, 16384, 1, 12, 16384, 1, 12, 16384, 1, 12, 16384, // 1,12 - 1, 13, 16384, 1, 13, 16384, 1, 13, 16384, 1, 13, 16384, // 1,13 - 1, 14, 16384, 1, 14, 16384, 1, 14, 16384, 1, 14, 16384, // 1,14 - 1, 15, 16384, 1, 15, 16384, 1, 15, 16384, 1, 15, 16384, // 1,15 - 2, 0, 16384, 2, 0, 16384, 2, 0, 16384, 2, 0, 16384, // 2, 0 - 2, 1, 16384, 2, 1, 16384, 2, 1, 16384, 2, 1, 16384, // 2, 1 - 2, 2, 16384, 2, 2, 16384, 2, 2, 16384, 2, 2, 16384, // 2, 2 - 2, 3, 16384, 2, 3, 16384, 2, 3, 16384, 2, 3, 16384, // 2, 3 - 2, 4, 16384, 2, 4, 16384, 2, 4, 16384, 2, 4, 16384, // 2, 4 - 2, 5, 16384, 2, 5, 16384, 2, 5, 16384, 2, 5, 16384, // 2, 5 - 2, 6, 16384, 2, 6, 16384, 2, 6, 16384, 2, 6, 16384, // 2, 6 - 2, 7, 16384, 2, 7, 16384, 2, 7, 16384, 2, 7, 16384, // 2, 7 - 2, 8, 16384, 2, 8, 16384, 2, 8, 16384, 2, 8, 16384, // 2, 8 - 2, 9, 16384, 2, 9, 16384, 2, 9, 16384, 2, 9, 16384, // 2, 9 - 2, 10, 16384, 2, 10, 16384, 2, 10, 16384, 2, 10, 16384, // 2,10 - 2, 11, 16384, 2, 11, 16384, 2, 11, 16384, 2, 11, 16384, // 2,11 - 2, 12, 16384, 2, 12, 16384, 2, 12, 16384, 2, 12, 16384, // 2,12 - 2, 13, 16384, 2, 13, 16384, 2, 13, 16384, 2, 13, 16384, // 2,13 - 2, 14, 16384, 2, 14, 16384, 2, 14, 16384, 2, 14, 16384, // 2,14 - 2, 15, 16384, 2, 15, 16384, 2, 15, 16384, 2, 15, 16384, // 2,15 - 3, 0, 16384, 3, 0, 16384, 3, 0, 16384, 3, 0, 16384, // 3, 0 - 3, 1, 16384, 3, 1, 16384, 3, 1, 16384, 3, 1, 16384, // 3, 1 - 3, 2, 16384, 3, 2, 16384, 3, 2, 16384, 3, 2, 16384, // 3, 2 - 3, 3, 16384, 3, 3, 16384, 3, 3, 16384, 3, 3, 16384, // 3, 3 - 3, 4, 16384, 3, 4, 16384, 3, 4, 16384, 3, 4, 16384, // 3, 4 - 3, 5, 16384, 3, 5, 16384, 3, 5, 16384, 3, 5, 16384, // 3, 5 - 3, 6, 16384, 3, 6, 16384, 3, 6, 16384, 3, 6, 16384, // 3, 6 - 3, 7, 16384, 3, 7, 16384, 3, 7, 16384, 3, 7, 16384, // 3, 7 - 3, 8, 16384, 3, 8, 16384, 3, 8, 16384, 3, 8, 16384, // 3, 8 - 3, 9, 16384, 3, 9, 16384, 3, 9, 16384, 3, 9, 16384, // 3, 9 - 3, 10, 16384, 3, 10, 16384, 3, 10, 16384, 3, 10, 16384, // 3,10 - 3, 11, 16384, 3, 11, 16384, 3, 11, 16384, 3, 11, 16384, // 3,11 - 3, 12, 16384, 3, 12, 16384, 3, 12, 16384, 3, 12, 16384, // 3,12 - 3, 13, 16384, 3, 13, 16384, 3, 13, 16384, 3, 13, 16384, // 3,13 - 3, 14, 16384, 3, 14, 16384, 3, 14, 16384, 3, 14, 16384, // 3,14 - 3, 15, 16384, 3, 15, 16384, 3, 15, 16384, 3, 15, 16384, // 3,15 - 4, 0, 16384, 4, 0, 16384, 4, 0, 16384, 4, 0, 16384, // 4, 0 - 4, 1, 16384, 4, 1, 16384, 4, 1, 16384, 4, 1, 16384, // 4, 1 - 4, 2, 16384, 4, 2, 16384, 4, 2, 16384, 4, 2, 16384, // 4, 2 - 4, 3, 16384, 4, 3, 16384, 4, 3, 16384, 4, 3, 16384, // 4, 3 - 4, 4, 16384, 4, 4, 16384, 4, 4, 16384, 4, 4, 16384, // 4, 4 - 4, 5, 16384, 4, 5, 16384, 4, 5, 16384, 4, 5, 16384, // 4, 5 - 4, 6, 16384, 4, 6, 16384, 4, 6, 16384, 4, 6, 16384, // 4, 6 - 4, 7, 16384, 4, 7, 16384, 4, 7, 16384, 4, 7, 16384, // 4, 7 - 4, 8, 16384, 4, 8, 16384, 4, 8, 16384, 4, 8, 16384, // 4, 8 - 4, 9, 16384, 4, 9, 16384, 4, 9, 16384, 4, 9, 16384, // 4, 9 - 4, 10, 16384, 4, 10, 16384, 4, 10, 16384, 4, 10, 16384, // 4,10 - 4, 11, 16384, 4, 11, 16384, 4, 11, 16384, 4, 11, 16384, // 4,11 - 4, 12, 16384, 4, 12, 16384, 4, 12, 16384, 4, 12, 16384, // 4,12 - 4, 13, 16384, 4, 13, 16384, 4, 13, 16384, 4, 13, 16384, // 4,13 - 4, 14, 16384, 4, 14, 16384, 4, 14, 16384, 4, 14, 16384, // 4,14 - 4, 15, 16384, 4, 15, 16384, 4, 15, 16384, 4, 15, 16384, // 4,15 - 5, 0, 16384, 5, 0, 16384, 5, 0, 16384, 5, 0, 16384, // 5, 0 - 5, 1, 16384, 5, 1, 16384, 5, 1, 16384, 5, 1, 16384, // 5, 1 - 5, 2, 16384, 5, 2, 16384, 5, 2, 16384, 5, 2, 16384, // 5, 2 - 5, 3, 16384, 5, 3, 16384, 5, 3, 16384, 5, 3, 16384, // 5, 3 - 5, 4, 16384, 5, 4, 16384, 5, 4, 16384, 5, 4, 16384, // 5, 4 - 5, 5, 16384, 5, 5, 16384, 5, 5, 16384, 5, 5, 16384, // 5, 5 - 5, 6, 16384, 5, 6, 16384, 5, 6, 16384, 5, 6, 16384, // 5, 6 - 5, 7, 16384, 5, 7, 16384, 5, 7, 16384, 5, 7, 16384, // 5, 7 - 5, 8, 16384, 5, 8, 16384, 5, 8, 16384, 5, 8, 16384, // 5, 8 - 5, 9, 16384, 5, 9, 16384, 5, 9, 16384, 5, 9, 16384, // 5, 9 - 5, 10, 16384, 5, 10, 16384, 5, 10, 16384, 5, 10, 16384, // 5,10 - 5, 11, 16384, 5, 11, 16384, 5, 11, 16384, 5, 11, 16384, // 5,11 - 5, 12, 16384, 5, 12, 16384, 5, 12, 16384, 5, 12, 16384, // 5,12 - 5, 13, 16384, 5, 13, 16384, 5, 13, 16384, 5, 13, 16384, // 5,13 - 5, 14, 16384, 5, 14, 16384, 5, 14, 16384, 5, 14, 16384, // 5,14 - 5, 15, 16384, 5, 15, 16384, 5, 15, 16384, 5, 15, 16384, // 5,15 - 6, 0, 16384, 6, 0, 16384, 6, 0, 16384, 6, 0, 16384, // 6, 0 - 6, 1, 16384, 6, 1, 16384, 6, 1, 16384, 6, 1, 16384, // 6, 1 - 6, 2, 16384, 6, 2, 16384, 6, 2, 16384, 6, 2, 16384, // 6, 2 - 6, 3, 16384, 6, 3, 16384, 6, 3, 16384, 6, 3, 16384, // 6, 3 - 6, 4, 16384, 6, 4, 16384, 6, 4, 16384, 6, 4, 16384, // 6, 4 - 6, 5, 16384, 6, 5, 16384, 6, 5, 16384, 6, 5, 16384, // 6, 5 - 6, 6, 16384, 6, 6, 16384, 6, 6, 16384, 6, 6, 16384, // 6, 6 - 6, 7, 16384, 6, 7, 16384, 6, 7, 16384, 6, 7, 16384, // 6, 7 - 6, 8, 16384, 6, 8, 16384, 6, 8, 16384, 6, 8, 16384, // 6, 8 - 6, 9, 16384, 6, 9, 16384, 6, 9, 16384, 6, 9, 16384, // 6, 9 - 6, 10, 16384, 6, 10, 16384, 6, 10, 16384, 6, 10, 16384, // 6,10 - 6, 11, 16384, 6, 11, 16384, 6, 11, 16384, 6, 11, 16384, // 6,11 - 6, 12, 16384, 6, 12, 16384, 6, 12, 16384, 6, 12, 16384, // 6,12 - 6, 13, 16384, 6, 13, 16384, 6, 13, 16384, 6, 13, 16384, // 6,13 - 6, 14, 16384, 6, 14, 16384, 6, 14, 16384, 6, 14, 16384, // 6,14 - 6, 15, 16384, 6, 15, 16384, 6, 15, 16384, 6, 15, 16384, // 6,15 - 7, 0, 16384, 7, 0, 16384, 7, 0, 16384, 7, 0, 16384, // 7, 0 - 7, 1, 16384, 7, 1, 16384, 7, 1, 16384, 7, 1, 16384, // 7, 1 - 7, 2, 16384, 7, 2, 16384, 7, 2, 16384, 7, 2, 16384, // 7, 2 - 7, 3, 16384, 7, 3, 16384, 7, 3, 16384, 7, 3, 16384, // 7, 3 - 7, 4, 16384, 7, 4, 16384, 7, 4, 16384, 7, 4, 16384, // 7, 4 - 7, 5, 16384, 7, 5, 16384, 7, 5, 16384, 7, 5, 16384, // 7, 5 - 7, 6, 16384, 7, 6, 16384, 7, 6, 16384, 7, 6, 16384, // 7, 6 - 7, 7, 16384, 7, 7, 16384, 7, 7, 16384, 7, 7, 16384, // 7, 7 - 7, 8, 16384, 7, 8, 16384, 7, 8, 16384, 7, 8, 16384, // 7, 8 - 7, 9, 16384, 7, 9, 16384, 7, 9, 16384, 7, 9, 16384, // 7, 9 - 7, 10, 16384, 7, 10, 16384, 7, 10, 16384, 7, 10, 16384, // 7,10 - 7, 11, 16384, 7, 11, 16384, 7, 11, 16384, 7, 11, 16384, // 7,11 - 7, 12, 16384, 7, 12, 16384, 7, 12, 16384, 7, 12, 16384, // 7,12 - 7, 13, 16384, 7, 13, 16384, 7, 13, 16384, 7, 13, 16384, // 7,13 - 7, 14, 16384, 7, 14, 16384, 7, 14, 16384, 7, 14, 16384, // 7,14 - 7, 15, 16384, 7, 15, 16384, 7, 15, 16384, 7, 15, 16384, // 7,15 - 8, 0, 16384, 8, 0, 16384, 8, 0, 16384, 8, 0, 16384, // 8, 0 - 8, 1, 16384, 8, 1, 16384, 8, 1, 16384, 8, 1, 16384, // 8, 1 - 8, 2, 16384, 8, 2, 16384, 8, 2, 16384, 8, 2, 16384, // 8, 2 - 8, 3, 16384, 8, 3, 16384, 8, 3, 16384, 8, 3, 16384, // 8, 3 - 8, 4, 16384, 8, 4, 16384, 8, 4, 16384, 8, 4, 16384, // 8, 4 - 8, 5, 16384, 8, 5, 16384, 8, 5, 16384, 8, 5, 16384, // 8, 5 - 8, 6, 16384, 8, 6, 16384, 8, 6, 16384, 8, 6, 16384, // 8, 6 - 8, 7, 16384, 8, 7, 16384, 8, 7, 16384, 8, 7, 16384, // 8, 7 - 8, 8, 16384, 8, 8, 16384, 8, 8, 16384, 8, 8, 16384, // 8, 8 - 8, 9, 16384, 8, 9, 16384, 8, 9, 16384, 8, 9, 16384, // 8, 9 - 8, 10, 16384, 8, 10, 16384, 8, 10, 16384, 8, 10, 16384, // 8,10 - 8, 11, 16384, 8, 11, 16384, 8, 11, 16384, 8, 11, 16384, // 8,11 - 8, 12, 16384, 8, 12, 16384, 8, 12, 16384, 8, 12, 16384, // 8,12 - 8, 13, 16384, 8, 13, 16384, 8, 13, 16384, 8, 13, 16384, // 8,13 - 8, 14, 16384, 8, 14, 16384, 8, 14, 16384, 8, 14, 16384, // 8,14 - 8, 15, 16384, 8, 15, 16384, 8, 15, 16384, 8, 15, 16384, // 8,15 - 9, 0, 16384, 9, 0, 16384, 9, 0, 16384, 9, 0, 16384, // 9, 0 - 9, 1, 16384, 9, 1, 16384, 9, 1, 16384, 9, 1, 16384, // 9, 1 - 9, 2, 16384, 9, 2, 16384, 9, 2, 16384, 9, 2, 16384, // 9, 2 - 9, 3, 16384, 9, 3, 16384, 9, 3, 16384, 9, 3, 16384, // 9, 3 - 9, 4, 16384, 9, 4, 16384, 9, 4, 16384, 9, 4, 16384, // 9, 4 - 9, 5, 16384, 9, 5, 16384, 9, 5, 16384, 9, 5, 16384, // 9, 5 - 9, 6, 16384, 9, 6, 16384, 9, 6, 16384, 9, 6, 16384, // 9, 6 - 9, 7, 16384, 9, 7, 16384, 9, 7, 16384, 9, 7, 16384, // 9, 7 - 9, 8, 16384, 9, 8, 16384, 9, 8, 16384, 9, 8, 16384, // 9, 8 - 9, 9, 16384, 9, 9, 16384, 9, 9, 16384, 9, 9, 16384, // 9, 9 - 9, 10, 16384, 9, 10, 16384, 9, 10, 16384, 9, 10, 16384, // 9,10 - 9, 11, 16384, 9, 11, 16384, 9, 11, 16384, 9, 11, 16384, // 9,11 - 9, 12, 16384, 9, 12, 16384, 9, 12, 16384, 9, 12, 16384, // 9,12 - 9, 13, 16384, 9, 13, 16384, 9, 13, 16384, 9, 13, 16384, // 9,13 - 9, 14, 16384, 9, 14, 16384, 9, 14, 16384, 9, 14, 16384, // 9,14 - 9, 15, 16384, 9, 15, 16384, 9, 15, 16384, 9, 15, 16384, // 9,15 - 10, 0, 16384, 10, 0, 16384, 10, 0, 16384, 10, 0, 16384, // 10, 0 - 10, 1, 16384, 10, 1, 16384, 10, 1, 16384, 10, 1, 16384, // 10, 1 - 10, 2, 16384, 10, 2, 16384, 10, 2, 16384, 10, 2, 16384, // 10, 2 - 10, 3, 16384, 10, 3, 16384, 10, 3, 16384, 10, 3, 16384, // 10, 3 - 10, 4, 16384, 10, 4, 16384, 10, 4, 16384, 10, 4, 16384, // 10, 4 - 10, 5, 16384, 10, 5, 16384, 10, 5, 16384, 10, 5, 16384, // 10, 5 - 10, 6, 16384, 10, 6, 16384, 10, 6, 16384, 10, 6, 16384, // 10, 6 - 10, 7, 16384, 10, 7, 16384, 10, 7, 16384, 10, 7, 16384, // 10, 7 - 10, 8, 16384, 10, 8, 16384, 10, 8, 16384, 10, 8, 16384, // 10, 8 - 10, 9, 16384, 10, 9, 16384, 10, 9, 16384, 10, 9, 16384, // 10, 9 - 10, 10, 16384, 10, 10, 16384, 10, 10, 16384, 10, 10, 16384, // 10,10 - 10, 11, 16384, 10, 11, 16384, 10, 11, 16384, 10, 11, 16384, // 10,11 - 10, 12, 16384, 10, 12, 16384, 10, 12, 16384, 10, 12, 16384, // 10,12 - 10, 13, 16384, 10, 13, 16384, 10, 13, 16384, 10, 13, 16384, // 10,13 - 10, 14, 16384, 10, 14, 16384, 10, 14, 16384, 10, 14, 16384, // 10,14 - 10, 15, 16384, 10, 15, 16384, 10, 15, 16384, 10, 15, 16384, // 10,15 - 11, 0, 16384, 11, 0, 16384, 11, 0, 16384, 11, 0, 16384, // 11, 0 - 11, 1, 16384, 11, 1, 16384, 11, 1, 16384, 11, 1, 16384, // 11, 1 - 11, 2, 16384, 11, 2, 16384, 11, 2, 16384, 11, 2, 16384, // 11, 2 - 11, 3, 16384, 11, 3, 16384, 11, 3, 16384, 11, 3, 16384, // 11, 3 - 11, 4, 16384, 11, 4, 16384, 11, 4, 16384, 11, 4, 16384, // 11, 4 - 11, 5, 16384, 11, 5, 16384, 11, 5, 16384, 11, 5, 16384, // 11, 5 - 11, 6, 16384, 11, 6, 16384, 11, 6, 16384, 11, 6, 16384, // 11, 6 - 11, 7, 16384, 11, 7, 16384, 11, 7, 16384, 11, 7, 16384, // 11, 7 - 11, 8, 16384, 11, 8, 16384, 11, 8, 16384, 11, 8, 16384, // 11, 8 - 11, 9, 16384, 11, 9, 16384, 11, 9, 16384, 11, 9, 16384, // 11, 9 - 11, 10, 16384, 11, 10, 16384, 11, 10, 16384, 11, 10, 16384, // 11,10 - 11, 11, 16384, 11, 11, 16384, 11, 11, 16384, 11, 11, 16384, // 11,11 - 11, 12, 16384, 11, 12, 16384, 11, 12, 16384, 11, 12, 16384, // 11,12 - 11, 13, 16384, 11, 13, 16384, 11, 13, 16384, 11, 13, 16384, // 11,13 - 11, 14, 16384, 11, 14, 16384, 11, 14, 16384, 11, 14, 16384, // 11,14 - 11, 15, 16384, 11, 15, 16384, 11, 15, 16384, 11, 15, 16384, // 11,15 - 12, 0, 16384, 12, 0, 16384, 12, 0, 16384, 12, 0, 16384, // 12, 0 - 12, 1, 16384, 12, 1, 16384, 12, 1, 16384, 12, 1, 16384, // 12, 1 - 12, 2, 16384, 12, 2, 16384, 12, 2, 16384, 12, 2, 16384, // 12, 2 - 12, 3, 16384, 12, 3, 16384, 12, 3, 16384, 12, 3, 16384, // 12, 3 - 12, 4, 16384, 12, 4, 16384, 12, 4, 16384, 12, 4, 16384, // 12, 4 - 12, 5, 16384, 12, 5, 16384, 12, 5, 16384, 12, 5, 16384, // 12, 5 - 12, 6, 16384, 12, 6, 16384, 12, 6, 16384, 12, 6, 16384, // 12, 6 - 12, 7, 16384, 12, 7, 16384, 12, 7, 16384, 12, 7, 16384, // 12, 7 - 12, 8, 16384, 12, 8, 16384, 12, 8, 16384, 12, 8, 16384, // 12, 8 - 12, 9, 16384, 12, 9, 16384, 12, 9, 16384, 12, 9, 16384, // 12, 9 - 12, 10, 16384, 12, 10, 16384, 12, 10, 16384, 12, 10, 16384, // 12,10 - 12, 11, 16384, 12, 11, 16384, 12, 11, 16384, 12, 11, 16384, // 12,11 - 12, 12, 16384, 12, 12, 16384, 12, 12, 16384, 12, 12, 16384, // 12,12 - 12, 13, 16384, 12, 13, 16384, 12, 13, 16384, 12, 13, 16384, // 12,13 - 12, 14, 16384, 12, 14, 16384, 12, 14, 16384, 12, 14, 16384, // 12,14 - 12, 15, 16384, 12, 15, 16384, 12, 15, 16384, 12, 15, 16384, // 12,15 - 13, 0, 16384, 13, 0, 16384, 13, 0, 16384, 13, 0, 16384, // 13, 0 - 13, 1, 16384, 13, 1, 16384, 13, 1, 16384, 13, 1, 16384, // 13, 1 - 13, 2, 16384, 13, 2, 16384, 13, 2, 16384, 13, 2, 16384, // 13, 2 - 13, 3, 16384, 13, 3, 16384, 13, 3, 16384, 13, 3, 16384, // 13, 3 - 13, 4, 16384, 13, 4, 16384, 13, 4, 16384, 13, 4, 16384, // 13, 4 - 13, 5, 16384, 13, 5, 16384, 13, 5, 16384, 13, 5, 16384, // 13, 5 - 13, 6, 16384, 13, 6, 16384, 13, 6, 16384, 13, 6, 16384, // 13, 6 - 13, 7, 16384, 13, 7, 16384, 13, 7, 16384, 13, 7, 16384, // 13, 7 - 13, 8, 16384, 13, 8, 16384, 13, 8, 16384, 13, 8, 16384, // 13, 8 - 13, 9, 16384, 13, 9, 16384, 13, 9, 16384, 13, 9, 16384, // 13, 9 - 13, 10, 16384, 13, 10, 16384, 13, 10, 16384, 13, 10, 16384, // 13,10 - 13, 11, 16384, 13, 11, 16384, 13, 11, 16384, 13, 11, 16384, // 13,11 - 13, 12, 16384, 13, 12, 16384, 13, 12, 16384, 13, 12, 16384, // 13,12 - 13, 13, 16384, 13, 13, 16384, 13, 13, 16384, 13, 13, 16384, // 13,13 - 13, 14, 16384, 13, 14, 16384, 13, 14, 16384, 13, 14, 16384, // 13,14 - 13, 15, 16384, 13, 15, 16384, 13, 15, 16384, 13, 15, 16384, // 13,15 - 14, 0, 16384, 14, 0, 16384, 14, 0, 16384, 14, 0, 16384, // 14, 0 - 14, 1, 16384, 14, 1, 16384, 14, 1, 16384, 14, 1, 16384, // 14, 1 - 14, 2, 16384, 14, 2, 16384, 14, 2, 16384, 14, 2, 16384, // 14, 2 - 14, 3, 16384, 14, 3, 16384, 14, 3, 16384, 14, 3, 16384, // 14, 3 - 14, 4, 16384, 14, 4, 16384, 14, 4, 16384, 14, 4, 16384, // 14, 4 - 14, 5, 16384, 14, 5, 16384, 14, 5, 16384, 14, 5, 16384, // 14, 5 - 14, 6, 16384, 14, 6, 16384, 14, 6, 16384, 14, 6, 16384, // 14, 6 - 14, 7, 16384, 14, 7, 16384, 14, 7, 16384, 14, 7, 16384, // 14, 7 - 14, 8, 16384, 14, 8, 16384, 14, 8, 16384, 14, 8, 16384, // 14, 8 - 14, 9, 16384, 14, 9, 16384, 14, 9, 16384, 14, 9, 16384, // 14, 9 - 14, 10, 16384, 14, 10, 16384, 14, 10, 16384, 14, 10, 16384, // 14,10 - 14, 11, 16384, 14, 11, 16384, 14, 11, 16384, 14, 11, 16384, // 14,11 - 14, 12, 16384, 14, 12, 16384, 14, 12, 16384, 14, 12, 16384, // 14,12 - 14, 13, 16384, 14, 13, 16384, 14, 13, 16384, 14, 13, 16384, // 14,13 - 14, 14, 16384, 14, 14, 16384, 14, 14, 16384, 14, 14, 16384, // 14,14 - 14, 15, 16384, 14, 15, 16384, 14, 15, 16384, 14, 15, 16384, // 14,15 - 15, 0, 16384, 15, 0, 16384, 15, 0, 16384, 15, 0, 16384, // 15, 0 - 15, 1, 16384, 15, 1, 16384, 15, 1, 16384, 15, 1, 16384, // 15, 1 - 15, 2, 16384, 15, 2, 16384, 15, 2, 16384, 15, 2, 16384, // 15, 2 - 15, 3, 16384, 15, 3, 16384, 15, 3, 16384, 15, 3, 16384, // 15, 3 - 15, 4, 16384, 15, 4, 16384, 15, 4, 16384, 15, 4, 16384, // 15, 4 - 15, 5, 16384, 15, 5, 16384, 15, 5, 16384, 15, 5, 16384, // 15, 5 - 15, 6, 16384, 15, 6, 16384, 15, 6, 16384, 15, 6, 16384, // 15, 6 - 15, 7, 16384, 15, 7, 16384, 15, 7, 16384, 15, 7, 16384, // 15, 7 - 15, 8, 16384, 15, 8, 16384, 15, 8, 16384, 15, 8, 16384, // 15, 8 - 15, 9, 16384, 15, 9, 16384, 15, 9, 16384, 15, 9, 16384, // 15, 9 - 15, 10, 16384, 15, 10, 16384, 15, 10, 16384, 15, 10, 16384, // 15,10 - 15, 11, 16384, 15, 11, 16384, 15, 11, 16384, 15, 11, 16384, // 15,11 - 15, 12, 16384, 15, 12, 16384, 15, 12, 16384, 15, 12, 16384, // 15,12 - 15, 13, 16384, 15, 13, 16384, 15, 13, 16384, 15, 13, 16384, // 15,13 - 15, 14, 16384, 15, 14, 16384, 15, 14, 16384, 15, 14, 16384, // 15,14 - 15, 15, 16384, 15, 15, 16384, 15, 15, 16384, 15, 15, 16384, // 15,15 - // angle of 0.5 degrees - 0, -1, 5106, 0, 0, 51699, 1, -1, 3621, 1, 0, 5110, // 0, 0 - 0, 0, 4851, 0, 1, 52457, 1, 0, 3422, 1, 1, 4806, // 0, 1 - 0, 1, 4610, 0, 2, 53168, 1, 1, 3235, 1, 2, 4523, // 0, 2 - 0, 2, 4390, 0, 3, 53814, 1, 2, 3065, 1, 3, 4267, // 0, 3 - 0, 3, 4200, 0, 4, 54376, 1, 3, 2917, 1, 4, 4043, // 0, 4 - 0, 4, 4046, 0, 5, 54833, 1, 4, 2797, 1, 5, 3860, // 0, 5 - 0, 5, 3939, 0, 6, 55164, 1, 5, 2709, 1, 6, 3724, // 0, 6 - 0, 6, 3885, 0, 7, 55352, 1, 6, 2659, 1, 7, 3640, // 0, 7 - -1, 7, 2659, -1, 8, 3638, 0, 7, 3885, 0, 8, 55354, // 0, 8 - -1, 8, 2709, -1, 9, 3722, 0, 8, 3940, 0, 9, 55165, // 0, 9 - -1, 9, 2796, -1, 10, 3858, 0, 9, 4047, 0, 10, 54835, // 0,10 - -1, 10, 2916, -1, 11, 4041, 0, 10, 4201, 0, 11, 54378, // 0,11 - -1, 11, 3064, -1, 12, 4264, 0, 11, 4392, 0, 12, 53816, // 0,12 - -1, 12, 3235, -1, 13, 4521, 0, 12, 4612, 0, 13, 53168, // 0,13 - -1, 13, 3421, -1, 14, 4803, 0, 13, 4854, 0, 14, 52458, // 0,14 - -1, 14, 3621, -1, 15, 5106, 0, 14, 5110, 0, 15, 51699, // 0,15 - 1, -1, 4803, 1, 0, 52457, 2, -1, 3421, 2, 0, 4855, // 1, 0 - 1, 0, 4522, 1, 1, 53285, 2, 0, 3204, 2, 1, 4525, // 1, 1 - 1, 1, 4253, 1, 2, 54071, 2, 1, 2998, 2, 2, 4214, // 1, 2 - 1, 2, 4003, 1, 3, 54796, 2, 2, 2808, 2, 3, 3929, // 1, 3 - 1, 3, 3783, 1, 4, 55434, 2, 3, 2640, 2, 4, 3679, // 1, 4 - 1, 4, 3604, 1, 5, 55958, 2, 4, 2503, 2, 5, 3471, // 1, 5 - 1, 5, 3476, 1, 6, 56339, 2, 5, 2403, 2, 6, 3318, // 1, 6 - 1, 6, 3411, 1, 7, 56552, 2, 6, 2346, 2, 7, 3227, // 1, 7 - 0, 7, 2346, 0, 8, 3225, 1, 7, 3411, 1, 8, 56554, // 1, 8 - 0, 8, 2402, 0, 9, 3317, 1, 8, 3477, 1, 9, 56340, // 1, 9 - 0, 9, 2502, 0, 10, 3470, 1, 9, 3605, 1, 10, 55959, // 1,10 - 0, 10, 2640, 0, 11, 3677, 1, 10, 3785, 1, 11, 55434, // 1,11 - 0, 11, 2808, 0, 12, 3927, 1, 11, 4005, 1, 12, 54796, // 1,12 - 0, 12, 2998, 0, 13, 4212, 1, 12, 4255, 1, 13, 54071, // 1,13 - 0, 13, 3204, 0, 14, 4522, 1, 13, 4525, 1, 14, 53285, // 1,14 - 0, 14, 3422, 0, 15, 4851, 1, 14, 4806, 1, 15, 52457, // 1,15 - 2, -1, 4521, 2, 0, 53168, 3, -1, 3235, 3, 0, 4612, // 2, 0 - 2, 0, 4212, 2, 1, 54072, 3, 0, 2998, 3, 1, 4254, // 2, 1 - 2, 1, 3911, 2, 2, 54941, 3, 1, 2770, 3, 2, 3914, // 2, 2 - 2, 2, 3628, 2, 3, 55756, 3, 2, 2557, 3, 3, 3595, // 2, 3 - 2, 3, 3373, 2, 4, 56486, 3, 3, 2365, 3, 4, 3312, // 2, 4 - 2, 4, 3161, 2, 5, 57095, 3, 4, 2205, 3, 5, 3075, // 2, 5 - 2, 5, 3007, 2, 6, 57544, 3, 5, 2088, 3, 6, 2897, // 2, 6 - 2, 6, 2926, 2, 7, 57793, 3, 6, 2022, 3, 7, 2795, // 2, 7 - 1, 7, 2022, 1, 8, 2794, 2, 7, 2926, 2, 8, 57794, // 2, 8 - 1, 8, 2088, 1, 9, 2897, 2, 8, 3007, 2, 9, 57544, // 2, 9 - 1, 9, 2205, 1, 10, 3073, 2, 9, 3161, 2, 10, 57097, // 2,10 - 1, 10, 2365, 1, 11, 3310, 2, 10, 3374, 2, 11, 56487, // 2,11 - 1, 11, 2556, 1, 12, 3594, 2, 11, 3630, 2, 12, 55756, // 2,12 - 1, 12, 2770, 1, 13, 3911, 2, 12, 3913, 2, 13, 54942, // 2,13 - 1, 13, 2998, 1, 14, 4253, 2, 13, 4214, 2, 14, 54071, // 2,14 - 1, 14, 3235, 1, 15, 4610, 2, 14, 4523, 2, 15, 53168, // 2,15 - 3, -1, 4264, 3, 0, 53815, 4, -1, 3064, 4, 0, 4393, // 3, 0 - 3, 0, 3927, 3, 1, 54796, 4, 0, 2808, 4, 1, 4005, // 3, 1 - 3, 1, 3594, 3, 2, 55756, 4, 1, 2556, 4, 2, 3630, // 3, 2 - 3, 2, 3273, 3, 3, 56673, 4, 2, 2317, 4, 3, 3273, // 3, 3 - 3, 3, 2976, 3, 4, 57514, 4, 3, 2096, 4, 4, 2950, // 3, 4 - 3, 4, 2722, 3, 5, 58233, 4, 4, 1908, 4, 5, 2673, // 3, 5 - 3, 5, 2532, 3, 6, 58774, 4, 5, 1767, 4, 6, 2463, // 3, 6 - 3, 6, 2430, 3, 7, 59076, 4, 6, 1687, 4, 7, 2343, // 3, 7 - 2, 7, 1687, 2, 8, 2342, 3, 7, 2430, 3, 8, 59077, // 3, 8 - 2, 8, 1766, 2, 9, 2463, 3, 8, 2532, 3, 9, 58775, // 3, 9 - 2, 9, 1908, 2, 10, 2672, 3, 9, 2723, 3, 10, 58233, // 3,10 - 2, 10, 2096, 2, 11, 2948, 3, 10, 2977, 3, 11, 57515, // 3,11 - 2, 11, 2317, 2, 12, 3273, 3, 11, 3274, 3, 12, 56672, // 3,12 - 2, 12, 2557, 2, 13, 3628, 3, 12, 3595, 3, 13, 55756, // 3,13 - 2, 13, 2808, 2, 14, 4003, 3, 13, 3929, 3, 14, 54796, // 3,14 - 2, 14, 3065, 2, 15, 4390, 3, 14, 4267, 3, 15, 53814, // 3,15 - 4, -1, 4041, 4, 0, 54378, 5, -1, 2916, 5, 0, 4201, // 4, 0 - 4, 0, 3677, 4, 1, 55435, 5, 0, 2640, 5, 1, 3784, // 4, 1 - 4, 1, 3310, 4, 2, 56487, 5, 1, 2365, 5, 2, 3374, // 4, 2 - 4, 2, 2948, 4, 3, 57514, 5, 2, 2096, 5, 3, 2978, // 4, 3 - 4, 3, 2604, 4, 4, 58484, 5, 3, 1843, 5, 4, 2605, // 4, 4 - 4, 4, 2297, 4, 5, 59345, 5, 4, 1617, 5, 5, 2277, // 4, 5 - 4, 5, 2057, 4, 6, 60017, 5, 5, 1442, 5, 6, 2020, // 4, 6 - 4, 6, 1922, 4, 7, 60402, 5, 6, 1341, 5, 7, 1871, // 4, 7 - 3, 7, 1341, 3, 8, 1871, 4, 7, 1922, 4, 8, 60402, // 4, 8 - 3, 8, 1442, 3, 9, 2020, 4, 8, 2057, 4, 9, 60017, // 4, 9 - 3, 9, 1617, 3, 10, 2276, 4, 9, 2297, 4, 10, 59346, // 4,10 - 3, 10, 1843, 3, 11, 2604, 4, 10, 2605, 4, 11, 58484, // 4,11 - 3, 11, 2096, 3, 12, 2976, 4, 11, 2950, 4, 12, 57514, // 4,12 - 3, 12, 2365, 3, 13, 3373, 4, 12, 3311, 4, 13, 56487, // 4,13 - 3, 13, 2640, 3, 14, 3783, 4, 13, 3678, 4, 14, 55435, // 4,14 - 3, 14, 2917, 3, 15, 4200, 4, 14, 4043, 4, 15, 54376, // 4,15 - 5, -1, 3858, 5, 0, 54835, 6, -1, 2796, 6, 0, 4047, // 5, 0 - 5, 0, 3470, 5, 1, 55959, 6, 0, 2502, 6, 1, 3605, // 5, 1 - 5, 1, 3073, 5, 2, 57096, 6, 1, 2205, 6, 2, 3162, // 5, 2 - 5, 2, 2672, 5, 3, 58234, 6, 2, 1908, 6, 3, 2722, // 5, 3 - 5, 3, 2276, 5, 4, 59346, 6, 3, 1617, 6, 4, 2297, // 5, 4 - 5, 4, 1904, 5, 5, 60381, 6, 4, 1347, 6, 5, 1904, // 5, 5 - 5, 5, 1593, 5, 6, 61243, 6, 5, 1121, 6, 6, 1579, // 5, 6 - 5, 6, 1405, 5, 7, 61767, 6, 6, 985, 6, 7, 1379, // 5, 7 - 4, 7, 985, 4, 8, 1380, 5, 7, 1405, 5, 8, 61766, // 5, 8 - 4, 8, 1121, 4, 9, 1578, 5, 8, 1593, 5, 9, 61244, // 5, 9 - 4, 9, 1347, 4, 10, 1904, 5, 9, 1904, 5, 10, 60381, // 5,10 - 4, 10, 1617, 4, 11, 2297, 5, 10, 2276, 5, 11, 59346, // 5,11 - 4, 11, 1908, 4, 12, 2722, 5, 11, 2673, 5, 12, 58233, // 5,12 - 4, 12, 2205, 4, 13, 3161, 5, 12, 3074, 5, 13, 57096, // 5,13 - 4, 13, 2503, 4, 14, 3604, 5, 13, 3472, 5, 14, 55957, // 5,14 - 4, 14, 2797, 4, 15, 4046, 5, 14, 3860, 5, 15, 54833, // 5,15 - 6, -1, 3722, 6, 0, 55166, 7, -1, 2709, 7, 0, 3939, // 6, 0 - 6, 0, 3317, 6, 1, 56340, 7, 0, 2402, 7, 1, 3477, // 6, 1 - 6, 1, 2897, 6, 2, 57545, 7, 1, 2088, 7, 2, 3006, // 6, 2 - 6, 2, 2463, 6, 3, 58775, 7, 2, 1766, 7, 3, 2532, // 6, 3 - 6, 3, 2020, 6, 4, 60018, 7, 3, 1442, 7, 4, 2056, // 6, 4 - 6, 4, 1578, 6, 5, 61243, 7, 4, 1121, 7, 5, 1594, // 6, 5 - 6, 5, 1170, 6, 6, 62369, 7, 5, 827, 7, 6, 1170, // 6, 6 - 6, 6, 883, 6, 7, 63156, 7, 6, 622, 7, 7, 875, // 6, 7 - 5, 7, 622, 5, 8, 875, 6, 7, 883, 6, 8, 63156, // 6, 8 - 5, 8, 827, 5, 9, 1170, 6, 8, 1170, 6, 9, 62369, // 6, 9 - 5, 9, 1121, 5, 10, 1593, 6, 9, 1579, 6, 10, 61243, // 6,10 - 5, 10, 1442, 5, 11, 2057, 6, 10, 2020, 6, 11, 60017, // 6,11 - 5, 11, 1767, 5, 12, 2532, 6, 11, 2464, 6, 12, 58773, // 6,12 - 5, 12, 2088, 5, 13, 3007, 6, 12, 2898, 6, 13, 57543, // 6,13 - 5, 13, 2403, 5, 14, 3476, 6, 13, 3319, 6, 14, 56338, // 6,14 - 5, 14, 2709, 5, 15, 3939, 6, 14, 3724, 6, 15, 55164, // 6,15 - 7, -1, 3638, 7, 0, 55354, 8, -1, 2659, 8, 0, 3885, // 7, 0 - 7, 0, 3225, 7, 1, 56554, 8, 0, 2346, 8, 1, 3411, // 7, 1 - 7, 1, 2794, 7, 2, 57795, 8, 1, 2022, 8, 2, 2925, // 7, 2 - 7, 2, 2342, 7, 3, 59077, 8, 2, 1687, 8, 3, 2430, // 7, 3 - 7, 3, 1871, 7, 4, 60402, 8, 3, 1341, 8, 4, 1922, // 7, 4 - 7, 4, 1380, 7, 5, 61767, 8, 4, 985, 8, 5, 1404, // 7, 5 - 7, 5, 875, 7, 6, 63156, 8, 5, 622, 8, 6, 883, // 7, 6 - 7, 6, 399, 7, 7, 64455, 8, 6, 282, 8, 7, 400, // 7, 7 - 6, 7, 282, 6, 8, 399, 7, 7, 399, 7, 8, 64456, // 7, 8 - 6, 8, 622, 6, 9, 883, 7, 8, 875, 7, 9, 63156, // 7, 9 - 6, 9, 985, 6, 10, 1405, 7, 9, 1380, 7, 10, 61766, // 7,10 - 6, 10, 1341, 6, 11, 1922, 7, 10, 1871, 7, 11, 60402, // 7,11 - 6, 11, 1687, 6, 12, 2430, 7, 11, 2343, 7, 12, 59076, // 7,12 - 6, 12, 2022, 6, 13, 2926, 7, 12, 2795, 7, 13, 57793, // 7,13 - 6, 13, 2346, 6, 14, 3411, 7, 13, 3227, 7, 14, 56552, // 7,14 - 6, 14, 2659, 6, 15, 3885, 7, 14, 3640, 7, 15, 55352, // 7,15 - 8, 0, 55352, 8, 1, 3640, 9, 0, 3885, 9, 1, 2659, // 8, 0 - 8, 1, 56552, 8, 2, 3227, 9, 1, 3411, 9, 2, 2346, // 8, 1 - 8, 2, 57793, 8, 3, 2795, 9, 2, 2926, 9, 3, 2022, // 8, 2 - 8, 3, 59076, 8, 4, 2343, 9, 3, 2430, 9, 4, 1687, // 8, 3 - 8, 4, 60402, 8, 5, 1871, 9, 4, 1922, 9, 5, 1341, // 8, 4 - 8, 5, 61767, 8, 6, 1380, 9, 5, 1405, 9, 6, 984, // 8, 5 - 8, 6, 63156, 8, 7, 875, 9, 6, 883, 9, 7, 622, // 8, 6 - 8, 7, 64455, 8, 8, 399, 9, 7, 399, 9, 8, 283, // 8, 7 - 7, 8, 399, 7, 9, 282, 8, 8, 64455, 8, 9, 400, // 8, 8 - 7, 9, 883, 7, 10, 622, 8, 9, 63156, 8, 10, 875, // 8, 9 - 7, 10, 1405, 7, 11, 985, 8, 10, 61767, 8, 11, 1379, // 8,10 - 7, 11, 1922, 7, 12, 1341, 8, 11, 60402, 8, 12, 1871, // 8,11 - 7, 12, 2430, 7, 13, 1687, 8, 12, 59077, 8, 13, 2342, // 8,12 - 7, 13, 2926, 7, 14, 2022, 8, 13, 57795, 8, 14, 2793, // 8,13 - 7, 14, 3411, 7, 15, 2346, 8, 14, 56554, 8, 15, 3225, // 8,14 - 7, 15, 3885, 7, 16, 2659, 8, 15, 55354, 8, 16, 3638, // 8,15 - 9, 0, 55164, 9, 1, 3724, 10, 0, 3939, 10, 1, 2709, // 9, 0 - 9, 1, 56339, 9, 2, 3319, 10, 1, 3476, 10, 2, 2402, // 9, 1 - 9, 2, 57544, 9, 3, 2898, 10, 2, 3007, 10, 3, 2087, // 9, 2 - 9, 3, 58774, 9, 4, 2464, 10, 3, 2532, 10, 4, 1766, // 9, 3 - 9, 4, 60017, 9, 5, 2020, 10, 4, 2057, 10, 5, 1442, // 9, 4 - 9, 5, 61243, 9, 6, 1579, 10, 5, 1593, 10, 6, 1121, // 9, 5 - 9, 6, 62369, 9, 7, 1170, 10, 6, 1170, 10, 7, 827, // 9, 6 - 9, 7, 63156, 9, 8, 883, 10, 7, 875, 10, 8, 622, // 9, 7 - 8, 8, 875, 8, 9, 622, 9, 8, 63156, 9, 9, 883, // 9, 8 - 8, 9, 1170, 8, 10, 827, 9, 9, 62369, 9, 10, 1170, // 9, 9 - 8, 10, 1593, 8, 11, 1121, 9, 10, 61243, 9, 11, 1579, // 9,10 - 8, 11, 2057, 8, 12, 1442, 9, 11, 60018, 9, 12, 2019, // 9,11 - 8, 12, 2532, 8, 13, 1766, 9, 12, 58775, 9, 13, 2463, // 9,12 - 8, 13, 3007, 8, 14, 2088, 9, 13, 57545, 9, 14, 2896, // 9,13 - 8, 14, 3477, 8, 15, 2402, 9, 14, 56340, 9, 15, 3317, // 9,14 - 8, 15, 3940, 8, 16, 2709, 9, 15, 55166, 9, 16, 3721, // 9,15 - 10, 0, 54833, 10, 1, 3860, 11, 0, 4046, 11, 1, 2797, // 10, 0 - 10, 1, 55958, 10, 2, 3472, 11, 1, 3604, 11, 2, 2502, // 10, 1 - 10, 2, 57095, 10, 3, 3074, 11, 2, 3161, 11, 3, 2206, // 10, 2 - 10, 3, 58233, 10, 4, 2673, 11, 3, 2722, 11, 4, 1908, // 10, 3 - 10, 4, 59345, 10, 5, 2276, 11, 4, 2297, 11, 5, 1618, // 10, 4 - 10, 5, 60381, 10, 6, 1904, 11, 5, 1904, 11, 6, 1347, // 10, 5 - 10, 6, 61243, 10, 7, 1593, 11, 6, 1578, 11, 7, 1122, // 10, 6 - 10, 7, 61767, 10, 8, 1405, 11, 7, 1380, 11, 8, 984, // 10, 7 - 9, 8, 1380, 9, 9, 985, 10, 8, 61767, 10, 9, 1404, // 10, 8 - 9, 9, 1579, 9, 10, 1121, 10, 9, 61243, 10, 10, 1593, // 10, 9 - 9, 10, 1904, 9, 11, 1347, 10, 10, 60381, 10, 11, 1904, // 10,10 - 9, 11, 2297, 9, 12, 1617, 10, 11, 59346, 10, 12, 2276, // 10,11 - 9, 12, 2723, 9, 13, 1908, 10, 12, 58234, 10, 13, 2671, // 10,12 - 9, 13, 3161, 9, 14, 2205, 10, 13, 57096, 10, 14, 3074, // 10,13 - 9, 14, 3605, 9, 15, 2502, 10, 14, 55959, 10, 15, 3470, // 10,14 - 9, 15, 4047, 9, 16, 2796, 10, 15, 54835, 10, 16, 3858, // 10,15 - 11, 0, 54376, 11, 1, 4043, 12, 0, 4200, 12, 1, 2917, // 11, 0 - 11, 1, 55434, 11, 2, 3678, 12, 1, 3783, 12, 2, 2641, // 11, 1 - 11, 2, 56486, 11, 3, 3311, 12, 2, 3373, 12, 3, 2366, // 11, 2 - 11, 3, 57514, 11, 4, 2950, 12, 3, 2976, 12, 4, 2096, // 11, 3 - 11, 4, 58484, 11, 5, 2605, 12, 4, 2604, 12, 5, 1843, // 11, 4 - 11, 5, 59346, 11, 6, 2297, 12, 5, 2276, 12, 6, 1617, // 11, 5 - 11, 6, 60018, 11, 7, 2057, 12, 6, 2020, 12, 7, 1441, // 11, 6 - 11, 7, 60402, 11, 8, 1922, 12, 7, 1871, 12, 8, 1341, // 11, 7 - 10, 8, 1871, 10, 9, 1341, 11, 8, 60402, 11, 9, 1922, // 11, 8 - 10, 9, 2020, 10, 10, 1442, 11, 9, 60017, 11, 10, 2057, // 11, 9 - 10, 10, 2276, 10, 11, 1617, 11, 10, 59345, 11, 11, 2298, // 11,10 - 10, 11, 2605, 10, 12, 1843, 11, 11, 58484, 11, 12, 2604, // 11,11 - 10, 12, 2977, 10, 13, 2096, 11, 12, 57514, 11, 13, 2949, // 11,12 - 10, 13, 3374, 10, 14, 2365, 11, 13, 56487, 11, 14, 3310, // 11,13 - 10, 14, 3785, 10, 15, 2640, 11, 14, 55435, 11, 15, 3676, // 11,14 - 10, 15, 4201, 10, 16, 2916, 11, 15, 54378, 11, 16, 4041, // 11,15 - 12, 0, 53814, 12, 1, 4267, 13, 0, 4390, 13, 1, 3065, // 12, 0 - 12, 1, 54796, 12, 2, 3929, 13, 1, 4003, 13, 2, 2808, // 12, 1 - 12, 2, 55756, 12, 3, 3595, 13, 2, 3628, 13, 3, 2557, // 12, 2 - 12, 3, 56673, 12, 4, 3274, 13, 3, 3273, 13, 4, 2316, // 12, 3 - 12, 4, 57514, 12, 5, 2977, 13, 4, 2948, 13, 5, 2097, // 12, 4 - 12, 5, 58234, 12, 6, 2723, 13, 5, 2672, 13, 6, 1907, // 12, 5 - 12, 6, 58775, 12, 7, 2532, 13, 6, 2463, 13, 7, 1766, // 12, 6 - 12, 7, 59077, 12, 8, 2430, 13, 7, 2342, 13, 8, 1687, // 12, 7 - 11, 8, 2343, 11, 9, 1687, 12, 8, 59076, 12, 9, 2430, // 12, 8 - 11, 9, 2464, 11, 10, 1767, 12, 9, 58774, 12, 10, 2531, // 12, 9 - 11, 10, 2673, 11, 11, 1908, 12, 10, 58233, 12, 11, 2722, // 12,10 - 11, 11, 2950, 11, 12, 2096, 12, 11, 57514, 12, 12, 2976, // 12,11 - 11, 12, 3274, 11, 13, 2317, 12, 12, 56673, 12, 13, 3272, // 12,12 - 11, 13, 3630, 11, 14, 2556, 12, 13, 55756, 12, 14, 3594, // 12,13 - 11, 14, 4005, 11, 15, 2808, 12, 14, 54796, 12, 15, 3927, // 12,14 - 11, 15, 4392, 11, 16, 3064, 12, 15, 53815, 12, 16, 4265, // 12,15 - 13, 0, 53168, 13, 1, 4523, 14, 0, 4610, 14, 1, 3235, // 13, 0 - 13, 1, 54071, 13, 2, 4214, 14, 1, 4253, 14, 2, 2998, // 13, 1 - 13, 2, 54941, 13, 3, 3913, 14, 2, 3911, 14, 3, 2771, // 13, 2 - 13, 3, 55756, 13, 4, 3630, 14, 3, 3594, 14, 4, 2556, // 13, 3 - 13, 4, 56487, 13, 5, 3374, 14, 4, 3310, 14, 5, 2365, // 13, 4 - 13, 5, 57096, 13, 6, 3161, 14, 5, 3073, 14, 6, 2206, // 13, 5 - 13, 6, 57545, 13, 7, 3007, 14, 6, 2897, 14, 7, 2087, // 13, 6 - 13, 7, 57795, 13, 8, 2926, 14, 7, 2794, 14, 8, 2021, // 13, 7 - 12, 8, 2795, 12, 9, 2022, 13, 8, 57793, 13, 9, 2926, // 13, 8 - 12, 9, 2898, 12, 10, 2088, 13, 9, 57544, 13, 10, 3006, // 13, 9 - 12, 10, 3074, 12, 11, 2205, 13, 10, 57095, 13, 11, 3162, // 13,10 - 12, 11, 3311, 12, 12, 2365, 13, 11, 56486, 13, 12, 3374, // 13,11 - 12, 12, 3595, 12, 13, 2557, 13, 12, 55756, 13, 13, 3628, // 13,12 - 12, 13, 3913, 12, 14, 2770, 13, 13, 54941, 13, 14, 3912, // 13,13 - 12, 14, 4255, 12, 15, 2998, 13, 14, 54072, 13, 15, 4211, // 13,14 - 12, 15, 4612, 12, 16, 3235, 13, 15, 53168, 13, 16, 4521, // 13,15 - 14, 0, 52457, 14, 1, 4806, 15, 0, 4851, 15, 1, 3422, // 14, 0 - 14, 1, 53285, 14, 2, 4525, 15, 1, 4522, 15, 2, 3204, // 14, 1 - 14, 2, 54072, 14, 3, 4255, 15, 2, 4212, 15, 3, 2997, // 14, 2 - 14, 3, 54796, 14, 4, 4005, 15, 3, 3927, 15, 4, 2808, // 14, 3 - 14, 4, 55435, 14, 5, 3785, 15, 4, 3677, 15, 5, 2639, // 14, 4 - 14, 5, 55959, 14, 6, 3605, 15, 5, 3470, 15, 6, 2502, // 14, 5 - 14, 6, 56340, 14, 7, 3477, 15, 6, 3317, 15, 7, 2402, // 14, 6 - 14, 7, 56554, 14, 8, 3411, 15, 7, 3225, 15, 8, 2346, // 14, 7 - 13, 8, 3227, 13, 9, 2346, 14, 8, 56552, 14, 9, 3411, // 14, 8 - 13, 9, 3319, 13, 10, 2403, 14, 9, 56339, 14, 10, 3475, // 14, 9 - 13, 10, 3472, 13, 11, 2503, 14, 10, 55958, 14, 11, 3603, // 14,10 - 13, 11, 3678, 13, 12, 2640, 14, 11, 55434, 14, 12, 3784, // 14,11 - 13, 12, 3929, 13, 13, 2808, 14, 12, 54796, 14, 13, 4003, // 14,12 - 13, 13, 4214, 13, 14, 2998, 14, 13, 54071, 14, 14, 4253, // 14,13 - 13, 14, 4525, 13, 15, 3204, 14, 14, 53285, 14, 15, 4522, // 14,14 - 13, 15, 4854, 13, 16, 3421, 14, 15, 52457, 14, 16, 4804, // 14,15 - 15, 0, 51699, 15, 1, 5110, 16, 0, 5106, 16, 1, 3621, // 15, 0 - 15, 1, 52457, 15, 2, 4854, 16, 1, 4803, 16, 2, 3422, // 15, 1 - 15, 2, 53168, 15, 3, 4612, 16, 2, 4521, 16, 3, 3235, // 15, 2 - 15, 3, 53815, 15, 4, 4392, 16, 3, 4264, 16, 4, 3065, // 15, 3 - 15, 4, 54378, 15, 5, 4201, 16, 4, 4041, 16, 5, 2916, // 15, 4 - 15, 5, 54835, 15, 6, 4047, 16, 5, 3858, 16, 6, 2796, // 15, 5 - 15, 6, 55166, 15, 7, 3940, 16, 6, 3722, 16, 7, 2708, // 15, 6 - 15, 7, 55354, 15, 8, 3885, 16, 7, 3638, 16, 8, 2659, // 15, 7 - 14, 8, 3640, 14, 9, 2659, 15, 8, 55352, 15, 9, 3885, // 15, 8 - 14, 9, 3724, 14, 10, 2709, 15, 9, 55164, 15, 10, 3939, // 15, 9 - 14, 10, 3860, 14, 11, 2797, 15, 10, 54833, 15, 11, 4046, // 15,10 - 14, 11, 4043, 14, 12, 2917, 15, 11, 54376, 15, 12, 4200, // 15,11 - 14, 12, 4267, 14, 13, 3065, 15, 12, 53814, 15, 13, 4390, // 15,12 - 14, 13, 4523, 14, 14, 3235, 15, 13, 53168, 15, 14, 4610, // 15,13 - 14, 14, 4806, 14, 15, 3422, 15, 14, 52457, 15, 15, 4851, // 15,14 - 14, 15, 5110, 14, 16, 3621, 15, 15, 51699, 15, 16, 5106, // 15,15 - // angle of 1.0 degrees - 0, -1, 8769, 0, 0, 41693, 1, -1, 6280, 1, 0, 8794, // 0, 0 - 0, 0, 8452, 0, 1, 42821, 1, 0, 5975, 1, 1, 8288, // 0, 1 - 0, 1, 8141, 0, 2, 43900, 1, 1, 5684, 1, 2, 7811, // 0, 2 - 0, 2, 7848, 0, 3, 44901, 1, 2, 5413, 1, 3, 7374, // 0, 3 - 0, 3, 7587, 0, 4, 45791, 1, 3, 5172, 1, 4, 6986, // 0, 4 - 0, 4, 7374, 0, 5, 46532, 1, 4, 4971, 1, 5, 6659, // 0, 5 - 0, 5, 7227, 0, 6, 47086, 1, 5, 4818, 1, 6, 6405, // 0, 6 - 0, 6, 7158, 0, 7, 47426, 1, 6, 4722, 1, 7, 6230, // 0, 7 - -1, 7, 4718, -1, 8, 6217, 0, 7, 7161, 0, 8, 47440, // 0, 8 - -1, 8, 4814, -1, 9, 6391, 0, 8, 7233, 0, 9, 47098, // 0, 9 - -1, 9, 4967, -1, 10, 6644, 0, 9, 7383, 0, 10, 46542, // 0,10 - -1, 10, 5169, -1, 11, 6970, 0, 10, 7599, 0, 11, 45798, // 0,11 - -1, 11, 5410, -1, 12, 7356, 0, 11, 7863, 0, 12, 44907, // 0,12 - -1, 12, 5682, -1, 13, 7791, 0, 12, 8159, 0, 13, 43904, // 0,13 - -1, 13, 5974, -1, 14, 8265, 0, 13, 8474, 0, 14, 42823, // 0,14 - -1, 14, 6280, -1, 15, 8769, 0, 14, 8795, 0, 15, 41692, // 0,15 - 1, -1, 8265, 1, 0, 42823, 2, -1, 5974, 2, 0, 8474, // 1, 0 - 1, 0, 7901, 1, 1, 44074, 2, 0, 5640, 2, 1, 7921, // 1, 1 - 1, 1, 7539, 1, 2, 45286, 2, 1, 5316, 2, 2, 7395, // 1, 2 - 1, 2, 7191, 1, 3, 46427, 2, 2, 5011, 2, 3, 6907, // 1, 3 - 1, 3, 6875, 1, 4, 47453, 2, 3, 4736, 2, 4, 6472, // 1, 4 - 1, 4, 6613, 1, 5, 48314, 2, 4, 4505, 2, 5, 6104, // 1, 5 - 1, 5, 6425, 1, 6, 48960, 2, 5, 4330, 2, 6, 5821, // 1, 6 - 1, 6, 6332, 1, 7, 49347, 2, 6, 4224, 2, 7, 5633, // 1, 7 - 0, 7, 4221, 0, 8, 5623, 1, 7, 6335, 1, 8, 49357, // 1, 8 - 0, 8, 4327, 0, 9, 5809, 1, 8, 6430, 1, 9, 48970, // 1, 9 - 0, 9, 4502, 0, 10, 6092, 1, 9, 6620, 1, 10, 48322, // 1,10 - 0, 10, 4734, 0, 11, 6458, 1, 10, 6886, 1, 11, 47458, // 1,11 - 0, 11, 5009, 0, 12, 6892, 1, 11, 7204, 1, 12, 46431, // 1,12 - 0, 12, 5315, 0, 13, 7378, 1, 12, 7555, 1, 13, 45288, // 1,13 - 0, 13, 5640, 0, 14, 7901, 1, 13, 7921, 1, 14, 44074, // 1,14 - 0, 14, 5975, 0, 15, 8452, 1, 14, 8288, 1, 15, 42821, // 1,15 - 2, -1, 7791, 2, 0, 43904, 3, -1, 5682, 3, 0, 8159, // 2, 0 - 2, 0, 7378, 2, 1, 45288, 3, 0, 5315, 3, 1, 7555, // 2, 1 - 2, 1, 6959, 2, 2, 46650, 3, 1, 4954, 3, 2, 6973, // 2, 2 - 2, 2, 6549, 2, 3, 47953, 3, 2, 4608, 3, 3, 6426, // 2, 3 - 2, 3, 6168, 2, 4, 49147, 3, 3, 4291, 3, 4, 5930, // 2, 4 - 2, 4, 5842, 2, 5, 50165, 3, 4, 4020, 3, 5, 5509, // 2, 5 - 2, 5, 5602, 2, 6, 50935, 3, 5, 3815, 3, 6, 5184, // 2, 6 - 2, 6, 5478, 2, 7, 51387, 3, 6, 3693, 3, 7, 4978, // 2, 7 - 1, 7, 3691, 1, 8, 4970, 2, 7, 5480, 2, 8, 51395, // 2, 8 - 1, 8, 3813, 1, 9, 5175, 2, 8, 5606, 2, 9, 50942, // 2, 9 - 1, 9, 4019, 1, 10, 5499, 2, 9, 5848, 2, 10, 50170, // 2,10 - 1, 10, 4290, 1, 11, 5920, 2, 10, 6176, 2, 11, 49150, // 2,11 - 1, 11, 4607, 1, 12, 6414, 2, 11, 6560, 2, 12, 47955, // 2,12 - 1, 12, 4954, 1, 13, 6959, 2, 12, 6973, 2, 13, 46650, // 2,13 - 1, 13, 5316, 1, 14, 7539, 2, 13, 7395, 2, 14, 45286, // 2,14 - 1, 14, 5684, 1, 15, 8141, 2, 14, 7812, 2, 15, 43899, // 2,15 - 3, -1, 7356, 3, 0, 44907, 4, -1, 5410, 4, 0, 7863, // 3, 0 - 3, 0, 6892, 3, 1, 46430, 4, 0, 5009, 4, 1, 7205, // 3, 1 - 3, 1, 6414, 3, 2, 47955, 4, 1, 4607, 4, 2, 6560, // 3, 2 - 3, 2, 5934, 3, 3, 49445, 4, 2, 4214, 4, 3, 5943, // 3, 3 - 3, 3, 5474, 3, 4, 50843, 4, 3, 3846, 4, 4, 5373, // 3, 4 - 3, 4, 5069, 3, 5, 52066, 4, 4, 3523, 4, 5, 4878, // 3, 5 - 3, 5, 4759, 3, 6, 53008, 4, 5, 3274, 4, 6, 4495, // 3, 6 - 3, 6, 4592, 3, 7, 53557, 4, 6, 3128, 4, 7, 4259, // 3, 7 - 2, 7, 3126, 2, 8, 4254, 3, 7, 4594, 3, 8, 53562, // 3, 8 - 2, 8, 3273, 2, 9, 4489, 3, 8, 4762, 3, 9, 53012, // 3, 9 - 2, 9, 3522, 2, 10, 4872, 3, 9, 5073, 3, 10, 52069, // 3,10 - 2, 10, 3845, 2, 11, 5365, 3, 10, 5481, 3, 11, 50845, // 3,11 - 2, 11, 4214, 2, 12, 5934, 3, 11, 5943, 3, 12, 49445, // 3,12 - 2, 12, 4608, 2, 13, 6549, 3, 12, 6426, 3, 13, 47953, // 3,13 - 2, 13, 5011, 2, 14, 7191, 3, 13, 6908, 3, 14, 46426, // 3,14 - 2, 14, 5413, 2, 15, 7848, 3, 14, 7374, 3, 15, 44901, // 3,15 - 4, -1, 6970, 4, 0, 45799, 5, -1, 5169, 5, 0, 7598, // 4, 0 - 4, 0, 6458, 4, 1, 47458, 5, 0, 4734, 5, 1, 6886, // 4, 1 - 4, 1, 5920, 4, 2, 49150, 5, 1, 4290, 5, 2, 6176, // 4, 2 - 4, 2, 5365, 4, 3, 50844, 5, 2, 3845, 5, 3, 5482, // 4, 3 - 4, 3, 4816, 4, 4, 52484, 5, 3, 3415, 5, 4, 4821, // 4, 4 - 4, 4, 4309, 4, 5, 53973, 5, 4, 3023, 5, 5, 4231, // 4, 5 - 4, 5, 3902, 4, 6, 55164, 5, 5, 2711, 5, 6, 3759, // 4, 6 - 4, 6, 3671, 4, 7, 55867, 5, 6, 2525, 5, 7, 3473, // 4, 7 - 3, 7, 2524, 3, 8, 3469, 4, 7, 3672, 4, 8, 55871, // 4, 8 - 3, 8, 2710, 3, 9, 3755, 4, 8, 3904, 4, 9, 55167, // 4, 9 - 3, 9, 3023, 3, 10, 4226, 4, 9, 4313, 4, 10, 53974, // 4,10 - 3, 10, 3415, 3, 11, 4816, 4, 10, 4822, 4, 11, 52483, // 4,11 - 3, 11, 3846, 3, 12, 5474, 4, 11, 5373, 4, 12, 50843, // 4,12 - 3, 12, 4291, 3, 13, 6168, 4, 12, 5930, 4, 13, 49147, // 4,13 - 3, 13, 4736, 3, 14, 6875, 4, 13, 6472, 4, 14, 47453, // 4,14 - 3, 14, 5172, 3, 15, 7587, 4, 14, 6986, 4, 15, 45791, // 4,15 - 5, -1, 6644, 5, 0, 46541, 6, -1, 4967, 6, 0, 7384, // 5, 0 - 5, 0, 6092, 5, 1, 48322, 6, 0, 4502, 6, 1, 6620, // 5, 1 - 5, 1, 5499, 5, 2, 50171, 6, 1, 4019, 6, 2, 5847, // 5, 2 - 5, 2, 4872, 5, 3, 52069, 6, 2, 3522, 6, 3, 5073, // 5, 3 - 5, 3, 4226, 5, 4, 53975, 6, 3, 3023, 6, 4, 4312, // 5, 4 - 5, 4, 3595, 5, 5, 55798, 6, 4, 2546, 6, 5, 3597, // 5, 5 - 5, 5, 3050, 5, 6, 57353, 6, 5, 2138, 6, 6, 2995, // 5, 6 - 5, 6, 2713, 5, 7, 58322, 6, 6, 1884, 6, 7, 2617, // 5, 7 - 4, 7, 1884, 4, 8, 2615, 5, 7, 2714, 5, 8, 58323, // 5, 8 - 4, 8, 2138, 4, 9, 2993, 5, 8, 3051, 5, 9, 57354, // 5, 9 - 4, 9, 2546, 4, 10, 3595, 5, 9, 3598, 5, 10, 55797, // 5,10 - 4, 10, 3023, 4, 11, 4309, 5, 10, 4230, 5, 11, 53974, // 5,11 - 4, 11, 3523, 4, 12, 5069, 5, 11, 4879, 5, 12, 52065, // 5,12 - 4, 12, 4020, 4, 13, 5842, 5, 12, 5508, 5, 13, 50166, // 5,13 - 4, 13, 4505, 4, 14, 6613, 5, 13, 6104, 5, 14, 48314, // 5,14 - 4, 14, 4971, 4, 15, 7374, 5, 14, 6659, 5, 15, 46532, // 5,15 - 6, -1, 6391, 6, 0, 47098, 7, -1, 4814, 7, 0, 7233, // 6, 0 - 6, 0, 5809, 6, 1, 48969, 7, 0, 4327, 7, 1, 6431, // 6, 1 - 6, 1, 5175, 6, 2, 50942, 7, 1, 3813, 7, 2, 5606, // 6, 2 - 6, 2, 4489, 6, 3, 53012, 7, 2, 3273, 7, 3, 4762, // 6, 3 - 6, 3, 3755, 6, 4, 55166, 7, 3, 2710, 7, 4, 3905, // 6, 4 - 6, 4, 2993, 6, 5, 57354, 7, 4, 2138, 7, 5, 3051, // 6, 5 - 6, 5, 2258, 6, 6, 59422, 7, 5, 1597, 7, 6, 2259, // 6, 6 - 6, 6, 1726, 6, 7, 60905, 7, 6, 1210, 7, 7, 1695, // 6, 7 - 5, 7, 1209, 5, 8, 1695, 6, 7, 1726, 6, 8, 60906, // 6, 8 - 5, 8, 1597, 5, 9, 2258, 6, 8, 2259, 6, 9, 59422, // 6, 9 - 5, 9, 2138, 5, 10, 3050, 6, 9, 2995, 6, 10, 57353, // 6,10 - 5, 10, 2711, 5, 11, 3902, 6, 10, 3759, 6, 11, 55164, // 6,11 - 5, 11, 3274, 5, 12, 4759, 6, 11, 4495, 6, 12, 53008, // 6,12 - 5, 12, 3815, 5, 13, 5602, 6, 12, 5184, 6, 13, 50935, // 6,13 - 5, 13, 4330, 5, 14, 6425, 6, 13, 5820, 6, 14, 48961, // 6,14 - 5, 14, 4818, 5, 15, 7227, 6, 14, 6405, 6, 15, 47086, // 6,15 - 7, -1, 6217, 7, 0, 47440, 8, -1, 4718, 8, 0, 7161, // 7, 0 - 7, 0, 5623, 7, 1, 49358, 8, 0, 4221, 8, 1, 6334, // 7, 1 - 7, 1, 4970, 7, 2, 51395, 8, 1, 3691, 8, 2, 5480, // 7, 2 - 7, 2, 4254, 7, 3, 53562, 8, 2, 3126, 8, 3, 4594, // 7, 3 - 7, 3, 3469, 7, 4, 55870, 8, 3, 2524, 8, 4, 3673, // 7, 4 - 7, 4, 2615, 7, 5, 58324, 8, 4, 1884, 8, 5, 2713, // 7, 5 - 7, 5, 1695, 7, 6, 60906, 8, 5, 1209, 8, 6, 1726, // 7, 6 - 7, 6, 789, 7, 7, 63399, 8, 6, 558, 8, 7, 790, // 7, 7 - 6, 7, 558, 6, 8, 789, 7, 7, 789, 7, 8, 63400, // 7, 8 - 6, 8, 1210, 6, 9, 1726, 7, 8, 1695, 7, 9, 60905, // 7, 9 - 6, 9, 1884, 6, 10, 2713, 7, 9, 2616, 7, 10, 58323, // 7,10 - 6, 10, 2525, 6, 11, 3671, 7, 10, 3473, 7, 11, 55867, // 7,11 - 6, 11, 3128, 6, 12, 4592, 7, 11, 4259, 7, 12, 53557, // 7,12 - 6, 12, 3693, 6, 13, 5478, 7, 12, 4978, 7, 13, 51387, // 7,13 - 6, 13, 4224, 6, 14, 6332, 7, 13, 5633, 7, 14, 49347, // 7,14 - 6, 14, 4722, 6, 15, 7158, 7, 14, 6230, 7, 15, 47426, // 7,15 - 8, 0, 47426, 8, 1, 6230, 9, 0, 7158, 9, 1, 4722, // 8, 0 - 8, 1, 49347, 8, 2, 5633, 9, 1, 6332, 9, 2, 4224, // 8, 1 - 8, 2, 51387, 8, 3, 4978, 9, 2, 5478, 9, 3, 3693, // 8, 2 - 8, 3, 53557, 8, 4, 4259, 9, 3, 4592, 9, 4, 3128, // 8, 3 - 8, 4, 55867, 8, 5, 3473, 9, 4, 3671, 9, 5, 2525, // 8, 4 - 8, 5, 58322, 8, 6, 2616, 9, 5, 2713, 9, 6, 1885, // 8, 5 - 8, 6, 60905, 8, 7, 1695, 9, 6, 1726, 9, 7, 1210, // 8, 6 - 8, 7, 63399, 8, 8, 789, 9, 7, 789, 9, 8, 559, // 8, 7 - 7, 8, 789, 7, 9, 558, 8, 8, 63399, 8, 9, 790, // 8, 8 - 7, 9, 1726, 7, 10, 1209, 8, 9, 60906, 8, 10, 1695, // 8, 9 - 7, 10, 2714, 7, 11, 1884, 8, 10, 58324, 8, 11, 2614, // 8,10 - 7, 11, 3672, 7, 12, 2524, 8, 11, 55870, 8, 12, 3470, // 8,11 - 7, 12, 4594, 7, 13, 3126, 8, 12, 53562, 8, 13, 4254, // 8,12 - 7, 13, 5480, 7, 14, 3691, 8, 13, 51395, 8, 14, 4970, // 8,13 - 7, 14, 6335, 7, 15, 4221, 8, 14, 49358, 8, 15, 5622, // 8,14 - 7, 15, 7161, 7, 16, 4718, 8, 15, 47440, 8, 16, 6217, // 8,15 - 9, 0, 47086, 9, 1, 6405, 10, 0, 7227, 10, 1, 4818, // 9, 0 - 9, 1, 48960, 9, 2, 5820, 10, 1, 6425, 10, 2, 4331, // 9, 1 - 9, 2, 50935, 9, 3, 5184, 10, 2, 5602, 10, 3, 3815, // 9, 2 - 9, 3, 53008, 9, 4, 4495, 10, 3, 4759, 10, 4, 3274, // 9, 3 - 9, 4, 55164, 9, 5, 3759, 10, 4, 3902, 10, 5, 2711, // 9, 4 - 9, 5, 57353, 9, 6, 2995, 10, 5, 3050, 10, 6, 2138, // 9, 5 - 9, 6, 59422, 9, 7, 2259, 10, 6, 2258, 10, 7, 1597, // 9, 6 - 9, 7, 60906, 9, 8, 1726, 10, 7, 1695, 10, 8, 1209, // 9, 7 - 8, 8, 1695, 8, 9, 1210, 9, 8, 60905, 9, 9, 1726, // 9, 8 - 8, 9, 2259, 8, 10, 1597, 9, 9, 59422, 9, 10, 2258, // 9, 9 - 8, 10, 3051, 8, 11, 2138, 9, 10, 57354, 9, 11, 2993, // 9,10 - 8, 11, 3904, 8, 12, 2710, 9, 11, 55166, 9, 12, 3756, // 9,11 - 8, 12, 4762, 8, 13, 3273, 9, 12, 53012, 9, 13, 4489, // 9,12 - 8, 13, 5606, 8, 14, 3813, 9, 13, 50942, 9, 14, 5175, // 9,13 - 8, 14, 6430, 8, 15, 4327, 9, 14, 48969, 9, 15, 5810, // 9,14 - 8, 15, 7233, 8, 16, 4814, 9, 15, 47098, 9, 16, 6391, // 9,15 - 10, 0, 46532, 10, 1, 6659, 11, 0, 7374, 11, 1, 4971, // 10, 0 - 10, 1, 48314, 10, 2, 6104, 11, 1, 6613, 11, 2, 4505, // 10, 1 - 10, 2, 50165, 10, 3, 5508, 11, 2, 5842, 11, 3, 4021, // 10, 2 - 10, 3, 52066, 10, 4, 4879, 11, 3, 5069, 11, 4, 3522, // 10, 3 - 10, 4, 53973, 10, 5, 4230, 11, 4, 4309, 11, 5, 3024, // 10, 4 - 10, 5, 55798, 10, 6, 3598, 11, 5, 3595, 11, 6, 2545, // 10, 5 - 10, 6, 57354, 10, 7, 3051, 11, 6, 2993, 11, 7, 2138, // 10, 6 - 10, 7, 58324, 10, 8, 2714, 11, 7, 2615, 11, 8, 1883, // 10, 7 - 9, 8, 2616, 9, 9, 1884, 10, 8, 58322, 10, 9, 2714, // 10, 8 - 9, 9, 2995, 9, 10, 2138, 10, 9, 57353, 10, 10, 3050, // 10, 9 - 9, 10, 3598, 9, 11, 2546, 10, 10, 55798, 10, 11, 3594, // 10,10 - 9, 11, 4313, 9, 12, 3023, 10, 11, 53975, 10, 12, 4225, // 10,11 - 9, 12, 5073, 9, 13, 3522, 10, 12, 52069, 10, 13, 4872, // 10,12 - 9, 13, 5848, 9, 14, 4019, 10, 13, 50171, 10, 14, 5498, // 10,13 - 9, 14, 6620, 9, 15, 4502, 10, 14, 48322, 10, 15, 6092, // 10,14 - 9, 15, 7383, 9, 16, 4967, 10, 15, 46541, 10, 16, 6645, // 10,15 - 11, 0, 45791, 11, 1, 6986, 12, 0, 7587, 12, 1, 5172, // 11, 0 - 11, 1, 47453, 11, 2, 6472, 12, 1, 6875, 12, 2, 4736, // 11, 1 - 11, 2, 49147, 11, 3, 5930, 12, 2, 6168, 12, 3, 4291, // 11, 2 - 11, 3, 50843, 11, 4, 5373, 12, 3, 5474, 12, 4, 3846, // 11, 3 - 11, 4, 52484, 11, 5, 4822, 12, 4, 4816, 12, 5, 3414, // 11, 4 - 11, 5, 53975, 11, 6, 4313, 12, 5, 4226, 12, 6, 3022, // 11, 5 - 11, 6, 55166, 11, 7, 3904, 12, 6, 3755, 12, 7, 2711, // 11, 6 - 11, 7, 55870, 11, 8, 3672, 12, 7, 3469, 12, 8, 2525, // 11, 7 - 10, 8, 3473, 10, 9, 2525, 11, 8, 55867, 11, 9, 3671, // 11, 8 - 10, 9, 3759, 10, 10, 2711, 11, 9, 55164, 11, 10, 3902, // 11, 9 - 10, 10, 4230, 10, 11, 3023, 11, 10, 53973, 11, 11, 4310, // 11,10 - 10, 11, 4822, 10, 12, 3415, 11, 11, 52484, 11, 12, 4815, // 11,11 - 10, 12, 5481, 10, 13, 3845, 11, 12, 50844, 11, 13, 5366, // 11,12 - 10, 13, 6176, 10, 14, 4290, 11, 13, 49150, 11, 14, 5920, // 11,13 - 10, 14, 6886, 10, 15, 4734, 11, 14, 47458, 11, 15, 6458, // 11,14 - 10, 15, 7599, 10, 16, 5169, 11, 15, 45799, 11, 16, 6969, // 11,15 - 12, 0, 44901, 12, 1, 7374, 13, 0, 7848, 13, 1, 5413, // 12, 0 - 12, 1, 46427, 12, 2, 6908, 13, 1, 7191, 13, 2, 5010, // 12, 1 - 12, 2, 47953, 12, 3, 6426, 13, 2, 6549, 13, 3, 4608, // 12, 2 - 12, 3, 49445, 12, 4, 5943, 13, 3, 5934, 13, 4, 4214, // 12, 3 - 12, 4, 50844, 12, 5, 5481, 13, 4, 5365, 13, 5, 3846, // 12, 4 - 12, 5, 52069, 12, 6, 5073, 13, 5, 4872, 13, 6, 3522, // 12, 5 - 12, 6, 53012, 12, 7, 4762, 13, 6, 4489, 13, 7, 3273, // 12, 6 - 12, 7, 53562, 12, 8, 4594, 13, 7, 4254, 13, 8, 3126, // 12, 7 - 11, 8, 4259, 11, 9, 3128, 12, 8, 53557, 12, 9, 4592, // 12, 8 - 11, 9, 4495, 11, 10, 3274, 12, 9, 53008, 12, 10, 4759, // 12, 9 - 11, 10, 4879, 11, 11, 3523, 12, 10, 52066, 12, 11, 5068, // 12,10 - 11, 11, 5373, 11, 12, 3846, 12, 11, 50843, 12, 12, 5474, // 12,11 - 11, 12, 5943, 11, 13, 4214, 12, 12, 49445, 12, 13, 5934, // 12,12 - 11, 13, 6560, 11, 14, 4607, 12, 13, 47955, 12, 14, 6414, // 12,13 - 11, 14, 7204, 11, 15, 5009, 12, 14, 46430, 12, 15, 6893, // 12,14 - 11, 15, 7863, 11, 16, 5410, 12, 15, 44907, 12, 16, 7356, // 12,15 - 13, 0, 43900, 13, 1, 7812, 14, 0, 8141, 14, 1, 5683, // 13, 0 - 13, 1, 45286, 13, 2, 7395, 14, 1, 7539, 14, 2, 5316, // 13, 1 - 13, 2, 46650, 13, 3, 6973, 14, 2, 6959, 14, 3, 4954, // 13, 2 - 13, 3, 47955, 13, 4, 6560, 14, 3, 6414, 14, 4, 4607, // 13, 3 - 13, 4, 49150, 13, 5, 6176, 14, 4, 5920, 14, 5, 4290, // 13, 4 - 13, 5, 50171, 13, 6, 5848, 14, 5, 5499, 14, 6, 4018, // 13, 5 - 13, 6, 50942, 13, 7, 5606, 14, 6, 5175, 14, 7, 3813, // 13, 6 - 13, 7, 51395, 13, 8, 5480, 14, 7, 4970, 14, 8, 3691, // 13, 7 - 12, 8, 4978, 12, 9, 3693, 13, 8, 51387, 13, 9, 5478, // 13, 8 - 12, 9, 5184, 12, 10, 3815, 13, 9, 50935, 13, 10, 5602, // 13, 9 - 12, 10, 5508, 12, 11, 4020, 13, 10, 50165, 13, 11, 5843, // 13,10 - 12, 11, 5930, 12, 12, 4291, 13, 11, 49147, 13, 12, 6168, // 13,11 - 12, 12, 6426, 12, 13, 4608, 13, 12, 47953, 13, 13, 6549, // 13,12 - 12, 13, 6973, 12, 14, 4954, 13, 13, 46650, 13, 14, 6959, // 13,13 - 12, 14, 7555, 12, 15, 5315, 13, 14, 45288, 13, 15, 7378, // 13,14 - 12, 15, 8159, 12, 16, 5682, 13, 15, 43904, 13, 16, 7791, // 13,15 - 14, 0, 42821, 14, 1, 8288, 15, 0, 8452, 15, 1, 5975, // 14, 0 - 14, 1, 44074, 14, 2, 7921, 15, 1, 7901, 15, 2, 5640, // 14, 1 - 14, 2, 45288, 14, 3, 7555, 15, 2, 7378, 15, 3, 5315, // 14, 2 - 14, 3, 46430, 14, 4, 7204, 15, 3, 6892, 15, 4, 5010, // 14, 3 - 14, 4, 47458, 14, 5, 6886, 15, 4, 6458, 15, 5, 4734, // 14, 4 - 14, 5, 48322, 14, 6, 6620, 15, 5, 6092, 15, 6, 4502, // 14, 5 - 14, 6, 48969, 14, 7, 6430, 15, 6, 5809, 15, 7, 4328, // 14, 6 - 14, 7, 49358, 14, 8, 6335, 15, 7, 5623, 15, 8, 4220, // 14, 7 - 13, 8, 5633, 13, 9, 4224, 14, 8, 49347, 14, 9, 6332, // 14, 8 - 13, 9, 5820, 13, 10, 4330, 14, 9, 48960, 14, 10, 6426, // 14, 9 - 13, 10, 6104, 13, 11, 4505, 14, 10, 48314, 14, 11, 6613, // 14,10 - 13, 11, 6472, 13, 12, 4736, 14, 11, 47453, 14, 12, 6875, // 14,11 - 13, 12, 6908, 13, 13, 5011, 14, 12, 46427, 14, 13, 7190, // 14,12 - 13, 13, 7395, 13, 14, 5316, 14, 13, 45286, 14, 14, 7539, // 14,13 - 13, 14, 7921, 13, 15, 5640, 14, 14, 44074, 14, 15, 7901, // 14,14 - 13, 15, 8474, 13, 16, 5974, 14, 15, 42823, 14, 16, 8265, // 14,15 - 15, 0, 41693, 15, 1, 8795, 16, 0, 8769, 16, 1, 6279, // 15, 0 - 15, 1, 42823, 15, 2, 8474, 16, 1, 8265, 16, 2, 5974, // 15, 1 - 15, 2, 43904, 15, 3, 8159, 16, 2, 7791, 16, 3, 5682, // 15, 2 - 15, 3, 44907, 15, 4, 7863, 16, 3, 7356, 16, 4, 5410, // 15, 3 - 15, 4, 45799, 15, 5, 7599, 16, 4, 6970, 16, 5, 5168, // 15, 4 - 15, 5, 46541, 15, 6, 7383, 16, 5, 6644, 16, 6, 4968, // 15, 5 - 15, 6, 47098, 15, 7, 7233, 16, 6, 6391, 16, 7, 4814, // 15, 6 - 15, 7, 47440, 15, 8, 7161, 16, 7, 6217, 16, 8, 4718, // 15, 7 - 14, 8, 6230, 14, 9, 4722, 15, 8, 47426, 15, 9, 7158, // 15, 8 - 14, 9, 6405, 14, 10, 4818, 15, 9, 47086, 15, 10, 7227, // 15, 9 - 14, 10, 6659, 14, 11, 4971, 15, 10, 46532, 15, 11, 7374, // 15,10 - 14, 11, 6986, 14, 12, 5172, 15, 11, 45791, 15, 12, 7587, // 15,11 - 14, 12, 7374, 14, 13, 5413, 15, 12, 44901, 15, 13, 7848, // 15,12 - 14, 13, 7812, 14, 14, 5684, 15, 13, 43900, 15, 14, 8140, // 15,13 - 14, 14, 8288, 14, 15, 5975, 15, 14, 42821, 15, 15, 8452, // 15,14 - 14, 15, 8795, 14, 16, 6280, 15, 15, 41693, 15, 16, 8768, // 15,15 - // angle of 1.5 degrees - 0, -1, 11440, 0, 0, 34212, 1, -1, 8358, 1, 0, 11526, // 0, 0 - 0, 0, 11192, 0, 1, 35502, 1, 0, 7987, 1, 1, 10855, // 0, 1 - 0, 1, 10930, 0, 2, 36756, 1, 1, 7626, 1, 2, 10224, // 0, 2 - 0, 2, 10670, 0, 3, 37939, 1, 2, 7285, 1, 3, 9642, // 0, 3 - 0, 3, 10430, 0, 4, 39009, 1, 3, 6975, 1, 4, 9122, // 0, 4 - 0, 4, 10232, 0, 5, 39918, 1, 4, 6710, 1, 5, 8676, // 0, 5 - 0, 5, 10100, 0, 6, 40618, 1, 5, 6502, 1, 6, 8316, // 0, 6 - 0, 6, 10052, 0, 7, 41072, 1, 6, 6360, 1, 7, 8052, // 0, 7 - -1, 7, 6346, -1, 8, 8018, 0, 7, 10066, 0, 8, 41106, // 0, 8 - -1, 8, 6489, -1, 9, 8278, 0, 8, 10123, 0, 9, 40646, // 0, 9 - -1, 9, 6699, -1, 10, 8632, 0, 9, 10265, 0, 10, 39940, // 0,10 - -1, 10, 6965, -1, 11, 9072, 0, 10, 10473, 0, 11, 39026, // 0,11 - -1, 11, 7276, -1, 12, 9585, 0, 11, 10723, 0, 12, 37952, // 0,12 - -1, 12, 7620, -1, 13, 10158, 0, 12, 10994, 0, 13, 36764, // 0,13 - -1, 13, 7983, -1, 14, 10780, 0, 13, 11267, 0, 14, 35506, // 0,14 - -1, 14, 8358, -1, 15, 11440, 0, 14, 11526, 0, 15, 34212, // 0,15 - 1, -1, 10780, 1, 0, 35506, 2, -1, 7983, 2, 0, 11267, // 1, 0 - 1, 0, 10467, 1, 1, 36959, 2, 0, 7579, 2, 1, 10531, // 1, 1 - 1, 1, 10133, 1, 2, 38390, 2, 1, 7179, 2, 2, 9834, // 1, 2 - 1, 2, 9796, 1, 3, 39759, 2, 2, 6797, 2, 3, 9184, // 1, 3 - 1, 3, 9478, 1, 4, 41013, 2, 3, 6447, 2, 4, 8598, // 1, 4 - 1, 4, 9206, 1, 5, 42087, 2, 4, 6145, 2, 5, 8098, // 1, 5 - 1, 5, 9014, 1, 6, 42913, 2, 5, 5910, 2, 6, 7699, // 1, 6 - 1, 6, 8929, 1, 7, 43433, 2, 6, 5756, 2, 7, 7418, // 1, 7 - 0, 7, 5745, 0, 8, 7390, 1, 7, 8939, 1, 8, 43462, // 1, 8 - 0, 8, 5900, 0, 9, 7667, 1, 8, 9032, 1, 9, 42937, // 1, 9 - 0, 9, 6137, 0, 10, 8061, 1, 9, 9233, 1, 10, 42105, // 1,10 - 0, 10, 6440, 0, 11, 8557, 1, 10, 9513, 1, 11, 41026, // 1,11 - 0, 11, 6792, 0, 12, 9135, 1, 11, 9841, 1, 12, 39768, // 1,12 - 0, 12, 7177, 0, 13, 9777, 1, 12, 10188, 1, 13, 38394, // 1,13 - 0, 13, 7579, 0, 14, 10467, 1, 13, 10532, 1, 14, 36958, // 1,14 - 0, 14, 7987, 0, 15, 11192, 1, 14, 10855, 1, 15, 35502, // 1,15 - 2, -1, 10158, 2, 0, 36764, 3, -1, 7620, 3, 0, 10994, // 2, 0 - 2, 0, 9777, 2, 1, 38394, 3, 0, 7177, 3, 1, 10188, // 2, 1 - 2, 1, 9366, 2, 2, 40025, 3, 1, 6732, 3, 2, 9413, // 2, 2 - 2, 2, 8941, 2, 3, 41614, 3, 2, 6299, 3, 3, 8682, // 2, 3 - 2, 3, 8530, 2, 4, 43096, 3, 3, 5895, 3, 4, 8015, // 2, 4 - 2, 4, 8167, 2, 5, 44386, 3, 4, 5543, 3, 5, 7440, // 2, 5 - 2, 5, 7899, 2, 6, 45383, 3, 5, 5268, 3, 6, 6986, // 2, 6 - 2, 6, 7766, 2, 7, 45995, 3, 6, 5095, 3, 7, 6680, // 2, 7 - 1, 7, 5087, 1, 8, 6658, 2, 7, 7773, 2, 8, 46018, // 2, 8 - 1, 8, 5261, 1, 9, 6961, 2, 8, 7913, 2, 9, 45401, // 2, 9 - 1, 9, 5537, 1, 10, 7411, 2, 9, 8189, 2, 10, 44399, // 2,10 - 1, 10, 5891, 1, 11, 7981, 2, 10, 8559, 2, 11, 43105, // 2,11 - 1, 11, 6297, 1, 12, 8641, 2, 11, 8979, 2, 12, 41619, // 2,12 - 1, 12, 6732, 1, 13, 9366, 2, 12, 9413, 2, 13, 40025, // 2,13 - 1, 13, 7179, 1, 14, 10133, 2, 13, 9834, 2, 14, 38390, // 2,14 - 1, 14, 7626, 1, 15, 10930, 2, 14, 10224, 2, 15, 36756, // 2,15 - 3, -1, 9585, 3, 0, 37951, 4, -1, 7276, 4, 0, 10724, // 3, 0 - 3, 0, 9135, 3, 1, 39767, 4, 0, 6792, 4, 1, 9842, // 3, 1 - 3, 1, 8641, 3, 2, 41618, 4, 1, 6297, 4, 2, 8980, // 3, 2 - 3, 2, 8120, 3, 3, 43461, 4, 2, 5804, 4, 3, 8151, // 3, 3 - 3, 3, 7598, 3, 4, 45224, 4, 3, 5331, 4, 4, 7383, // 3, 4 - 3, 4, 7121, 3, 5, 46798, 4, 4, 4909, 4, 5, 6708, // 3, 5 - 3, 5, 6750, 3, 6, 48037, 4, 5, 4576, 4, 6, 6173, // 3, 6 - 3, 6, 6552, 3, 7, 48785, 4, 6, 4372, 4, 7, 5827, // 3, 7 - 2, 7, 4366, 2, 8, 5811, 3, 7, 6558, 3, 8, 48801, // 3, 8 - 2, 8, 4572, 2, 9, 6154, 3, 8, 6761, 3, 9, 48049, // 3, 9 - 2, 9, 4906, 2, 10, 6685, 3, 9, 7138, 3, 10, 46807, // 3,10 - 2, 10, 5330, 2, 11, 7356, 3, 10, 7622, 3, 11, 45228, // 3,11 - 2, 11, 5804, 2, 12, 8120, 3, 11, 8151, 3, 12, 43461, // 3,12 - 2, 12, 6299, 2, 13, 8941, 3, 12, 8681, 3, 13, 41615, // 3,13 - 2, 13, 6797, 2, 14, 9796, 3, 13, 9184, 3, 14, 39759, // 3,14 - 2, 14, 7285, 2, 15, 10670, 3, 14, 9642, 3, 15, 37939, // 3,15 - 4, -1, 9072, 4, 0, 39026, 5, -1, 6965, 5, 0, 10473, // 4, 0 - 4, 0, 8557, 4, 1, 41026, 5, 0, 6440, 5, 1, 9513, // 4, 1 - 4, 1, 7981, 4, 2, 43105, 5, 1, 5891, 5, 2, 8559, // 4, 2 - 4, 2, 7356, 4, 3, 45229, 5, 2, 5330, 5, 3, 7621, // 4, 3 - 4, 3, 6708, 4, 4, 47328, 5, 3, 4774, 5, 4, 6726, // 4, 4 - 4, 4, 6086, 4, 5, 49275, 5, 4, 4258, 5, 5, 5917, // 4, 5 - 4, 5, 5573, 4, 6, 50865, 5, 5, 3837, 5, 6, 5261, // 4, 6 - 4, 6, 5280, 4, 7, 51832, 5, 6, 3579, 5, 7, 4845, // 4, 7 - 3, 7, 3575, 3, 8, 4835, 4, 7, 5283, 4, 8, 51843, // 4, 8 - 3, 8, 3834, 3, 9, 5248, 4, 8, 5581, 4, 9, 50873, // 4, 9 - 3, 9, 4257, 3, 10, 5901, 4, 9, 6099, 4, 10, 49279, // 4,10 - 3, 10, 4774, 3, 11, 6708, 4, 10, 6727, 4, 11, 47327, // 4,11 - 3, 11, 5331, 3, 12, 7598, 4, 11, 7382, 4, 12, 45225, // 4,12 - 3, 12, 5895, 3, 13, 8530, 4, 12, 8015, 4, 13, 43096, // 4,13 - 3, 13, 6447, 3, 14, 9478, 4, 13, 8599, 4, 14, 41012, // 4,14 - 3, 14, 6975, 3, 15, 10430, 4, 14, 9122, 4, 15, 39009, // 4,15 - 5, -1, 8632, 5, 0, 39940, 6, -1, 6699, 6, 0, 10265, // 5, 0 - 5, 0, 8061, 5, 1, 42105, 6, 0, 6137, 6, 1, 9233, // 5, 1 - 5, 1, 7411, 5, 2, 44399, 6, 1, 5537, 6, 2, 8189, // 5, 2 - 5, 2, 6685, 5, 3, 46806, 6, 2, 4906, 6, 3, 7139, // 5, 3 - 5, 3, 5901, 5, 4, 49279, 6, 3, 4257, 6, 4, 6099, // 5, 4 - 5, 4, 5103, 5, 5, 51700, 6, 4, 3621, 6, 5, 5112, // 5, 5 - 5, 5, 4388, 5, 6, 53813, 6, 5, 3065, 6, 6, 4270, // 5, 6 - 5, 6, 3938, 5, 7, 55162, 6, 6, 2710, 6, 7, 3726, // 5, 7 - 4, 7, 2708, 4, 8, 3720, 5, 7, 3940, 5, 8, 55168, // 5, 8 - 4, 8, 3064, 4, 9, 4262, 5, 8, 4394, 5, 9, 53816, // 5, 9 - 4, 9, 3621, 4, 10, 5103, 5, 9, 5113, 5, 10, 51699, // 5,10 - 4, 10, 4258, 4, 11, 6086, 5, 10, 5917, 5, 11, 49275, // 5,11 - 4, 11, 4909, 4, 12, 7121, 5, 11, 6707, 5, 12, 46799, // 5,12 - 4, 12, 5543, 4, 13, 8167, 5, 12, 7440, 5, 13, 44386, // 5,13 - 4, 13, 6145, 4, 14, 9206, 5, 13, 8098, 5, 14, 42087, // 5,14 - 4, 14, 6710, 4, 15, 10232, 5, 14, 8676, 5, 15, 39918, // 5,15 - 6, -1, 8278, 6, 0, 40646, 7, -1, 6489, 7, 0, 10123, // 6, 0 - 6, 0, 7667, 6, 1, 42936, 7, 0, 5900, 7, 1, 9033, // 6, 1 - 6, 1, 6961, 6, 2, 45401, 7, 1, 5261, 7, 2, 7913, // 6, 2 - 6, 2, 6154, 6, 3, 48049, 7, 2, 4572, 7, 3, 6761, // 6, 3 - 6, 3, 5248, 6, 4, 50873, 7, 3, 3834, 7, 4, 5581, // 6, 4 - 6, 4, 4262, 6, 5, 53816, 7, 4, 3064, 7, 5, 4394, // 6, 5 - 6, 5, 3271, 6, 6, 56673, 7, 5, 2316, 7, 6, 3276, // 6, 6 - 6, 6, 2532, 6, 7, 58773, 7, 6, 1767, 7, 7, 2464, // 6, 7 - 5, 7, 1766, 5, 8, 2462, 6, 7, 2533, 6, 8, 58775, // 6, 8 - 5, 8, 2316, 5, 9, 3271, 6, 8, 3275, 6, 9, 56674, // 6, 9 - 5, 9, 3065, 5, 10, 4388, 6, 9, 4269, 6, 10, 53814, // 6,10 - 5, 10, 3837, 5, 11, 5573, 6, 10, 5261, 6, 11, 50865, // 6,11 - 5, 11, 4576, 5, 12, 6750, 6, 11, 6173, 6, 12, 48037, // 6,12 - 5, 12, 5268, 5, 13, 7899, 6, 12, 6986, 6, 13, 45383, // 6,13 - 5, 13, 5910, 5, 14, 9014, 6, 13, 7699, 6, 14, 42913, // 6,14 - 5, 14, 6502, 5, 15, 10100, 6, 14, 8316, 6, 15, 40618, // 6,15 - 7, -1, 8018, 7, 0, 41106, 8, -1, 6346, 8, 0, 10066, // 7, 0 - 7, 0, 7390, 7, 1, 43461, 8, 0, 5745, 8, 1, 8940, // 7, 1 - 7, 1, 6658, 7, 2, 46017, 8, 1, 5087, 8, 2, 7774, // 7, 2 - 7, 2, 5811, 7, 3, 48801, 8, 2, 4366, 8, 3, 6558, // 7, 3 - 7, 3, 4835, 7, 4, 51842, 8, 3, 3575, 8, 4, 5284, // 7, 4 - 7, 4, 3720, 7, 5, 55168, 8, 4, 2708, 8, 5, 3940, // 7, 5 - 7, 5, 2462, 7, 6, 58775, 8, 5, 1766, 8, 6, 2533, // 7, 6 - 7, 6, 1170, 7, 7, 62369, 8, 6, 827, 8, 7, 1170, // 7, 7 - 6, 7, 827, 6, 8, 1170, 7, 7, 1170, 7, 8, 62369, // 7, 8 - 6, 8, 1767, 6, 9, 2532, 7, 8, 2464, 7, 9, 58773, // 7, 9 - 6, 9, 2710, 6, 10, 3938, 7, 9, 3726, 7, 10, 55162, // 7,10 - 6, 10, 3579, 6, 11, 5280, 7, 10, 4846, 7, 11, 51831, // 7,11 - 6, 11, 4372, 6, 12, 6552, 7, 11, 5827, 7, 12, 48785, // 7,12 - 6, 12, 5095, 6, 13, 7766, 7, 12, 6680, 7, 13, 45995, // 7,13 - 6, 13, 5756, 6, 14, 8929, 7, 13, 7418, 7, 14, 43433, // 7,14 - 6, 14, 6360, 6, 15, 10052, 7, 14, 8052, 7, 15, 41072, // 7,15 - 8, 0, 41072, 8, 1, 8052, 9, 0, 10052, 9, 1, 6360, // 8, 0 - 8, 1, 43433, 8, 2, 7418, 9, 1, 8929, 9, 2, 5756, // 8, 1 - 8, 2, 45995, 8, 3, 6680, 9, 2, 7766, 9, 3, 5095, // 8, 2 - 8, 3, 48785, 8, 4, 5827, 9, 3, 6552, 9, 4, 4372, // 8, 3 - 8, 4, 51832, 8, 5, 4846, 9, 4, 5280, 9, 5, 3578, // 8, 4 - 8, 5, 55162, 8, 6, 3726, 9, 5, 3938, 9, 6, 2710, // 8, 5 - 8, 6, 58773, 8, 7, 2464, 9, 6, 2532, 9, 7, 1767, // 8, 6 - 8, 7, 62369, 8, 8, 1170, 9, 7, 1170, 9, 8, 827, // 8, 7 - 7, 8, 1170, 7, 9, 827, 8, 8, 62369, 8, 9, 1170, // 8, 8 - 7, 9, 2533, 7, 10, 1766, 8, 9, 58775, 8, 10, 2462, // 8, 9 - 7, 10, 3940, 7, 11, 2708, 8, 10, 55168, 8, 11, 3720, // 8,10 - 7, 11, 5283, 7, 12, 3575, 8, 11, 51842, 8, 12, 4836, // 8,11 - 7, 12, 6558, 7, 13, 4366, 8, 12, 48801, 8, 13, 5811, // 8,12 - 7, 13, 7773, 7, 14, 5087, 8, 13, 46017, 8, 14, 6659, // 8,13 - 7, 14, 8939, 7, 15, 5745, 8, 14, 43461, 8, 15, 7391, // 8,14 - 7, 15, 10066, 7, 16, 6346, 8, 15, 41106, 8, 16, 8018, // 8,15 - 9, 0, 40618, 9, 1, 8316, 10, 0, 10100, 10, 1, 6502, // 9, 0 - 9, 1, 42913, 9, 2, 7699, 10, 1, 9014, 10, 2, 5910, // 9, 1 - 9, 2, 45383, 9, 3, 6986, 10, 2, 7899, 10, 3, 5268, // 9, 2 - 9, 3, 48037, 9, 4, 6173, 10, 3, 6750, 10, 4, 4576, // 9, 3 - 9, 4, 50865, 9, 5, 5261, 10, 4, 5573, 10, 5, 3837, // 9, 4 - 9, 5, 53813, 9, 6, 4269, 10, 5, 4388, 10, 6, 3066, // 9, 5 - 9, 6, 56673, 9, 7, 3275, 10, 6, 3271, 10, 7, 2317, // 9, 6 - 9, 7, 58775, 9, 8, 2533, 10, 7, 2462, 10, 8, 1766, // 9, 7 - 8, 8, 2464, 8, 9, 1767, 9, 8, 58773, 9, 9, 2532, // 9, 8 - 8, 9, 3275, 8, 10, 2316, 9, 9, 56673, 9, 10, 3272, // 9, 9 - 8, 10, 4394, 8, 11, 3064, 9, 10, 53816, 9, 11, 4262, // 9,10 - 8, 11, 5581, 8, 12, 3834, 9, 11, 50873, 9, 12, 5248, // 9,11 - 8, 12, 6761, 8, 13, 4572, 9, 12, 48049, 9, 13, 6154, // 9,12 - 8, 13, 7913, 8, 14, 5261, 9, 13, 45401, 9, 14, 6961, // 9,13 - 8, 14, 9032, 8, 15, 5900, 9, 14, 42936, 9, 15, 7668, // 9,14 - 8, 15, 10123, 8, 16, 6489, 9, 15, 40646, 9, 16, 8278, // 9,15 - 10, 0, 39918, 10, 1, 8676, 11, 0, 10232, 11, 1, 6710, // 10, 0 - 10, 1, 42087, 10, 2, 8098, 11, 1, 9206, 11, 2, 6145, // 10, 1 - 10, 2, 44386, 10, 3, 7440, 11, 2, 8167, 11, 3, 5543, // 10, 2 - 10, 3, 46798, 10, 4, 6707, 11, 3, 7121, 11, 4, 4910, // 10, 3 - 10, 4, 49275, 10, 5, 5917, 11, 4, 6086, 11, 5, 4258, // 10, 4 - 10, 5, 51700, 10, 6, 5113, 11, 5, 5103, 11, 6, 3620, // 10, 5 - 10, 6, 53816, 10, 7, 4394, 11, 6, 4262, 11, 7, 3064, // 10, 6 - 10, 7, 55168, 10, 8, 3940, 11, 7, 3720, 11, 8, 2708, // 10, 7 - 9, 8, 3726, 9, 9, 2710, 10, 8, 55162, 10, 9, 3938, // 10, 8 - 9, 9, 4269, 9, 10, 3065, 10, 9, 53813, 10, 10, 4389, // 10, 9 - 9, 10, 5113, 9, 11, 3621, 10, 10, 51700, 10, 11, 5102, // 10,10 - 9, 11, 6099, 9, 12, 4257, 10, 11, 49279, 10, 12, 5901, // 10,11 - 9, 12, 7138, 9, 13, 4906, 10, 12, 46806, 10, 13, 6686, // 10,12 - 9, 13, 8189, 9, 14, 5537, 10, 13, 44399, 10, 14, 7411, // 10,13 - 9, 14, 9233, 9, 15, 6137, 10, 14, 42105, 10, 15, 8061, // 10,14 - 9, 15, 10265, 9, 16, 6699, 10, 15, 39940, 10, 16, 8632, // 10,15 - 11, 0, 39009, 11, 1, 9122, 12, 0, 10430, 12, 1, 6975, // 11, 0 - 11, 1, 41013, 11, 2, 8599, 12, 1, 9478, 12, 2, 6446, // 11, 1 - 11, 2, 43096, 11, 3, 8015, 12, 2, 8530, 12, 3, 5895, // 11, 2 - 11, 3, 45224, 11, 4, 7382, 12, 3, 7598, 12, 4, 5332, // 11, 3 - 11, 4, 47328, 11, 5, 6727, 12, 4, 6708, 12, 5, 4773, // 11, 4 - 11, 5, 49279, 11, 6, 6099, 12, 5, 5901, 12, 6, 4257, // 11, 5 - 11, 6, 50873, 11, 7, 5581, 12, 6, 5248, 12, 7, 3834, // 11, 6 - 11, 7, 51842, 11, 8, 5283, 12, 7, 4835, 12, 8, 3576, // 11, 7 - 10, 8, 4846, 10, 9, 3579, 11, 8, 51832, 11, 9, 5279, // 11, 8 - 10, 9, 5261, 10, 10, 3837, 11, 9, 50865, 11, 10, 5573, // 11, 9 - 10, 10, 5917, 10, 11, 4258, 11, 10, 49275, 11, 11, 6086, // 11,10 - 10, 11, 6727, 10, 12, 4774, 11, 11, 47328, 11, 12, 6707, // 11,11 - 10, 12, 7622, 10, 13, 5330, 11, 12, 45229, 11, 13, 7355, // 11,12 - 10, 13, 8559, 10, 14, 5891, 11, 13, 43105, 11, 14, 7981, // 11,13 - 10, 14, 9513, 10, 15, 6440, 11, 14, 41026, 11, 15, 8557, // 11,14 - 10, 15, 10473, 10, 16, 6965, 11, 15, 39026, 11, 16, 9072, // 11,15 - 12, 0, 37939, 12, 1, 9642, 13, 0, 10670, 13, 1, 7285, // 12, 0 - 12, 1, 39759, 12, 2, 9184, 13, 1, 9796, 13, 2, 6797, // 12, 1 - 12, 2, 41614, 12, 3, 8681, 13, 2, 8941, 13, 3, 6300, // 12, 2 - 12, 3, 43461, 12, 4, 8151, 13, 3, 8120, 13, 4, 5804, // 12, 3 - 12, 4, 45229, 12, 5, 7622, 13, 4, 7356, 13, 5, 5329, // 12, 4 - 12, 5, 46806, 12, 6, 7138, 13, 5, 6685, 13, 6, 4907, // 12, 5 - 12, 6, 48049, 12, 7, 6761, 13, 6, 6154, 13, 7, 4572, // 12, 6 - 12, 7, 48801, 12, 8, 6558, 13, 7, 5811, 13, 8, 4366, // 12, 7 - 11, 8, 5827, 11, 9, 4372, 12, 8, 48785, 12, 9, 6552, // 12, 8 - 11, 9, 6173, 11, 10, 4576, 12, 9, 48037, 12, 10, 6750, // 12, 9 - 11, 10, 6707, 11, 11, 4909, 12, 10, 46798, 12, 11, 7122, // 12,10 - 11, 11, 7382, 11, 12, 5331, 12, 11, 45224, 12, 12, 7599, // 12,11 - 11, 12, 8151, 11, 13, 5804, 12, 12, 43461, 12, 13, 8120, // 12,12 - 11, 13, 8979, 11, 14, 6297, 12, 13, 41618, 12, 14, 8642, // 12,13 - 11, 14, 9841, 11, 15, 6792, 12, 14, 39767, 12, 15, 9136, // 12,14 - 11, 15, 10723, 11, 16, 7276, 12, 15, 37951, 12, 16, 9586, // 12,15 - 13, 0, 36756, 13, 1, 10224, 14, 0, 10930, 14, 1, 7626, // 13, 0 - 13, 1, 38390, 13, 2, 9834, 14, 1, 10133, 14, 2, 7179, // 13, 1 - 13, 2, 40025, 13, 3, 9413, 14, 2, 9366, 14, 3, 6732, // 13, 2 - 13, 3, 41618, 13, 4, 8979, 14, 3, 8641, 14, 4, 6298, // 13, 3 - 13, 4, 43105, 13, 5, 8559, 14, 4, 7981, 14, 5, 5891, // 13, 4 - 13, 5, 44399, 13, 6, 8189, 14, 5, 7411, 14, 6, 5537, // 13, 5 - 13, 6, 45401, 13, 7, 7913, 14, 6, 6961, 14, 7, 5261, // 13, 6 - 13, 7, 46017, 13, 8, 7773, 14, 7, 6658, 14, 8, 5088, // 13, 7 - 12, 8, 6680, 12, 9, 5095, 13, 8, 45995, 13, 9, 7766, // 13, 8 - 12, 9, 6986, 12, 10, 5268, 13, 9, 45383, 13, 10, 7899, // 13, 9 - 12, 10, 7440, 12, 11, 5543, 13, 10, 44386, 13, 11, 8167, // 13,10 - 12, 11, 8015, 12, 12, 5895, 13, 11, 43096, 13, 12, 8530, // 13,11 - 12, 12, 8681, 12, 13, 6299, 13, 12, 41614, 13, 13, 8942, // 13,12 - 12, 13, 9413, 12, 14, 6732, 13, 13, 40025, 13, 14, 9366, // 13,13 - 12, 14, 10188, 12, 15, 7177, 13, 14, 38394, 13, 15, 9777, // 13,14 - 12, 15, 10994, 12, 16, 7620, 13, 15, 36764, 13, 16, 10158, // 13,15 - 14, 0, 35502, 14, 1, 10855, 15, 0, 11192, 15, 1, 7987, // 14, 0 - 14, 1, 36959, 14, 2, 10532, 15, 1, 10467, 15, 2, 7578, // 14, 1 - 14, 2, 38394, 14, 3, 10188, 15, 2, 9777, 15, 3, 7177, // 14, 2 - 14, 3, 39767, 14, 4, 9841, 15, 3, 9135, 15, 4, 6793, // 14, 3 - 14, 4, 41026, 14, 5, 9513, 15, 4, 8557, 15, 5, 6440, // 14, 4 - 14, 5, 42105, 14, 6, 9233, 15, 5, 8061, 15, 6, 6137, // 14, 5 - 14, 6, 42936, 14, 7, 9032, 15, 6, 7667, 15, 7, 5901, // 14, 6 - 14, 7, 43461, 14, 8, 8939, 15, 7, 7390, 15, 8, 5746, // 14, 7 - 13, 8, 7418, 13, 9, 5756, 14, 8, 43433, 14, 9, 8929, // 14, 8 - 13, 9, 7699, 13, 10, 5910, 14, 9, 42913, 14, 10, 9014, // 14, 9 - 13, 10, 8098, 13, 11, 6145, 14, 10, 42087, 14, 11, 9206, // 14,10 - 13, 11, 8599, 13, 12, 6447, 14, 11, 41013, 14, 12, 9477, // 14,11 - 13, 12, 9184, 13, 13, 6797, 14, 12, 39759, 14, 13, 9796, // 14,12 - 13, 13, 9834, 13, 14, 7179, 14, 13, 38390, 14, 14, 10133, // 14,13 - 13, 14, 10532, 13, 15, 7579, 14, 14, 36959, 14, 15, 10466, // 14,14 - 13, 15, 11267, 13, 16, 7983, 14, 15, 35506, 14, 16, 10780, // 14,15 - 15, 0, 34212, 15, 1, 11526, 16, 0, 11440, 16, 1, 8358, // 15, 0 - 15, 1, 35506, 15, 2, 11267, 16, 1, 10780, 16, 2, 7983, // 15, 1 - 15, 2, 36764, 15, 3, 10994, 16, 2, 10158, 16, 3, 7620, // 15, 2 - 15, 3, 37951, 15, 4, 10723, 16, 3, 9585, 16, 4, 7277, // 15, 3 - 15, 4, 39026, 15, 5, 10473, 16, 4, 9072, 16, 5, 6965, // 15, 4 - 15, 5, 39940, 15, 6, 10265, 16, 5, 8632, 16, 6, 6699, // 15, 5 - 15, 6, 40646, 15, 7, 10123, 16, 6, 8278, 16, 7, 6489, // 15, 6 - 15, 7, 41106, 15, 8, 10066, 16, 7, 8018, 16, 8, 6346, // 15, 7 - 14, 8, 8052, 14, 9, 6360, 15, 8, 41072, 15, 9, 10052, // 15, 8 - 14, 9, 8316, 14, 10, 6502, 15, 9, 40618, 15, 10, 10100, // 15, 9 - 14, 10, 8676, 14, 11, 6710, 15, 10, 39918, 15, 11, 10232, // 15,10 - 14, 11, 9122, 14, 12, 6975, 15, 11, 39009, 15, 12, 10430, // 15,11 - 14, 12, 9642, 14, 13, 7285, 15, 12, 37939, 15, 13, 10670, // 15,12 - 14, 13, 10224, 14, 14, 7626, 15, 13, 36756, 15, 14, 10930, // 15,13 - 14, 14, 10855, 14, 15, 7987, 15, 14, 35502, 15, 15, 11192, // 15,14 - 14, 15, 11526, 14, 16, 8358, 15, 15, 34212, 15, 16, 11440, // 15,15 - // angle of 2.0 degrees - 0, -1, 13368, 0, 0, 28495, 1, -1, 10104, 1, 0, 13569, // 0, 0 - 0, 0, 13291, 0, 1, 29828, 1, 0, 9671, 1, 1, 12746, // 0, 1 - 0, 1, 13176, 0, 2, 31138, 1, 1, 9245, 1, 2, 11977, // 0, 2 - 0, 2, 13038, 0, 3, 32391, 1, 2, 8838, 1, 3, 11269, // 0, 3 - 0, 3, 12899, 0, 4, 33539, 1, 3, 8463, 1, 4, 10635, // 0, 4 - 0, 4, 12783, 0, 5, 34532, 1, 4, 8135, 1, 5, 10086, // 0, 5 - 0, 5, 12717, 0, 6, 35315, 1, 5, 7868, 1, 6, 9636, // 0, 6 - 0, 6, 12728, 0, 7, 35844, 1, 6, 7674, 1, 7, 9290, // 0, 7 - -1, 7, 7643, -1, 8, 9224, 0, 7, 12764, 0, 8, 35905, // 0, 8 - -1, 8, 7839, -1, 9, 9558, 0, 8, 12777, 0, 9, 35362, // 0, 9 - -1, 9, 8107, -1, 10, 9995, 0, 9, 12867, 0, 10, 34567, // 0,10 - -1, 10, 8438, -1, 11, 10528, 0, 10, 13007, 0, 11, 33563, // 0,11 - -1, 11, 8816, -1, 12, 11143, 0, 11, 13171, 0, 12, 32406, // 0,12 - -1, 12, 9229, -1, 13, 11829, 0, 12, 13332, 0, 13, 31146, // 0,13 - -1, 13, 9662, -1, 14, 12574, 0, 13, 13470, 0, 14, 29830, // 0,14 - -1, 14, 10104, -1, 15, 13368, 0, 14, 13569, 0, 15, 28495, // 0,15 - 1, -1, 12574, 1, 0, 29831, 2, -1, 9662, 2, 0, 13469, // 1, 0 - 1, 0, 12412, 1, 1, 31358, 2, 0, 9202, 2, 1, 12564, // 1, 1 - 1, 1, 12203, 1, 2, 32881, 2, 1, 8742, 2, 2, 11710, // 1, 2 - 1, 2, 11964, 1, 3, 34358, 2, 2, 8296, 2, 3, 10918, // 1, 3 - 1, 3, 11721, 1, 4, 35730, 2, 3, 7881, 2, 4, 10204, // 1, 4 - 1, 4, 11507, 1, 5, 36926, 2, 4, 7517, 2, 5, 9586, // 1, 5 - 1, 5, 11360, 1, 6, 37866, 2, 5, 7224, 2, 6, 9086, // 1, 6 - 1, 6, 11317, 1, 7, 38481, 2, 6, 7020, 2, 7, 8718, // 1, 7 - 0, 7, 6997, 0, 8, 8662, 1, 7, 11344, 1, 8, 38533, // 1, 8 - 0, 8, 7202, 0, 9, 9020, 1, 8, 11407, 1, 9, 37907, // 1, 9 - 0, 9, 7497, 0, 10, 9509, 1, 9, 11575, 1, 10, 36955, // 1,10 - 0, 10, 7865, 0, 11, 10111, 1, 10, 11810, 1, 11, 35750, // 1,11 - 0, 11, 8284, 0, 12, 10808, 1, 11, 12074, 1, 12, 34370, // 1,12 - 0, 12, 8735, 0, 13, 11580, 1, 12, 12334, 1, 13, 32887, // 1,13 - 0, 13, 9202, 0, 14, 12412, 1, 13, 12564, 1, 14, 31358, // 1,14 - 0, 14, 9671, 0, 15, 13291, 1, 14, 12746, 1, 15, 29828, // 1,15 - 2, -1, 11829, 2, 0, 31146, 3, -1, 9229, 3, 0, 13332, // 2, 0 - 2, 0, 11580, 2, 1, 32886, 3, 0, 8735, 3, 1, 12335, // 2, 1 - 2, 1, 11272, 2, 2, 34650, 3, 1, 8232, 3, 2, 11382, // 2, 2 - 2, 2, 10922, 2, 3, 36392, 3, 2, 7734, 3, 3, 10488, // 2, 3 - 2, 3, 10559, 2, 4, 38042, 3, 3, 7261, 3, 4, 9674, // 2, 4 - 2, 4, 10226, 2, 5, 39503, 3, 4, 6842, 3, 5, 8965, // 2, 5 - 2, 5, 9977, 2, 6, 40656, 3, 5, 6506, 3, 6, 8397, // 2, 6 - 2, 6, 9867, 2, 7, 41389, 3, 6, 6284, 3, 7, 7996, // 2, 7 - 1, 7, 6266, 1, 8, 7951, 2, 7, 9886, 2, 8, 41433, // 2, 8 - 1, 8, 6491, 1, 9, 8344, 2, 8, 10013, 2, 9, 40688, // 2, 9 - 1, 9, 6829, 1, 10, 8902, 2, 9, 10279, 2, 10, 39526, // 2,10 - 1, 10, 7252, 1, 11, 9597, 2, 10, 10630, 2, 11, 38057, // 2,11 - 1, 11, 7728, 1, 12, 10397, 2, 11, 11012, 2, 12, 36399, // 2,12 - 1, 12, 8232, 1, 13, 11272, 2, 12, 11382, 2, 13, 34650, // 2,13 - 1, 13, 8742, 1, 14, 12203, 2, 13, 11709, 2, 14, 32882, // 2,14 - 1, 14, 9245, 1, 15, 13176, 2, 14, 11977, 2, 15, 31138, // 2,15 - 3, -1, 11143, 3, 0, 32406, 4, -1, 8816, 4, 0, 13171, // 3, 0 - 3, 0, 10808, 3, 1, 34369, 4, 0, 8284, 4, 1, 12075, // 3, 1 - 3, 1, 10397, 3, 2, 36399, 4, 1, 7728, 4, 2, 11012, // 3, 2 - 3, 2, 9924, 3, 3, 38450, 4, 2, 7164, 4, 3, 9998, // 3, 3 - 3, 3, 9421, 3, 4, 40444, 4, 3, 6615, 4, 4, 9056, // 3, 4 - 3, 4, 8940, 3, 5, 42256, 4, 4, 6116, 4, 5, 8224, // 3, 5 - 3, 5, 8558, 3, 6, 43710, 4, 5, 5712, 4, 6, 7556, // 3, 6 - 3, 6, 8359, 3, 7, 44616, 4, 6, 5454, 4, 7, 7107, // 3, 7 - 2, 7, 5443, 2, 8, 7072, 3, 7, 8373, 3, 8, 44648, // 3, 8 - 2, 8, 5703, 2, 9, 7516, 3, 8, 8584, 3, 9, 43733, // 3, 9 - 2, 9, 6108, 2, 10, 8175, 3, 9, 8982, 3, 10, 42271, // 3,10 - 2, 10, 6611, 2, 11, 8995, 3, 10, 9478, 3, 11, 40452, // 3,11 - 2, 11, 7164, 2, 12, 9924, 3, 11, 9998, 3, 12, 38450, // 3,12 - 2, 12, 7734, 2, 13, 10922, 3, 12, 10488, 3, 13, 36392, // 3,13 - 2, 13, 8296, 2, 14, 11964, 3, 13, 10918, 3, 14, 34358, // 3,14 - 2, 14, 8838, 2, 15, 13038, 3, 14, 11269, 3, 15, 32391, // 3,15 - 4, -1, 10528, 4, 0, 33564, 5, -1, 8438, 5, 0, 13006, // 4, 0 - 4, 0, 10111, 4, 1, 35750, 5, 0, 7865, 5, 1, 11810, // 4, 1 - 4, 1, 9597, 4, 2, 38057, 5, 1, 7252, 5, 2, 10630, // 4, 2 - 4, 2, 8995, 4, 3, 40452, 5, 2, 6611, 5, 3, 9478, // 4, 3 - 4, 3, 8332, 4, 4, 42861, 5, 3, 5965, 5, 4, 8378, // 4, 4 - 4, 4, 7667, 4, 5, 45139, 5, 4, 5353, 5, 5, 7377, // 4, 5 - 4, 5, 7100, 4, 6, 47035, 5, 5, 4843, 5, 6, 6558, // 4, 6 - 4, 6, 6774, 4, 7, 48218, 5, 6, 4521, 5, 7, 6023, // 4, 7 - 3, 7, 4513, 3, 8, 6000, 4, 7, 6783, 4, 8, 48240, // 4, 8 - 3, 8, 4838, 3, 9, 6530, 4, 8, 7119, 4, 9, 47049, // 4, 9 - 3, 9, 5350, 3, 10, 7342, 4, 9, 7698, 4, 10, 45146, // 4,10 - 3, 10, 5965, 3, 11, 8332, 4, 10, 8378, 4, 11, 42861, // 4,11 - 3, 11, 6615, 3, 12, 9421, 4, 11, 9056, 4, 12, 40444, // 4,12 - 3, 12, 7261, 3, 13, 10559, 4, 12, 9674, 4, 13, 38042, // 4,13 - 3, 13, 7881, 3, 14, 11721, 4, 13, 10204, 4, 14, 35730, // 4,14 - 3, 14, 8463, 3, 15, 12899, 4, 14, 10635, 4, 15, 33539, // 4,15 - 5, -1, 9995, 5, 0, 34567, 6, -1, 8107, 6, 0, 12867, // 5, 0 - 5, 0, 9509, 5, 1, 36955, 6, 0, 7497, 6, 1, 11575, // 5, 1 - 5, 1, 8902, 5, 2, 39526, 6, 1, 6829, 6, 2, 10279, // 5, 2 - 5, 2, 8175, 5, 3, 42271, 6, 2, 6108, 6, 3, 8982, // 5, 3 - 5, 3, 7342, 5, 4, 45146, 6, 3, 5350, 6, 4, 7698, // 5, 4 - 5, 4, 6451, 5, 5, 48019, 6, 4, 4591, 6, 5, 6475, // 5, 5 - 5, 5, 5624, 5, 6, 50581, 6, 5, 3913, 6, 6, 5418, // 5, 6 - 5, 6, 5092, 5, 7, 52253, 6, 6, 3470, 6, 7, 4721, // 5, 7 - 4, 7, 3466, 4, 8, 4708, 5, 7, 5097, 5, 8, 52265, // 5, 8 - 4, 8, 3911, 4, 9, 5400, 5, 8, 5637, 5, 9, 50588, // 5, 9 - 4, 9, 4591, 4, 10, 6451, 5, 9, 6475, 5, 10, 48019, // 5,10 - 4, 10, 5353, 4, 11, 7667, 5, 10, 7377, 5, 11, 45139, // 5,11 - 4, 11, 6116, 4, 12, 8940, 5, 11, 8224, 5, 12, 42256, // 5,12 - 4, 12, 6842, 4, 13, 10226, 5, 12, 8966, 5, 13, 39502, // 5,13 - 4, 13, 7517, 4, 14, 11507, 5, 13, 9587, 5, 14, 36925, // 5,14 - 4, 14, 8135, 4, 15, 12783, 5, 14, 10086, 5, 15, 34532, // 5,15 - 6, -1, 9558, 6, 0, 35362, 7, -1, 7839, 7, 0, 12777, // 6, 0 - 6, 0, 9020, 6, 1, 37906, 7, 0, 7202, 7, 1, 11408, // 6, 1 - 6, 1, 8344, 6, 2, 40688, 7, 1, 6491, 7, 2, 10013, // 6, 2 - 6, 2, 7516, 6, 3, 43733, 7, 2, 5703, 7, 3, 8584, // 6, 3 - 6, 3, 6530, 6, 4, 47049, 7, 3, 4838, 7, 4, 7119, // 6, 4 - 6, 4, 5400, 6, 5, 50587, 7, 4, 3911, 7, 5, 5638, // 6, 5 - 6, 5, 4217, 6, 6, 54105, 7, 5, 2989, 7, 6, 4225, // 6, 6 - 6, 6, 3303, 6, 7, 56751, 7, 6, 2295, 7, 7, 3187, // 6, 7 - 5, 7, 2294, 5, 8, 3180, 6, 7, 3306, 6, 8, 56756, // 6, 8 - 5, 8, 2989, 5, 9, 4217, 6, 8, 4225, 6, 9, 54105, // 6, 9 - 5, 9, 3913, 5, 10, 5624, 6, 9, 5418, 6, 10, 50581, // 6,10 - 5, 10, 4843, 5, 11, 7100, 6, 10, 6558, 6, 11, 47035, // 6,11 - 5, 11, 5712, 5, 12, 8558, 6, 11, 7556, 6, 12, 43710, // 6,12 - 5, 12, 6506, 5, 13, 9977, 6, 12, 8397, 6, 13, 40656, // 6,13 - 5, 13, 7224, 5, 14, 11360, 6, 13, 9086, 6, 14, 37866, // 6,14 - 5, 14, 7868, 5, 15, 12717, 6, 14, 9635, 6, 15, 35316, // 6,15 - 7, -1, 9224, 7, 0, 35905, 8, -1, 7643, 8, 0, 12764, // 7, 0 - 7, 0, 8662, 7, 1, 38534, 8, 0, 6997, 8, 1, 11343, // 7, 1 - 7, 1, 7951, 7, 2, 41432, 8, 1, 6266, 8, 2, 9887, // 7, 2 - 7, 2, 7072, 7, 3, 44649, 8, 2, 5443, 8, 3, 8372, // 7, 3 - 7, 3, 6000, 7, 4, 48240, 8, 3, 4513, 8, 4, 6783, // 7, 4 - 7, 4, 4708, 7, 5, 52266, 8, 4, 3466, 8, 5, 5096, // 7, 5 - 7, 5, 3180, 7, 6, 56756, 8, 5, 2294, 8, 6, 3306, // 7, 6 - 7, 6, 1541, 7, 7, 61364, 8, 6, 1090, 8, 7, 1541, // 7, 7 - 6, 7, 1090, 6, 8, 1541, 7, 7, 1542, 7, 8, 61363, // 7, 8 - 6, 8, 2295, 6, 9, 3303, 7, 8, 3186, 7, 9, 56752, // 7, 9 - 6, 9, 3470, 6, 10, 5092, 7, 9, 4721, 7, 10, 52253, // 7,10 - 6, 10, 4521, 6, 11, 6774, 7, 10, 6023, 7, 11, 48218, // 7,11 - 6, 11, 5454, 6, 12, 8359, 7, 11, 7106, 7, 12, 44617, // 7,12 - 6, 12, 6284, 6, 13, 9867, 7, 12, 7996, 7, 13, 41389, // 7,13 - 6, 13, 7020, 6, 14, 11317, 7, 13, 8718, 7, 14, 38481, // 7,14 - 6, 14, 7674, 6, 15, 12728, 7, 14, 9290, 7, 15, 35844, // 7,15 - 8, 0, 35844, 8, 1, 9290, 9, 0, 12728, 9, 1, 7674, // 8, 0 - 8, 1, 38481, 8, 2, 8718, 9, 1, 11317, 9, 2, 7020, // 8, 1 - 8, 2, 41389, 8, 3, 7996, 9, 2, 9867, 9, 3, 6284, // 8, 2 - 8, 3, 44616, 8, 4, 7106, 9, 3, 8359, 9, 4, 5455, // 8, 3 - 8, 4, 48218, 8, 5, 6023, 9, 4, 6774, 9, 5, 4521, // 8, 4 - 8, 5, 52253, 8, 6, 4721, 9, 5, 5092, 9, 6, 3470, // 8, 5 - 8, 6, 56751, 8, 7, 3186, 9, 6, 3303, 9, 7, 2296, // 8, 6 - 8, 7, 61364, 8, 8, 1542, 9, 7, 1541, 9, 8, 1089, // 8, 7 - 7, 8, 1542, 7, 9, 1090, 8, 8, 61364, 8, 9, 1540, // 8, 8 - 7, 9, 3306, 7, 10, 2294, 8, 9, 56756, 8, 10, 3180, // 8, 9 - 7, 10, 5097, 7, 11, 3466, 8, 10, 52266, 8, 11, 4707, // 8,10 - 7, 11, 6783, 7, 12, 4513, 8, 11, 48240, 8, 12, 6000, // 8,11 - 7, 12, 8373, 7, 13, 5443, 8, 12, 44649, 8, 13, 7071, // 8,12 - 7, 13, 9886, 7, 14, 6266, 8, 13, 41432, 8, 14, 7952, // 8,13 - 7, 14, 11344, 7, 15, 6997, 8, 14, 38534, 8, 15, 8661, // 8,14 - 7, 15, 12764, 7, 16, 7643, 8, 15, 35905, 8, 16, 9224, // 8,15 - 9, 0, 35315, 9, 1, 9635, 10, 0, 12717, 10, 1, 7869, // 9, 0 - 9, 1, 37866, 9, 2, 9086, 10, 1, 11360, 10, 2, 7224, // 9, 1 - 9, 2, 40656, 9, 3, 8397, 10, 2, 9977, 10, 3, 6506, // 9, 2 - 9, 3, 43710, 9, 4, 7556, 10, 3, 8558, 10, 4, 5712, // 9, 3 - 9, 4, 47035, 9, 5, 6558, 10, 4, 7100, 10, 5, 4843, // 9, 4 - 9, 5, 50581, 9, 6, 5418, 10, 5, 5624, 10, 6, 3913, // 9, 5 - 9, 6, 54105, 9, 7, 4225, 10, 6, 4217, 10, 7, 2989, // 9, 6 - 9, 7, 56756, 9, 8, 3306, 10, 7, 3180, 10, 8, 2294, // 9, 7 - 8, 8, 3186, 8, 9, 2295, 9, 8, 56751, 9, 9, 3304, // 9, 8 - 8, 9, 4225, 8, 10, 2989, 9, 9, 54105, 9, 10, 4217, // 9, 9 - 8, 10, 5637, 8, 11, 3911, 9, 10, 50587, 9, 11, 5401, // 9,10 - 8, 11, 7119, 8, 12, 4838, 9, 11, 47049, 9, 12, 6530, // 9,11 - 8, 12, 8584, 8, 13, 5703, 9, 12, 43733, 9, 13, 7516, // 9,12 - 8, 13, 10013, 8, 14, 6491, 9, 13, 40688, 9, 14, 8344, // 9,13 - 8, 14, 11407, 8, 15, 7202, 9, 14, 37906, 9, 15, 9021, // 9,14 - 8, 15, 12777, 8, 16, 7839, 9, 15, 35362, 9, 16, 9558, // 9,15 - 10, 0, 34532, 10, 1, 10086, 11, 0, 12783, 11, 1, 8135, // 10, 0 - 10, 1, 36926, 10, 2, 9587, 11, 1, 11507, 11, 2, 7516, // 10, 1 - 10, 2, 39503, 10, 3, 8966, 11, 2, 10226, 11, 3, 6841, // 10, 2 - 10, 3, 42256, 10, 4, 8224, 11, 3, 8940, 11, 4, 6116, // 10, 3 - 10, 4, 45139, 10, 5, 7377, 11, 4, 7667, 11, 5, 5353, // 10, 4 - 10, 5, 48019, 10, 6, 6475, 11, 5, 6451, 11, 6, 4591, // 10, 5 - 10, 6, 50587, 10, 7, 5637, 11, 6, 5400, 11, 7, 3912, // 10, 6 - 10, 7, 52266, 10, 8, 5097, 11, 7, 4708, 11, 8, 3465, // 10, 7 - 9, 8, 4721, 9, 9, 3470, 10, 8, 52253, 10, 9, 5092, // 10, 8 - 9, 9, 5418, 9, 10, 3913, 10, 9, 50581, 10, 10, 5624, // 10, 9 - 9, 10, 6475, 9, 11, 4591, 10, 10, 48019, 10, 11, 6451, // 10,10 - 9, 11, 7698, 9, 12, 5350, 10, 11, 45146, 10, 12, 7342, // 10,11 - 9, 12, 8982, 9, 13, 6108, 10, 12, 42271, 10, 13, 8175, // 10,12 - 9, 13, 10279, 9, 14, 6829, 10, 13, 39526, 10, 14, 8902, // 10,13 - 9, 14, 11575, 9, 15, 7497, 10, 14, 36955, 10, 15, 9509, // 10,14 - 9, 15, 12867, 9, 16, 8107, 10, 15, 34567, 10, 16, 9995, // 10,15 - 11, 0, 33539, 11, 1, 10635, 12, 0, 12899, 12, 1, 8463, // 11, 0 - 11, 1, 35730, 11, 2, 10204, 12, 1, 11721, 12, 2, 7881, // 11, 1 - 11, 2, 38042, 11, 3, 9674, 12, 2, 10559, 12, 3, 7261, // 11, 2 - 11, 3, 40444, 11, 4, 9056, 12, 3, 9421, 12, 4, 6615, // 11, 3 - 11, 4, 42861, 11, 5, 8378, 12, 4, 8332, 12, 5, 5965, // 11, 4 - 11, 5, 45146, 11, 6, 7698, 12, 5, 7342, 12, 6, 5350, // 11, 5 - 11, 6, 47049, 11, 7, 7119, 12, 6, 6530, 12, 7, 4838, // 11, 6 - 11, 7, 48240, 11, 8, 6783, 12, 7, 6000, 12, 8, 4513, // 11, 7 - 10, 8, 6023, 10, 9, 4521, 11, 8, 48218, 11, 9, 6774, // 11, 8 - 10, 9, 6558, 10, 10, 4843, 11, 9, 47035, 11, 10, 7100, // 11, 9 - 10, 10, 7377, 10, 11, 5353, 11, 10, 45139, 11, 11, 7667, // 11,10 - 10, 11, 8378, 10, 12, 5965, 11, 11, 42861, 11, 12, 8332, // 11,11 - 10, 12, 9478, 10, 13, 6611, 11, 12, 40452, 11, 13, 8995, // 11,12 - 10, 13, 10630, 10, 14, 7252, 11, 13, 38057, 11, 14, 9597, // 11,13 - 10, 14, 11810, 10, 15, 7865, 11, 14, 35750, 11, 15, 10111, // 11,14 - 10, 15, 13007, 10, 16, 8438, 11, 15, 33564, 11, 16, 10527, // 11,15 - 12, 0, 32391, 12, 1, 11269, 13, 0, 13038, 13, 1, 8838, // 12, 0 - 12, 1, 34358, 12, 2, 10918, 13, 1, 11964, 13, 2, 8296, // 12, 1 - 12, 2, 36392, 12, 3, 10488, 13, 2, 10922, 13, 3, 7734, // 12, 2 - 12, 3, 38450, 12, 4, 9998, 13, 3, 9924, 13, 4, 7164, // 12, 3 - 12, 4, 40452, 12, 5, 9478, 13, 4, 8995, 13, 5, 6611, // 12, 4 - 12, 5, 42271, 12, 6, 8982, 13, 5, 8175, 13, 6, 6108, // 12, 5 - 12, 6, 43733, 12, 7, 8584, 13, 6, 7516, 13, 7, 5703, // 12, 6 - 12, 7, 44649, 12, 8, 8373, 13, 7, 7072, 13, 8, 5442, // 12, 7 - 11, 8, 7106, 11, 9, 5454, 12, 8, 44616, 12, 9, 8360, // 12, 8 - 11, 9, 7556, 11, 10, 5712, 12, 9, 43710, 12, 10, 8558, // 12, 9 - 11, 10, 8224, 11, 11, 6116, 12, 10, 42256, 12, 11, 8940, // 12,10 - 11, 11, 9056, 11, 12, 6615, 12, 11, 40444, 12, 12, 9421, // 12,11 - 11, 12, 9998, 11, 13, 7164, 12, 12, 38450, 12, 13, 9924, // 12,12 - 11, 13, 11012, 11, 14, 7728, 12, 13, 36399, 12, 14, 10397, // 12,13 - 11, 14, 12074, 11, 15, 8284, 12, 14, 34369, 12, 15, 10809, // 12,14 - 11, 15, 13171, 11, 16, 8816, 12, 15, 32406, 12, 16, 11143, // 12,15 - 13, 0, 31138, 13, 1, 11977, 14, 0, 13176, 14, 1, 9245, // 13, 0 - 13, 1, 32881, 13, 2, 11709, 14, 1, 12203, 14, 2, 8743, // 13, 1 - 13, 2, 34650, 13, 3, 11382, 14, 2, 11272, 14, 3, 8232, // 13, 2 - 13, 3, 36399, 13, 4, 11012, 14, 3, 10397, 14, 4, 7728, // 13, 3 - 13, 4, 38057, 13, 5, 10630, 14, 4, 9597, 14, 5, 7252, // 13, 4 - 13, 5, 39526, 13, 6, 10279, 14, 5, 8902, 14, 6, 6829, // 13, 5 - 13, 6, 40688, 13, 7, 10013, 14, 6, 8344, 14, 7, 6491, // 13, 6 - 13, 7, 41432, 13, 8, 9886, 14, 7, 7951, 14, 8, 6267, // 13, 7 - 12, 8, 7996, 12, 9, 6284, 13, 8, 41389, 13, 9, 9867, // 13, 8 - 12, 9, 8397, 12, 10, 6506, 13, 9, 40656, 13, 10, 9977, // 13, 9 - 12, 10, 8966, 12, 11, 6842, 13, 10, 39503, 13, 11, 10225, // 13,10 - 12, 11, 9674, 12, 12, 7261, 13, 11, 38042, 13, 12, 10559, // 13,11 - 12, 12, 10488, 12, 13, 7734, 13, 12, 36392, 13, 13, 10922, // 13,12 - 12, 13, 11382, 12, 14, 8232, 13, 13, 34650, 13, 14, 11272, // 13,13 - 12, 14, 12334, 12, 15, 8735, 13, 14, 32886, 13, 15, 11581, // 13,14 - 12, 15, 13332, 12, 16, 9229, 13, 15, 31146, 13, 16, 11829, // 13,15 - 14, 0, 29828, 14, 1, 12746, 15, 0, 13291, 15, 1, 9671, // 14, 0 - 14, 1, 31358, 14, 2, 12564, 15, 1, 12412, 15, 2, 9202, // 14, 1 - 14, 2, 32886, 14, 3, 12334, 15, 2, 11580, 15, 3, 8736, // 14, 2 - 14, 3, 34369, 14, 4, 12074, 15, 3, 10808, 15, 4, 8285, // 14, 3 - 14, 4, 35750, 14, 5, 11810, 15, 4, 10111, 15, 5, 7865, // 14, 4 - 14, 5, 36955, 14, 6, 11575, 15, 5, 9509, 15, 6, 7497, // 14, 5 - 14, 6, 37906, 14, 7, 11407, 15, 6, 9020, 15, 7, 7203, // 14, 6 - 14, 7, 38534, 14, 8, 11344, 15, 7, 8662, 15, 8, 6996, // 14, 7 - 13, 8, 8718, 13, 9, 7020, 14, 8, 38481, 14, 9, 11317, // 14, 8 - 13, 9, 9086, 13, 10, 7224, 14, 9, 37866, 14, 10, 11360, // 14, 9 - 13, 10, 9587, 13, 11, 7517, 14, 10, 36926, 14, 11, 11506, // 14,10 - 13, 11, 10204, 13, 12, 7881, 14, 11, 35730, 14, 12, 11721, // 14,11 - 13, 12, 10918, 13, 13, 8296, 14, 12, 34358, 14, 13, 11964, // 14,12 - 13, 13, 11709, 13, 14, 8742, 14, 13, 32881, 14, 14, 12204, // 14,13 - 13, 14, 12564, 13, 15, 9202, 14, 14, 31358, 14, 15, 12412, // 14,14 - 13, 15, 13470, 13, 16, 9662, 14, 15, 29831, 14, 16, 12573, // 14,15 - 15, 0, 28495, 15, 1, 13569, 16, 0, 13368, 16, 1, 10104, // 15, 0 - 15, 1, 29831, 15, 2, 13470, 16, 1, 12574, 16, 2, 9661, // 15, 1 - 15, 2, 31146, 15, 3, 13332, 16, 2, 11829, 16, 3, 9229, // 15, 2 - 15, 3, 32406, 15, 4, 13171, 16, 3, 11143, 16, 4, 8816, // 15, 3 - 15, 4, 33564, 15, 5, 13007, 16, 4, 10528, 16, 5, 8437, // 15, 4 - 15, 5, 34567, 15, 6, 12867, 16, 5, 9995, 16, 6, 8107, // 15, 5 - 15, 6, 35362, 15, 7, 12777, 16, 6, 9558, 16, 7, 7839, // 15, 6 - 15, 7, 35905, 15, 8, 12764, 16, 7, 9224, 16, 8, 7643, // 15, 7 - 14, 8, 9290, 14, 9, 7674, 15, 8, 35844, 15, 9, 12728, // 15, 8 - 14, 9, 9635, 14, 10, 7868, 15, 9, 35315, 15, 10, 12718, // 15, 9 - 14, 10, 10086, 14, 11, 8135, 15, 10, 34532, 15, 11, 12783, // 15,10 - 14, 11, 10635, 14, 12, 8463, 15, 11, 33539, 15, 12, 12899, // 15,11 - 14, 12, 11269, 14, 13, 8838, 15, 12, 32391, 15, 13, 13038, // 15,12 - 14, 13, 11977, 14, 14, 9245, 15, 13, 31138, 15, 14, 13176, // 15,13 - 14, 14, 12746, 14, 15, 9671, 15, 14, 29828, 15, 15, 13291, // 15,14 - 14, 15, 13569, 14, 16, 10104, 15, 15, 28495, 15, 16, 13368, // 15,15 - // angle of 2.5 degrees - 0, -1, 14696, 0, 0, 24063, 1, -1, 11702, 1, 0, 15075, // 0, 0 - 0, 0, 14872, 0, 1, 25368, 1, 0, 11187, 1, 1, 14109, // 0, 1 - 0, 1, 14990, 0, 2, 26660, 1, 1, 10676, 1, 2, 13210, // 0, 2 - 0, 2, 15060, 0, 3, 27903, 1, 2, 10185, 1, 3, 12388, // 0, 3 - 0, 3, 15100, 0, 4, 29055, 1, 3, 9728, 1, 4, 11653, // 0, 4 - 0, 4, 15135, 0, 5, 30064, 1, 4, 9323, 1, 5, 11014, // 0, 5 - 0, 5, 15193, 0, 6, 30876, 1, 5, 8986, 1, 6, 10481, // 0, 6 - 0, 6, 15301, 0, 7, 31444, 1, 6, 8727, 1, 7, 10064, // 0, 7 - -1, 7, 8669, -1, 8, 9959, 0, 7, 15376, 0, 8, 31532, // 0, 8 - -1, 8, 8927, -1, 9, 10351, 0, 8, 15319, 0, 9, 30939, // 0, 9 - -1, 9, 9265, -1, 10, 10855, 0, 9, 15311, 0, 10, 30105, // 0,10 - -1, 10, 9673, -1, 11, 11461, 0, 10, 15325, 0, 11, 29077, // 0,11 - -1, 11, 10135, -1, 12, 12159, 0, 11, 15330, 0, 12, 27912, // 0,12 - -1, 12, 10637, -1, 13, 12938, 0, 12, 15301, 0, 13, 26660, // 0,13 - -1, 13, 11164, -1, 14, 13787, 0, 13, 15220, 0, 14, 25365, // 0,14 - -1, 14, 11702, -1, 15, 14696, 0, 14, 15076, 0, 15, 24062, // 0,15 - 1, -1, 13787, 1, 0, 25366, 2, -1, 11164, 2, 0, 15219, // 1, 0 - 1, 0, 13853, 1, 1, 26893, 2, 0, 10644, 2, 1, 14146, // 1, 1 - 1, 1, 13850, 1, 2, 28427, 2, 1, 10119, 2, 2, 13140, // 1, 2 - 1, 2, 13789, 1, 3, 29928, 2, 2, 9603, 2, 3, 12216, // 1, 3 - 1, 3, 13694, 1, 4, 31339, 2, 3, 9118, 2, 4, 11385, // 1, 4 - 1, 4, 13600, 1, 5, 32586, 2, 4, 8685, 2, 5, 10665, // 1, 5 - 1, 5, 13548, 1, 6, 33585, 2, 5, 8329, 2, 6, 10074, // 1, 6 - 1, 6, 13582, 1, 7, 34261, 2, 6, 8068, 2, 7, 9625, // 1, 7 - 0, 7, 8024, 0, 8, 9534, 1, 7, 13638, 1, 8, 34340, // 1, 8 - 0, 8, 8286, 0, 9, 9961, 1, 8, 13647, 1, 9, 33642, // 1, 9 - 0, 9, 8645, 0, 10, 10528, 1, 9, 13740, 1, 10, 32623, // 1,10 - 0, 10, 9082, 0, 11, 11218, 1, 10, 13875, 1, 11, 31361, // 1,11 - 0, 11, 9575, 0, 12, 12014, 1, 11, 14009, 1, 12, 29938, // 1,12 - 0, 12, 10102, 0, 13, 12897, 1, 12, 14107, 1, 13, 28430, // 1,13 - 0, 13, 10644, 0, 14, 13853, 1, 13, 14145, 1, 14, 26894, // 1,14 - 0, 14, 11187, 0, 15, 14872, 1, 14, 14109, 1, 15, 25368, // 1,15 - 2, -1, 12938, 2, 0, 26660, 3, -1, 10637, 3, 0, 15301, // 2, 0 - 2, 0, 12897, 2, 1, 28430, 3, 0, 10102, 3, 1, 14107, // 2, 1 - 2, 1, 12769, 2, 2, 30239, 3, 1, 9546, 3, 2, 12982, // 2, 2 - 2, 2, 12569, 2, 3, 32045, 3, 2, 8988, 3, 3, 11934, // 2, 3 - 2, 3, 12323, 2, 4, 33777, 3, 3, 8452, 3, 4, 10984, // 2, 4 - 2, 4, 12079, 2, 5, 35332, 3, 4, 7969, 3, 5, 10156, // 2, 5 - 2, 5, 11897, 2, 6, 36582, 3, 5, 7573, 3, 6, 9484, // 2, 6 - 2, 6, 11842, 2, 7, 37402, 3, 6, 7298, 3, 7, 8994, // 2, 7 - 1, 7, 7266, 1, 8, 8918, 2, 7, 11883, 2, 8, 37469, // 2, 8 - 1, 8, 7543, 1, 9, 9390, 2, 8, 11972, 2, 9, 36631, // 2, 9 - 1, 9, 7943, 1, 10, 10041, 2, 9, 12188, 2, 10, 35364, // 2,10 - 1, 10, 8432, 1, 11, 10842, 2, 10, 12467, 2, 11, 33795, // 2,11 - 1, 11, 8976, 1, 12, 11760, 2, 11, 12747, 2, 12, 32053, // 2,12 - 1, 12, 9546, 1, 13, 12769, 2, 12, 12982, 2, 13, 30239, // 2,13 - 1, 13, 10119, 1, 14, 13850, 2, 13, 13141, 2, 14, 28426, // 2,14 - 1, 14, 10676, 1, 15, 14990, 2, 14, 13211, 2, 15, 26659, // 2,15 - 3, -1, 12159, 3, 0, 27912, 4, -1, 10135, 4, 0, 15330, // 3, 0 - 3, 0, 12014, 3, 1, 29938, 4, 0, 9575, 4, 1, 14009, // 3, 1 - 3, 1, 11760, 3, 2, 32052, 4, 1, 8976, 4, 2, 12748, // 3, 2 - 3, 2, 11411, 3, 3, 34213, 4, 2, 8358, 4, 3, 11554, // 3, 3 - 3, 3, 10995, 3, 4, 36343, 4, 3, 7746, 4, 4, 10452, // 3, 4 - 3, 4, 10569, 3, 5, 38307, 4, 4, 7180, 4, 5, 9480, // 3, 5 - 3, 5, 10221, 3, 6, 39912, 4, 5, 6714, 4, 6, 8689, // 3, 6 - 3, 6, 10051, 3, 7, 40940, 4, 6, 6403, 4, 7, 8142, // 3, 7 - 2, 7, 6381, 2, 8, 8082, 3, 7, 10079, 3, 8, 40994, // 3, 8 - 2, 8, 6695, 2, 9, 8617, 3, 8, 10275, 3, 9, 39949, // 3, 9 - 2, 9, 7165, 2, 10, 9388, 3, 9, 10653, 3, 10, 38330, // 3,10 - 2, 10, 7737, 2, 11, 10337, 3, 10, 11108, 3, 11, 36354, // 3,11 - 2, 11, 8358, 2, 12, 11411, 3, 11, 11554, 3, 12, 34213, // 3,12 - 2, 12, 8988, 2, 13, 12569, 3, 12, 11934, 3, 13, 32045, // 3,13 - 2, 13, 9603, 2, 14, 13789, 3, 13, 12216, 3, 14, 29928, // 3,14 - 2, 14, 10185, 2, 15, 15060, 3, 14, 12388, 3, 15, 27903, // 3,15 - 4, -1, 11461, 4, 0, 29078, 5, -1, 9673, 5, 0, 15324, // 4, 0 - 4, 0, 11218, 4, 1, 31361, 5, 0, 9082, 5, 1, 13875, // 4, 1 - 4, 1, 10842, 4, 2, 33795, 5, 1, 8432, 5, 2, 12467, // 4, 2 - 4, 2, 10337, 4, 3, 36354, 5, 2, 7737, 5, 3, 11108, // 4, 3 - 4, 3, 9730, 4, 4, 38966, 5, 3, 7022, 5, 4, 9818, // 4, 4 - 4, 4, 9081, 4, 5, 41475, 5, 4, 6334, 5, 5, 8646, // 4, 5 - 4, 5, 8507, 4, 6, 43602, 5, 5, 5749, 5, 6, 7678, // 4, 6 - 4, 6, 8177, 4, 7, 44962, 5, 6, 5368, 5, 7, 7029, // 4, 7 - 3, 7, 5354, 3, 8, 6987, 4, 7, 8195, 4, 8, 45000, // 4, 8 - 3, 8, 5739, 3, 9, 7626, 4, 8, 8545, 4, 9, 43626, // 4, 9 - 3, 9, 6328, 3, 10, 8578, 4, 9, 9143, 4, 10, 41487, // 4,10 - 3, 10, 7022, 3, 11, 9730, 4, 10, 9818, 4, 11, 38966, // 4,11 - 3, 11, 7746, 3, 12, 10995, 4, 11, 10452, 4, 12, 36343, // 4,12 - 3, 12, 8452, 3, 13, 12323, 4, 12, 10983, 4, 13, 33778, // 4,13 - 3, 13, 9118, 3, 14, 13694, 4, 13, 11385, 4, 14, 31339, // 4,14 - 3, 14, 9728, 3, 15, 15100, 4, 14, 11652, 4, 15, 29056, // 4,15 - 5, -1, 10855, 5, 0, 30105, 6, -1, 9265, 6, 0, 15311, // 5, 0 - 5, 0, 10528, 5, 1, 32624, 6, 0, 8645, 6, 1, 13739, // 5, 1 - 5, 1, 10041, 5, 2, 35364, 6, 1, 7943, 6, 2, 12188, // 5, 2 - 5, 2, 9388, 5, 3, 38330, 6, 2, 7165, 6, 3, 10653, // 5, 3 - 5, 3, 8578, 5, 4, 41487, 6, 3, 6328, 6, 4, 9143, // 5, 4 - 5, 4, 7659, 5, 5, 44700, 6, 4, 5472, 6, 5, 7705, // 5, 5 - 5, 5, 6768, 5, 6, 47619, 6, 5, 4694, 6, 6, 6455, // 5, 6 - 5, 6, 6183, 5, 7, 49566, 6, 6, 4172, 6, 7, 5615, // 5, 7 - 4, 7, 4164, 4, 8, 5590, 5, 7, 6193, 5, 8, 49589, // 5, 8 - 4, 8, 4690, 4, 9, 6422, 5, 8, 6794, 5, 9, 47630, // 5, 9 - 4, 9, 5472, 4, 10, 7659, 5, 9, 7705, 5, 10, 44700, // 5,10 - 4, 10, 6334, 4, 11, 9081, 5, 10, 8646, 5, 11, 41475, // 5,11 - 4, 11, 7180, 4, 12, 10569, 5, 11, 9479, 5, 12, 38308, // 5,12 - 4, 12, 7969, 4, 13, 12079, 5, 12, 10156, 5, 13, 35332, // 5,13 - 4, 13, 8685, 4, 14, 13600, 5, 13, 10665, 5, 14, 32586, // 5,14 - 4, 14, 9323, 4, 15, 15135, 5, 14, 11013, 5, 15, 30065, // 5,15 - 6, -1, 10351, 6, 0, 30939, 7, -1, 8927, 7, 0, 15319, // 6, 0 - 6, 0, 9961, 6, 1, 33642, 7, 0, 8286, 7, 1, 13647, // 6, 1 - 6, 1, 9390, 6, 2, 36631, 7, 1, 7543, 7, 2, 11972, // 6, 2 - 6, 2, 8617, 6, 3, 39949, 7, 2, 6695, 7, 3, 10275, // 6, 3 - 6, 3, 7626, 6, 4, 43626, 7, 3, 5739, 7, 4, 8545, // 6, 4 - 6, 4, 6422, 6, 5, 47630, 7, 4, 4690, 7, 5, 6794, // 6, 5 - 6, 5, 5099, 6, 6, 51701, 7, 5, 3620, 7, 6, 5116, // 6, 6 - 6, 6, 4044, 6, 7, 54831, 7, 6, 2797, 7, 7, 3864, // 6, 7 - 5, 7, 2795, 5, 8, 3853, 6, 7, 4049, 6, 8, 54839, // 6, 8 - 5, 8, 3620, 5, 9, 5099, 6, 8, 5116, 6, 9, 51701, // 6, 9 - 5, 9, 4694, 5, 10, 6768, 6, 9, 6455, 6, 10, 47619, // 6,10 - 5, 10, 5749, 5, 11, 8507, 6, 10, 7678, 6, 11, 43602, // 6,11 - 5, 11, 6714, 5, 12, 10221, 6, 11, 8690, 6, 12, 39911, // 6,12 - 5, 12, 7573, 5, 13, 11897, 6, 12, 9484, 6, 13, 36582, // 6,13 - 5, 13, 8329, 5, 14, 13548, 6, 13, 10074, 6, 14, 33585, // 6,14 - 5, 14, 8986, 5, 15, 15193, 6, 14, 10482, 6, 15, 30875, // 6,15 - 7, -1, 9959, 7, 0, 31532, 8, -1, 8669, 8, 0, 15376, // 7, 0 - 7, 0, 9534, 7, 1, 34340, 8, 0, 8024, 8, 1, 13638, // 7, 1 - 7, 1, 8918, 7, 2, 37470, 8, 1, 7266, 8, 2, 11882, // 7, 2 - 7, 2, 8082, 7, 3, 40994, 8, 2, 6381, 8, 3, 10079, // 7, 3 - 7, 3, 6987, 7, 4, 44999, 8, 3, 5354, 8, 4, 8196, // 7, 4 - 7, 4, 5590, 7, 5, 49588, 8, 4, 4164, 8, 5, 6194, // 7, 5 - 7, 5, 3853, 7, 6, 54839, 8, 5, 2795, 8, 6, 4049, // 7, 6 - 7, 6, 1903, 7, 7, 60382, 8, 6, 1347, 8, 7, 1904, // 7, 7 - 6, 7, 1347, 6, 8, 1903, 7, 7, 1905, 7, 8, 60381, // 7, 8 - 6, 8, 2797, 6, 9, 4044, 7, 8, 3864, 7, 9, 54831, // 7, 9 - 6, 9, 4172, 6, 10, 6183, 7, 9, 5615, 7, 10, 49566, // 7,10 - 6, 10, 5368, 6, 11, 8177, 7, 10, 7029, 7, 11, 44962, // 7,11 - 6, 11, 6403, 6, 12, 10051, 7, 11, 8141, 7, 12, 40941, // 7,12 - 6, 12, 7298, 6, 13, 11842, 7, 12, 8994, 7, 13, 37402, // 7,13 - 6, 13, 8068, 6, 14, 13582, 7, 13, 9626, 7, 14, 34260, // 7,14 - 6, 14, 8727, 6, 15, 15301, 7, 14, 10065, 7, 15, 31443, // 7,15 - 8, 0, 31444, 8, 1, 10065, 9, 0, 15301, 9, 1, 8726, // 8, 0 - 8, 1, 34261, 8, 2, 9626, 9, 1, 13582, 9, 2, 8067, // 8, 1 - 8, 2, 37402, 8, 3, 8994, 9, 2, 11842, 9, 3, 7298, // 8, 2 - 8, 3, 40940, 8, 4, 8141, 9, 3, 10051, 9, 4, 6404, // 8, 3 - 8, 4, 44962, 8, 5, 7029, 9, 4, 8177, 9, 5, 5368, // 8, 4 - 8, 5, 49566, 8, 6, 5615, 9, 5, 6183, 9, 6, 4172, // 8, 5 - 8, 6, 54831, 8, 7, 3864, 9, 6, 4044, 9, 7, 2797, // 8, 6 - 8, 7, 60382, 8, 8, 1905, 9, 7, 1903, 9, 8, 1346, // 8, 7 - 7, 8, 1905, 7, 9, 1347, 8, 8, 60382, 8, 9, 1902, // 8, 8 - 7, 9, 4049, 7, 10, 2795, 8, 9, 54839, 8, 10, 3853, // 8, 9 - 7, 10, 6193, 7, 11, 4164, 8, 10, 49588, 8, 11, 5591, // 8,10 - 7, 11, 8195, 7, 12, 5354, 8, 11, 44999, 8, 12, 6988, // 8,11 - 7, 12, 10079, 7, 13, 6381, 8, 12, 40994, 8, 13, 8082, // 8,12 - 7, 13, 11883, 7, 14, 7266, 8, 13, 37470, 8, 14, 8917, // 8,13 - 7, 14, 13638, 7, 15, 8024, 8, 14, 34340, 8, 15, 9534, // 8,14 - 7, 15, 15376, 7, 16, 8669, 8, 15, 31532, 8, 16, 9959, // 8,15 - 9, 0, 30876, 9, 1, 10482, 10, 0, 15193, 10, 1, 8985, // 9, 0 - 9, 1, 33585, 9, 2, 10074, 10, 1, 13548, 10, 2, 8329, // 9, 1 - 9, 2, 36582, 9, 3, 9484, 10, 2, 11897, 10, 3, 7573, // 9, 2 - 9, 3, 39912, 9, 4, 8690, 10, 3, 10221, 10, 4, 6713, // 9, 3 - 9, 4, 43602, 9, 5, 7678, 10, 4, 8507, 10, 5, 5749, // 9, 4 - 9, 5, 47619, 9, 6, 6455, 10, 5, 6768, 10, 6, 4694, // 9, 5 - 9, 6, 51701, 9, 7, 5116, 10, 6, 5099, 10, 7, 3620, // 9, 6 - 9, 7, 54839, 9, 8, 4049, 10, 7, 3853, 10, 8, 2795, // 9, 7 - 8, 8, 3864, 8, 9, 2797, 9, 8, 54831, 9, 9, 4044, // 9, 8 - 8, 9, 5116, 8, 10, 3620, 9, 9, 51701, 9, 10, 5099, // 9, 9 - 8, 10, 6794, 8, 11, 4690, 9, 10, 47630, 9, 11, 6422, // 9,10 - 8, 11, 8545, 8, 12, 5739, 9, 11, 43626, 9, 12, 7626, // 9,11 - 8, 12, 10275, 8, 13, 6695, 9, 12, 39949, 9, 13, 8617, // 9,12 - 8, 13, 11972, 8, 14, 7543, 9, 13, 36631, 9, 14, 9390, // 9,13 - 8, 14, 13647, 8, 15, 8286, 9, 14, 33642, 9, 15, 9961, // 9,14 - 8, 15, 15319, 8, 16, 8927, 9, 15, 30939, 9, 16, 10351, // 9,15 - 10, 0, 30064, 10, 1, 11013, 11, 0, 15135, 11, 1, 9324, // 10, 0 - 10, 1, 32586, 10, 2, 10665, 11, 1, 13600, 11, 2, 8685, // 10, 1 - 10, 2, 35332, 10, 3, 10156, 11, 2, 12079, 11, 3, 7969, // 10, 2 - 10, 3, 38307, 10, 4, 9479, 11, 3, 10569, 11, 4, 7181, // 10, 3 - 10, 4, 41475, 10, 5, 8646, 11, 4, 9081, 11, 5, 6334, // 10, 4 - 10, 5, 44700, 10, 6, 7705, 11, 5, 7659, 11, 6, 5472, // 10, 5 - 10, 6, 47630, 10, 7, 6794, 11, 6, 6422, 11, 7, 4690, // 10, 6 - 10, 7, 49588, 10, 8, 6193, 11, 7, 5590, 11, 8, 4165, // 10, 7 - 9, 8, 5615, 9, 9, 4172, 10, 8, 49566, 10, 9, 6183, // 10, 8 - 9, 9, 6455, 9, 10, 4694, 10, 9, 47619, 10, 10, 6768, // 10, 9 - 9, 10, 7705, 9, 11, 5472, 10, 10, 44700, 10, 11, 7659, // 10,10 - 9, 11, 9143, 9, 12, 6328, 10, 11, 41487, 10, 12, 8578, // 10,11 - 9, 12, 10653, 9, 13, 7165, 10, 12, 38330, 10, 13, 9388, // 10,12 - 9, 13, 12188, 9, 14, 7943, 10, 13, 35364, 10, 14, 10041, // 10,13 - 9, 14, 13740, 9, 15, 8645, 10, 14, 32624, 10, 15, 10527, // 10,14 - 9, 15, 15311, 9, 16, 9265, 10, 15, 30105, 10, 16, 10855, // 10,15 - 11, 0, 29055, 11, 1, 11652, 12, 0, 15100, 12, 1, 9729, // 11, 0 - 11, 1, 31339, 11, 2, 11385, 12, 1, 13694, 12, 2, 9118, // 11, 1 - 11, 2, 33777, 11, 3, 10983, 12, 2, 12323, 12, 3, 8453, // 11, 2 - 11, 3, 36343, 11, 4, 10452, 12, 3, 10995, 12, 4, 7746, // 11, 3 - 11, 4, 38966, 11, 5, 9818, 12, 4, 9730, 12, 5, 7022, // 11, 4 - 11, 5, 41487, 11, 6, 9143, 12, 5, 8578, 12, 6, 6328, // 11, 5 - 11, 6, 43626, 11, 7, 8545, 12, 6, 7626, 12, 7, 5739, // 11, 6 - 11, 7, 44999, 11, 8, 8195, 12, 7, 6987, 12, 8, 5355, // 11, 7 - 10, 8, 7029, 10, 9, 5368, 11, 8, 44962, 11, 9, 8177, // 11, 8 - 10, 9, 7678, 10, 10, 5749, 11, 9, 43602, 11, 10, 8507, // 11, 9 - 10, 10, 8646, 10, 11, 6334, 11, 10, 41475, 11, 11, 9081, // 11,10 - 10, 11, 9818, 10, 12, 7022, 11, 11, 38966, 11, 12, 9730, // 11,11 - 10, 12, 11108, 10, 13, 7737, 11, 12, 36354, 11, 13, 10337, // 11,12 - 10, 13, 12467, 10, 14, 8432, 11, 13, 33795, 11, 14, 10842, // 11,13 - 10, 14, 13875, 10, 15, 9082, 11, 14, 31361, 11, 15, 11218, // 11,14 - 10, 15, 15325, 10, 16, 9673, 11, 15, 29078, 11, 16, 11460, // 11,15 - 12, 0, 27903, 12, 1, 12388, 13, 0, 15060, 13, 1, 10185, // 12, 0 - 12, 1, 29928, 12, 2, 12216, 13, 1, 13789, 13, 2, 9603, // 12, 1 - 12, 2, 32045, 12, 3, 11934, 13, 2, 12569, 13, 3, 8988, // 12, 2 - 12, 3, 34213, 12, 4, 11554, 13, 3, 11411, 13, 4, 8358, // 12, 3 - 12, 4, 36354, 12, 5, 11108, 13, 4, 10337, 13, 5, 7737, // 12, 4 - 12, 5, 38330, 12, 6, 10653, 13, 5, 9388, 13, 6, 7165, // 12, 5 - 12, 6, 39949, 12, 7, 10275, 13, 6, 8617, 13, 7, 6695, // 12, 6 - 12, 7, 40994, 12, 8, 10079, 13, 7, 8082, 13, 8, 6381, // 12, 7 - 11, 8, 8141, 11, 9, 6403, 12, 8, 40940, 12, 9, 10052, // 12, 8 - 11, 9, 8690, 11, 10, 6714, 12, 9, 39912, 12, 10, 10220, // 12, 9 - 11, 10, 9479, 11, 11, 7180, 12, 10, 38307, 12, 11, 10570, // 12,10 - 11, 11, 10452, 11, 12, 7746, 12, 11, 36343, 12, 12, 10995, // 12,11 - 11, 12, 11554, 11, 13, 8358, 12, 12, 34213, 12, 13, 11411, // 12,12 - 11, 13, 12747, 11, 14, 8976, 12, 13, 32052, 12, 14, 11761, // 12,13 - 11, 14, 14009, 11, 15, 9575, 12, 14, 29938, 12, 15, 12014, // 12,14 - 11, 15, 15330, 11, 16, 10135, 12, 15, 27912, 12, 16, 12159, // 12,15 - 13, 0, 26660, 13, 1, 13211, 14, 0, 14990, 14, 1, 10675, // 13, 0 - 13, 1, 28427, 13, 2, 13141, 14, 1, 13850, 14, 2, 10118, // 13, 1 - 13, 2, 30239, 13, 3, 12982, 14, 2, 12769, 14, 3, 9546, // 13, 2 - 13, 3, 32052, 13, 4, 12747, 14, 3, 11760, 14, 4, 8977, // 13, 3 - 13, 4, 33795, 13, 5, 12467, 14, 4, 10842, 14, 5, 8432, // 13, 4 - 13, 5, 35364, 13, 6, 12188, 14, 5, 10041, 14, 6, 7943, // 13, 5 - 13, 6, 36631, 13, 7, 11972, 14, 6, 9390, 14, 7, 7543, // 13, 6 - 13, 7, 37470, 13, 8, 11883, 14, 7, 8918, 14, 8, 7265, // 13, 7 - 12, 8, 8994, 12, 9, 7298, 13, 8, 37402, 13, 9, 11842, // 13, 8 - 12, 9, 9484, 12, 10, 7573, 13, 9, 36582, 13, 10, 11897, // 13, 9 - 12, 10, 10156, 12, 11, 7969, 13, 10, 35332, 13, 11, 12079, // 13,10 - 12, 11, 10983, 12, 12, 8452, 13, 11, 33777, 13, 12, 12324, // 13,11 - 12, 12, 11934, 12, 13, 8988, 13, 12, 32045, 13, 13, 12569, // 13,12 - 12, 13, 12982, 12, 14, 9546, 13, 13, 30239, 13, 14, 12769, // 13,13 - 12, 14, 14107, 12, 15, 10102, 13, 14, 28430, 13, 15, 12897, // 13,14 - 12, 15, 15301, 12, 16, 10637, 13, 15, 26660, 13, 16, 12938, // 13,15 - 14, 0, 25368, 14, 1, 14109, 15, 0, 14872, 15, 1, 11187, // 14, 0 - 14, 1, 26893, 14, 2, 14145, 15, 1, 13853, 15, 2, 10645, // 14, 1 - 14, 2, 28430, 14, 3, 14107, 15, 2, 12897, 15, 3, 10102, // 14, 2 - 14, 3, 29938, 14, 4, 14009, 15, 3, 12014, 15, 4, 9575, // 14, 3 - 14, 4, 31361, 14, 5, 13875, 15, 4, 11218, 15, 5, 9082, // 14, 4 - 14, 5, 32624, 14, 6, 13740, 15, 5, 10528, 15, 6, 8644, // 14, 5 - 14, 6, 33642, 14, 7, 13647, 15, 6, 9961, 15, 7, 8286, // 14, 6 - 14, 7, 34340, 14, 8, 13638, 15, 7, 9534, 15, 8, 8024, // 14, 7 - 13, 8, 9626, 13, 9, 8068, 14, 8, 34261, 14, 9, 13581, // 14, 8 - 13, 9, 10074, 13, 10, 8329, 14, 9, 33585, 14, 10, 13548, // 14, 9 - 13, 10, 10665, 13, 11, 8685, 14, 10, 32586, 14, 11, 13600, // 14,10 - 13, 11, 11385, 13, 12, 9118, 14, 11, 31339, 14, 12, 13694, // 14,11 - 13, 12, 12216, 13, 13, 9603, 14, 12, 29928, 14, 13, 13789, // 14,12 - 13, 13, 13141, 13, 14, 10119, 14, 13, 28427, 14, 14, 13849, // 14,13 - 13, 14, 14145, 13, 15, 10644, 14, 14, 26893, 14, 15, 13854, // 14,14 - 13, 15, 15220, 13, 16, 11164, 14, 15, 25366, 14, 16, 13786, // 14,15 - 15, 0, 24063, 15, 1, 15076, 16, 0, 14696, 16, 1, 11701, // 15, 0 - 15, 1, 25366, 15, 2, 15220, 16, 1, 13787, 16, 2, 11163, // 15, 1 - 15, 2, 26660, 15, 3, 15301, 16, 2, 12938, 16, 3, 10637, // 15, 2 - 15, 3, 27912, 15, 4, 15330, 16, 3, 12159, 16, 4, 10135, // 15, 3 - 15, 4, 29078, 15, 5, 15325, 16, 4, 11461, 16, 5, 9672, // 15, 4 - 15, 5, 30105, 15, 6, 15311, 16, 5, 10855, 16, 6, 9265, // 15, 5 - 15, 6, 30939, 15, 7, 15319, 16, 6, 10351, 16, 7, 8927, // 15, 6 - 15, 7, 31532, 15, 8, 15376, 16, 7, 9959, 16, 8, 8669, // 15, 7 - 14, 8, 10065, 14, 9, 8727, 15, 8, 31444, 15, 9, 15300, // 15, 8 - 14, 9, 10482, 14, 10, 8986, 15, 9, 30876, 15, 10, 15192, // 15, 9 - 14, 10, 11013, 14, 11, 9323, 15, 10, 30064, 15, 11, 15136, // 15,10 - 14, 11, 11652, 14, 12, 9728, 15, 11, 29055, 15, 12, 15101, // 15,11 - 14, 12, 12388, 14, 13, 10185, 15, 12, 27903, 15, 13, 15060, // 15,12 - 14, 13, 13211, 14, 14, 10676, 15, 13, 26660, 15, 14, 14989, // 15,13 - 14, 14, 14109, 14, 15, 11187, 15, 14, 25368, 15, 15, 14872, // 15,14 - 14, 15, 15076, 14, 16, 11702, 15, 15, 24063, 15, 16, 14695, // 15,15 +// angle of -2.5 degrees +-1, 0, 14696, -1, 1, 11702, 0, 0, 24063, 0, 1, 15075, // 0, 0 +-1, 1, 13787, -1, 2, 11164, 0, 1, 25366, 0, 2, 15219, // 0, 1 +-1, 2, 12938, -1, 3, 10637, 0, 2, 26660, 0, 3, 15301, // 0, 2 +-1, 3, 12159, -1, 4, 10135, 0, 3, 27912, 0, 4, 15330, // 0, 3 +-1, 4, 11461, -1, 5, 9673, 0, 4, 29078, 0, 5, 15324, // 0, 4 +-1, 5, 10855, -1, 6, 9265, 0, 5, 30105, 0, 6, 15311, // 0, 5 +-1, 6, 10351, -1, 7, 8927, 0, 6, 30939, 0, 7, 15319, // 0, 6 +-1, 7, 9959, -1, 8, 8669, 0, 7, 31532, 0, 8, 15376, // 0, 7 +0, 8, 31444, 0, 9, 15301, 1, 8, 10065, 1, 9, 8726, // 0, 8 +0, 9, 30876, 0, 10, 15193, 1, 9, 10482, 1, 10, 8985, // 0, 9 +0, 10, 30064, 0, 11, 15135, 1, 10, 11013, 1, 11, 9324, // 0,10 +0, 11, 29055, 0, 12, 15100, 1, 11, 11652, 1, 12, 9729, // 0,11 +0, 12, 27903, 0, 13, 15060, 1, 12, 12388, 1, 13, 10185, // 0,12 +0, 13, 26660, 0, 14, 14990, 1, 13, 13211, 1, 14, 10675, // 0,13 +0, 14, 25368, 0, 15, 14872, 1, 14, 14109, 1, 15, 11187, // 0,14 +0, 15, 24063, 0, 16, 14696, 1, 15, 15076, 1, 16, 11701, // 0,15 +0, 0, 14872, 0, 1, 11187, 1, 0, 25368, 1, 1, 14109, // 1, 0 +0, 1, 13853, 0, 2, 10644, 1, 1, 26893, 1, 2, 14146, // 1, 1 +0, 2, 12897, 0, 3, 10102, 1, 2, 28430, 1, 3, 14107, // 1, 2 +0, 3, 12014, 0, 4, 9575, 1, 3, 29938, 1, 4, 14009, // 1, 3 +0, 4, 11218, 0, 5, 9082, 1, 4, 31361, 1, 5, 13875, // 1, 4 +0, 5, 10528, 0, 6, 8645, 1, 5, 32624, 1, 6, 13739, // 1, 5 +0, 6, 9961, 0, 7, 8286, 1, 6, 33642, 1, 7, 13647, // 1, 6 +0, 7, 9534, 0, 8, 8024, 1, 7, 34340, 1, 8, 13638, // 1, 7 +1, 8, 34261, 1, 9, 13582, 2, 8, 9626, 2, 9, 8067, // 1, 8 +1, 9, 33585, 1, 10, 13548, 2, 9, 10074, 2, 10, 8329, // 1, 9 +1, 10, 32586, 1, 11, 13600, 2, 10, 10665, 2, 11, 8685, // 1,10 +1, 11, 31339, 1, 12, 13694, 2, 11, 11385, 2, 12, 9118, // 1,11 +1, 12, 29928, 1, 13, 13789, 2, 12, 12216, 2, 13, 9603, // 1,12 +1, 13, 28427, 1, 14, 13850, 2, 13, 13141, 2, 14, 10118, // 1,13 +1, 14, 26893, 1, 15, 13853, 2, 14, 14145, 2, 15, 10645, // 1,14 +1, 15, 25366, 1, 16, 13787, 2, 15, 15220, 2, 16, 11163, // 1,15 +1, 0, 14990, 1, 1, 10676, 2, 0, 26660, 2, 1, 13210, // 2, 0 +1, 1, 13850, 1, 2, 10119, 2, 1, 28427, 2, 2, 13140, // 2, 1 +1, 2, 12769, 1, 3, 9546, 2, 2, 30239, 2, 3, 12982, // 2, 2 +1, 3, 11760, 1, 4, 8976, 2, 3, 32052, 2, 4, 12748, // 2, 3 +1, 4, 10842, 1, 5, 8432, 2, 4, 33795, 2, 5, 12467, // 2, 4 +1, 5, 10041, 1, 6, 7943, 2, 5, 35364, 2, 6, 12188, // 2, 5 +1, 6, 9390, 1, 7, 7543, 2, 6, 36631, 2, 7, 11972, // 2, 6 +1, 7, 8918, 1, 8, 7266, 2, 7, 37470, 2, 8, 11882, // 2, 7 +2, 8, 37402, 2, 9, 11842, 3, 8, 8994, 3, 9, 7298, // 2, 8 +2, 9, 36582, 2, 10, 11897, 3, 9, 9484, 3, 10, 7573, // 2, 9 +2, 10, 35332, 2, 11, 12079, 3, 10, 10156, 3, 11, 7969, // 2,10 +2, 11, 33777, 2, 12, 12323, 3, 11, 10983, 3, 12, 8453, // 2,11 +2, 12, 32045, 2, 13, 12569, 3, 12, 11934, 3, 13, 8988, // 2,12 +2, 13, 30239, 2, 14, 12769, 3, 13, 12982, 3, 14, 9546, // 2,13 +2, 14, 28430, 2, 15, 12897, 3, 14, 14107, 3, 15, 10102, // 2,14 +2, 15, 26660, 2, 16, 12938, 3, 15, 15301, 3, 16, 10637, // 2,15 +2, 0, 15060, 2, 1, 10185, 3, 0, 27903, 3, 1, 12388, // 3, 0 +2, 1, 13789, 2, 2, 9603, 3, 1, 29928, 3, 2, 12216, // 3, 1 +2, 2, 12569, 2, 3, 8988, 3, 2, 32045, 3, 3, 11934, // 3, 2 +2, 3, 11411, 2, 4, 8358, 3, 3, 34213, 3, 4, 11554, // 3, 3 +2, 4, 10337, 2, 5, 7737, 3, 4, 36354, 3, 5, 11108, // 3, 4 +2, 5, 9388, 2, 6, 7165, 3, 5, 38330, 3, 6, 10653, // 3, 5 +2, 6, 8617, 2, 7, 6695, 3, 6, 39949, 3, 7, 10275, // 3, 6 +2, 7, 8082, 2, 8, 6381, 3, 7, 40994, 3, 8, 10079, // 3, 7 +3, 8, 40940, 3, 9, 10051, 4, 8, 8141, 4, 9, 6404, // 3, 8 +3, 9, 39912, 3, 10, 10221, 4, 9, 8690, 4, 10, 6713, // 3, 9 +3, 10, 38307, 3, 11, 10569, 4, 10, 9479, 4, 11, 7181, // 3,10 +3, 11, 36343, 3, 12, 10995, 4, 11, 10452, 4, 12, 7746, // 3,11 +3, 12, 34213, 3, 13, 11411, 4, 12, 11554, 4, 13, 8358, // 3,12 +3, 13, 32052, 3, 14, 11760, 4, 13, 12747, 4, 14, 8977, // 3,13 +3, 14, 29938, 3, 15, 12014, 4, 14, 14009, 4, 15, 9575, // 3,14 +3, 15, 27912, 3, 16, 12159, 4, 15, 15330, 4, 16, 10135, // 3,15 +3, 0, 15100, 3, 1, 9728, 4, 0, 29055, 4, 1, 11653, // 4, 0 +3, 1, 13694, 3, 2, 9118, 4, 1, 31339, 4, 2, 11385, // 4, 1 +3, 2, 12323, 3, 3, 8452, 4, 2, 33777, 4, 3, 10984, // 4, 2 +3, 3, 10995, 3, 4, 7746, 4, 3, 36343, 4, 4, 10452, // 4, 3 +3, 4, 9730, 3, 5, 7022, 4, 4, 38966, 4, 5, 9818, // 4, 4 +3, 5, 8578, 3, 6, 6328, 4, 5, 41487, 4, 6, 9143, // 4, 5 +3, 6, 7626, 3, 7, 5739, 4, 6, 43626, 4, 7, 8545, // 4, 6 +3, 7, 6987, 3, 8, 5354, 4, 7, 44999, 4, 8, 8196, // 4, 7 +4, 8, 44962, 4, 9, 8177, 5, 8, 7029, 5, 9, 5368, // 4, 8 +4, 9, 43602, 4, 10, 8507, 5, 9, 7678, 5, 10, 5749, // 4, 9 +4, 10, 41475, 4, 11, 9081, 5, 10, 8646, 5, 11, 6334, // 4,10 +4, 11, 38966, 4, 12, 9730, 5, 11, 9818, 5, 12, 7022, // 4,11 +4, 12, 36354, 4, 13, 10337, 5, 12, 11108, 5, 13, 7737, // 4,12 +4, 13, 33795, 4, 14, 10842, 5, 13, 12467, 5, 14, 8432, // 4,13 +4, 14, 31361, 4, 15, 11218, 5, 14, 13875, 5, 15, 9082, // 4,14 +4, 15, 29078, 4, 16, 11461, 5, 15, 15325, 5, 16, 9672, // 4,15 +4, 0, 15135, 4, 1, 9323, 5, 0, 30064, 5, 1, 11014, // 5, 0 +4, 1, 13600, 4, 2, 8685, 5, 1, 32586, 5, 2, 10665, // 5, 1 +4, 2, 12079, 4, 3, 7969, 5, 2, 35332, 5, 3, 10156, // 5, 2 +4, 3, 10569, 4, 4, 7180, 5, 3, 38307, 5, 4, 9480, // 5, 3 +4, 4, 9081, 4, 5, 6334, 5, 4, 41475, 5, 5, 8646, // 5, 4 +4, 5, 7659, 4, 6, 5472, 5, 5, 44700, 5, 6, 7705, // 5, 5 +4, 6, 6422, 4, 7, 4690, 5, 6, 47630, 5, 7, 6794, // 5, 6 +4, 7, 5590, 4, 8, 4164, 5, 7, 49588, 5, 8, 6194, // 5, 7 +5, 8, 49566, 5, 9, 6183, 6, 8, 5615, 6, 9, 4172, // 5, 8 +5, 9, 47619, 5, 10, 6768, 6, 9, 6455, 6, 10, 4694, // 5, 9 +5, 10, 44700, 5, 11, 7659, 6, 10, 7705, 6, 11, 5472, // 5,10 +5, 11, 41487, 5, 12, 8578, 6, 11, 9143, 6, 12, 6328, // 5,11 +5, 12, 38330, 5, 13, 9388, 6, 12, 10653, 6, 13, 7165, // 5,12 +5, 13, 35364, 5, 14, 10041, 6, 13, 12188, 6, 14, 7943, // 5,13 +5, 14, 32624, 5, 15, 10528, 6, 14, 13740, 6, 15, 8644, // 5,14 +5, 15, 30105, 5, 16, 10855, 6, 15, 15311, 6, 16, 9265, // 5,15 +5, 0, 15193, 5, 1, 8986, 6, 0, 30876, 6, 1, 10481, // 6, 0 +5, 1, 13548, 5, 2, 8329, 6, 1, 33585, 6, 2, 10074, // 6, 1 +5, 2, 11897, 5, 3, 7573, 6, 2, 36582, 6, 3, 9484, // 6, 2 +5, 3, 10221, 5, 4, 6714, 6, 3, 39912, 6, 4, 8689, // 6, 3 +5, 4, 8507, 5, 5, 5749, 6, 4, 43602, 6, 5, 7678, // 6, 4 +5, 5, 6768, 5, 6, 4694, 6, 5, 47619, 6, 6, 6455, // 6, 5 +5, 6, 5099, 5, 7, 3620, 6, 6, 51701, 6, 7, 5116, // 6, 6 +5, 7, 3853, 5, 8, 2795, 6, 7, 54839, 6, 8, 4049, // 6, 7 +6, 8, 54831, 6, 9, 4044, 7, 8, 3864, 7, 9, 2797, // 6, 8 +6, 9, 51701, 6, 10, 5099, 7, 9, 5116, 7, 10, 3620, // 6, 9 +6, 10, 47630, 6, 11, 6422, 7, 10, 6794, 7, 11, 4690, // 6,10 +6, 11, 43626, 6, 12, 7626, 7, 11, 8545, 7, 12, 5739, // 6,11 +6, 12, 39949, 6, 13, 8617, 7, 12, 10275, 7, 13, 6695, // 6,12 +6, 13, 36631, 6, 14, 9390, 7, 13, 11972, 7, 14, 7543, // 6,13 +6, 14, 33642, 6, 15, 9961, 7, 14, 13647, 7, 15, 8286, // 6,14 +6, 15, 30939, 6, 16, 10351, 7, 15, 15319, 7, 16, 8927, // 6,15 +6, 0, 15301, 6, 1, 8727, 7, 0, 31444, 7, 1, 10064, // 7, 0 +6, 1, 13582, 6, 2, 8068, 7, 1, 34261, 7, 2, 9625, // 7, 1 +6, 2, 11842, 6, 3, 7298, 7, 2, 37402, 7, 3, 8994, // 7, 2 +6, 3, 10051, 6, 4, 6403, 7, 3, 40940, 7, 4, 8142, // 7, 3 +6, 4, 8177, 6, 5, 5368, 7, 4, 44962, 7, 5, 7029, // 7, 4 +6, 5, 6183, 6, 6, 4172, 7, 5, 49566, 7, 6, 5615, // 7, 5 +6, 6, 4044, 6, 7, 2797, 7, 6, 54831, 7, 7, 3864, // 7, 6 +6, 7, 1903, 6, 8, 1347, 7, 7, 60382, 7, 8, 1904, // 7, 7 +7, 8, 60382, 7, 9, 1903, 8, 8, 1905, 8, 9, 1346, // 7, 8 +7, 9, 54839, 7, 10, 3853, 8, 9, 4049, 8, 10, 2795, // 7, 9 +7, 10, 49588, 7, 11, 5590, 8, 10, 6193, 8, 11, 4165, // 7,10 +7, 11, 44999, 7, 12, 6987, 8, 11, 8195, 8, 12, 5355, // 7,11 +7, 12, 40994, 7, 13, 8082, 8, 12, 10079, 8, 13, 6381, // 7,12 +7, 13, 37470, 7, 14, 8918, 8, 13, 11883, 8, 14, 7265, // 7,13 +7, 14, 34340, 7, 15, 9534, 8, 14, 13638, 8, 15, 8024, // 7,14 +7, 15, 31532, 7, 16, 9959, 8, 15, 15376, 8, 16, 8669, // 7,15 +7, -1, 8669, 7, 0, 15376, 8, -1, 9959, 8, 0, 31532, // 8, 0 +7, 0, 8024, 7, 1, 13638, 8, 0, 9534, 8, 1, 34340, // 8, 1 +7, 1, 7266, 7, 2, 11883, 8, 1, 8918, 8, 2, 37469, // 8, 2 +7, 2, 6381, 7, 3, 10079, 8, 2, 8082, 8, 3, 40994, // 8, 3 +7, 3, 5354, 7, 4, 8195, 8, 3, 6987, 8, 4, 45000, // 8, 4 +7, 4, 4164, 7, 5, 6193, 8, 4, 5590, 8, 5, 49589, // 8, 5 +7, 5, 2795, 7, 6, 4049, 8, 5, 3853, 8, 6, 54839, // 8, 6 +7, 6, 1347, 7, 7, 1905, 8, 6, 1903, 8, 7, 60381, // 8, 7 +8, 7, 1905, 8, 8, 60382, 9, 7, 1347, 9, 8, 1902, // 8, 8 +8, 8, 3864, 8, 9, 54831, 9, 8, 2797, 9, 9, 4044, // 8, 9 +8, 9, 5615, 8, 10, 49566, 9, 9, 4172, 9, 10, 6183, // 8,10 +8, 10, 7029, 8, 11, 44962, 9, 10, 5368, 9, 11, 8177, // 8,11 +8, 11, 8141, 8, 12, 40940, 9, 11, 6403, 9, 12, 10052, // 8,12 +8, 12, 8994, 8, 13, 37402, 9, 12, 7298, 9, 13, 11842, // 8,13 +8, 13, 9626, 8, 14, 34261, 9, 13, 8068, 9, 14, 13581, // 8,14 +8, 14, 10065, 8, 15, 31444, 9, 14, 8727, 9, 15, 15300, // 8,15 +8, -1, 8927, 8, 0, 15319, 9, -1, 10351, 9, 0, 30939, // 9, 0 +8, 0, 8286, 8, 1, 13647, 9, 0, 9961, 9, 1, 33642, // 9, 1 +8, 1, 7543, 8, 2, 11972, 9, 1, 9390, 9, 2, 36631, // 9, 2 +8, 2, 6695, 8, 3, 10275, 9, 2, 8617, 9, 3, 39949, // 9, 3 +8, 3, 5739, 8, 4, 8545, 9, 3, 7626, 9, 4, 43626, // 9, 4 +8, 4, 4690, 8, 5, 6794, 9, 4, 6422, 9, 5, 47630, // 9, 5 +8, 5, 3620, 8, 6, 5116, 9, 5, 5099, 9, 6, 51701, // 9, 6 +8, 6, 2797, 8, 7, 3864, 9, 6, 4044, 9, 7, 54831, // 9, 7 +9, 7, 4049, 9, 8, 54839, 10, 7, 2795, 10, 8, 3853, // 9, 8 +9, 8, 5116, 9, 9, 51701, 10, 8, 3620, 10, 9, 5099, // 9, 9 +9, 9, 6455, 9, 10, 47619, 10, 9, 4694, 10, 10, 6768, // 9,10 +9, 10, 7678, 9, 11, 43602, 10, 10, 5749, 10, 11, 8507, // 9,11 +9, 11, 8690, 9, 12, 39912, 10, 11, 6714, 10, 12, 10220, // 9,12 +9, 12, 9484, 9, 13, 36582, 10, 12, 7573, 10, 13, 11897, // 9,13 +9, 13, 10074, 9, 14, 33585, 10, 13, 8329, 10, 14, 13548, // 9,14 +9, 14, 10482, 9, 15, 30876, 10, 14, 8986, 10, 15, 15192, // 9,15 +9, -1, 9265, 9, 0, 15311, 10, -1, 10855, 10, 0, 30105, // 10, 0 +9, 0, 8645, 9, 1, 13740, 10, 0, 10528, 10, 1, 32623, // 10, 1 +9, 1, 7943, 9, 2, 12188, 10, 1, 10041, 10, 2, 35364, // 10, 2 +9, 2, 7165, 9, 3, 10653, 10, 2, 9388, 10, 3, 38330, // 10, 3 +9, 3, 6328, 9, 4, 9143, 10, 3, 8578, 10, 4, 41487, // 10, 4 +9, 4, 5472, 9, 5, 7705, 10, 4, 7659, 10, 5, 44700, // 10, 5 +9, 5, 4694, 9, 6, 6455, 10, 5, 6768, 10, 6, 47619, // 10, 6 +9, 6, 4172, 9, 7, 5615, 10, 6, 6183, 10, 7, 49566, // 10, 7 +10, 7, 6193, 10, 8, 49588, 11, 7, 4164, 11, 8, 5591, // 10, 8 +10, 8, 6794, 10, 9, 47630, 11, 8, 4690, 11, 9, 6422, // 10, 9 +10, 9, 7705, 10, 10, 44700, 11, 9, 5472, 11, 10, 7659, // 10,10 +10, 10, 8646, 10, 11, 41475, 11, 10, 6334, 11, 11, 9081, // 10,11 +10, 11, 9479, 10, 12, 38307, 11, 11, 7180, 11, 12, 10570, // 10,12 +10, 12, 10156, 10, 13, 35332, 11, 12, 7969, 11, 13, 12079, // 10,13 +10, 13, 10665, 10, 14, 32586, 11, 13, 8685, 11, 14, 13600, // 10,14 +10, 14, 11013, 10, 15, 30064, 11, 14, 9323, 11, 15, 15136, // 10,15 +10, -1, 9673, 10, 0, 15325, 11, -1, 11461, 11, 0, 29077, // 11, 0 +10, 0, 9082, 10, 1, 13875, 11, 0, 11218, 11, 1, 31361, // 11, 1 +10, 1, 8432, 10, 2, 12467, 11, 1, 10842, 11, 2, 33795, // 11, 2 +10, 2, 7737, 10, 3, 11108, 11, 2, 10337, 11, 3, 36354, // 11, 3 +10, 3, 7022, 10, 4, 9818, 11, 3, 9730, 11, 4, 38966, // 11, 4 +10, 4, 6334, 10, 5, 8646, 11, 4, 9081, 11, 5, 41475, // 11, 5 +10, 5, 5749, 10, 6, 7678, 11, 5, 8507, 11, 6, 43602, // 11, 6 +10, 6, 5368, 10, 7, 7029, 11, 6, 8177, 11, 7, 44962, // 11, 7 +11, 7, 8195, 11, 8, 44999, 12, 7, 5354, 12, 8, 6988, // 11, 8 +11, 8, 8545, 11, 9, 43626, 12, 8, 5739, 12, 9, 7626, // 11, 9 +11, 9, 9143, 11, 10, 41487, 12, 9, 6328, 12, 10, 8578, // 11,10 +11, 10, 9818, 11, 11, 38966, 12, 10, 7022, 12, 11, 9730, // 11,11 +11, 11, 10452, 11, 12, 36343, 12, 11, 7746, 12, 12, 10995, // 11,12 +11, 12, 10983, 11, 13, 33777, 12, 12, 8452, 12, 13, 12324, // 11,13 +11, 13, 11385, 11, 14, 31339, 12, 13, 9118, 12, 14, 13694, // 11,14 +11, 14, 11652, 11, 15, 29055, 12, 14, 9728, 12, 15, 15101, // 11,15 +11, -1, 10135, 11, 0, 15330, 12, -1, 12159, 12, 0, 27912, // 12, 0 +11, 0, 9575, 11, 1, 14009, 12, 0, 12014, 12, 1, 29938, // 12, 1 +11, 1, 8976, 11, 2, 12747, 12, 1, 11760, 12, 2, 32053, // 12, 2 +11, 2, 8358, 11, 3, 11554, 12, 2, 11411, 12, 3, 34213, // 12, 3 +11, 3, 7746, 11, 4, 10452, 12, 3, 10995, 12, 4, 36343, // 12, 4 +11, 4, 7180, 11, 5, 9479, 12, 4, 10569, 12, 5, 38308, // 12, 5 +11, 5, 6714, 11, 6, 8690, 12, 5, 10221, 12, 6, 39911, // 12, 6 +11, 6, 6403, 11, 7, 8141, 12, 6, 10051, 12, 7, 40941, // 12, 7 +12, 7, 10079, 12, 8, 40994, 13, 7, 6381, 13, 8, 8082, // 12, 8 +12, 8, 10275, 12, 9, 39949, 13, 8, 6695, 13, 9, 8617, // 12, 9 +12, 9, 10653, 12, 10, 38330, 13, 9, 7165, 13, 10, 9388, // 12,10 +12, 10, 11108, 12, 11, 36354, 13, 10, 7737, 13, 11, 10337, // 12,11 +12, 11, 11554, 12, 12, 34213, 13, 11, 8358, 13, 12, 11411, // 12,12 +12, 12, 11934, 12, 13, 32045, 13, 12, 8988, 13, 13, 12569, // 12,13 +12, 13, 12216, 12, 14, 29928, 13, 13, 9603, 13, 14, 13789, // 12,14 +12, 14, 12388, 12, 15, 27903, 13, 14, 10185, 13, 15, 15060, // 12,15 +12, -1, 10637, 12, 0, 15301, 13, -1, 12938, 13, 0, 26660, // 13, 0 +12, 0, 10102, 12, 1, 14107, 13, 0, 12897, 13, 1, 28430, // 13, 1 +12, 1, 9546, 12, 2, 12982, 13, 1, 12769, 13, 2, 30239, // 13, 2 +12, 2, 8988, 12, 3, 11934, 13, 2, 12569, 13, 3, 32045, // 13, 3 +12, 3, 8452, 12, 4, 10983, 13, 3, 12323, 13, 4, 33778, // 13, 4 +12, 4, 7969, 12, 5, 10156, 13, 4, 12079, 13, 5, 35332, // 13, 5 +12, 5, 7573, 12, 6, 9484, 13, 5, 11897, 13, 6, 36582, // 13, 6 +12, 6, 7298, 12, 7, 8994, 13, 6, 11842, 13, 7, 37402, // 13, 7 +13, 7, 11883, 13, 8, 37470, 14, 7, 7266, 14, 8, 8917, // 13, 8 +13, 8, 11972, 13, 9, 36631, 14, 8, 7543, 14, 9, 9390, // 13, 9 +13, 9, 12188, 13, 10, 35364, 14, 9, 7943, 14, 10, 10041, // 13,10 +13, 10, 12467, 13, 11, 33795, 14, 10, 8432, 14, 11, 10842, // 13,11 +13, 11, 12747, 13, 12, 32052, 14, 11, 8976, 14, 12, 11761, // 13,12 +13, 12, 12982, 13, 13, 30239, 14, 12, 9546, 14, 13, 12769, // 13,13 +13, 13, 13141, 13, 14, 28427, 14, 13, 10119, 14, 14, 13849, // 13,14 +13, 14, 13211, 13, 15, 26660, 14, 14, 10676, 14, 15, 14989, // 13,15 +13, -1, 11164, 13, 0, 15220, 14, -1, 13787, 14, 0, 25365, // 14, 0 +13, 0, 10644, 13, 1, 14145, 14, 0, 13853, 14, 1, 26894, // 14, 1 +13, 1, 10119, 13, 2, 13141, 14, 1, 13850, 14, 2, 28426, // 14, 2 +13, 2, 9603, 13, 3, 12216, 14, 2, 13789, 14, 3, 29928, // 14, 3 +13, 3, 9118, 13, 4, 11385, 14, 3, 13694, 14, 4, 31339, // 14, 4 +13, 4, 8685, 13, 5, 10665, 14, 4, 13600, 14, 5, 32586, // 14, 5 +13, 5, 8329, 13, 6, 10074, 14, 5, 13548, 14, 6, 33585, // 14, 6 +13, 6, 8068, 13, 7, 9626, 14, 6, 13582, 14, 7, 34260, // 14, 7 +14, 7, 13638, 14, 8, 34340, 15, 7, 8024, 15, 8, 9534, // 14, 8 +14, 8, 13647, 14, 9, 33642, 15, 8, 8286, 15, 9, 9961, // 14, 9 +14, 9, 13740, 14, 10, 32624, 15, 9, 8645, 15, 10, 10527, // 14,10 +14, 10, 13875, 14, 11, 31361, 15, 10, 9082, 15, 11, 11218, // 14,11 +14, 11, 14009, 14, 12, 29938, 15, 11, 9575, 15, 12, 12014, // 14,12 +14, 12, 14107, 14, 13, 28430, 15, 12, 10102, 15, 13, 12897, // 14,13 +14, 13, 14145, 14, 14, 26893, 15, 13, 10644, 15, 14, 13854, // 14,14 +14, 14, 14109, 14, 15, 25368, 15, 14, 11187, 15, 15, 14872, // 14,15 +14, -1, 11702, 14, 0, 15076, 15, -1, 14696, 15, 0, 24062, // 15, 0 +14, 0, 11187, 14, 1, 14109, 15, 0, 14872, 15, 1, 25368, // 15, 1 +14, 1, 10676, 14, 2, 13211, 15, 1, 14990, 15, 2, 26659, // 15, 2 +14, 2, 10185, 14, 3, 12388, 15, 2, 15060, 15, 3, 27903, // 15, 3 +14, 3, 9728, 14, 4, 11652, 15, 3, 15100, 15, 4, 29056, // 15, 4 +14, 4, 9323, 14, 5, 11013, 15, 4, 15135, 15, 5, 30065, // 15, 5 +14, 5, 8986, 14, 6, 10482, 15, 5, 15193, 15, 6, 30875, // 15, 6 +14, 6, 8727, 14, 7, 10065, 15, 6, 15301, 15, 7, 31443, // 15, 7 +15, 7, 15376, 15, 8, 31532, 16, 7, 8669, 16, 8, 9959, // 15, 8 +15, 8, 15319, 15, 9, 30939, 16, 8, 8927, 16, 9, 10351, // 15, 9 +15, 9, 15311, 15, 10, 30105, 16, 9, 9265, 16, 10, 10855, // 15,10 +15, 10, 15325, 15, 11, 29078, 16, 10, 9673, 16, 11, 11460, // 15,11 +15, 11, 15330, 15, 12, 27912, 16, 11, 10135, 16, 12, 12159, // 15,12 +15, 12, 15301, 15, 13, 26660, 16, 12, 10637, 16, 13, 12938, // 15,13 +15, 13, 15220, 15, 14, 25366, 16, 13, 11164, 16, 14, 13786, // 15,14 +15, 14, 15076, 15, 15, 24063, 16, 14, 11702, 16, 15, 14695, // 15,15 +// angle of -2.0 degrees +-1, 0, 13368, -1, 1, 10104, 0, 0, 28495, 0, 1, 13569, // 0, 0 +-1, 1, 12574, -1, 2, 9662, 0, 1, 29831, 0, 2, 13469, // 0, 1 +-1, 2, 11829, -1, 3, 9229, 0, 2, 31146, 0, 3, 13332, // 0, 2 +-1, 3, 11143, -1, 4, 8816, 0, 3, 32406, 0, 4, 13171, // 0, 3 +-1, 4, 10528, -1, 5, 8438, 0, 4, 33564, 0, 5, 13006, // 0, 4 +-1, 5, 9995, -1, 6, 8107, 0, 5, 34567, 0, 6, 12867, // 0, 5 +-1, 6, 9558, -1, 7, 7839, 0, 6, 35362, 0, 7, 12777, // 0, 6 +-1, 7, 9224, -1, 8, 7643, 0, 7, 35905, 0, 8, 12764, // 0, 7 +0, 8, 35844, 0, 9, 12728, 1, 8, 9290, 1, 9, 7674, // 0, 8 +0, 9, 35315, 0, 10, 12717, 1, 9, 9635, 1, 10, 7869, // 0, 9 +0, 10, 34532, 0, 11, 12783, 1, 10, 10086, 1, 11, 8135, // 0,10 +0, 11, 33539, 0, 12, 12899, 1, 11, 10635, 1, 12, 8463, // 0,11 +0, 12, 32391, 0, 13, 13038, 1, 12, 11269, 1, 13, 8838, // 0,12 +0, 13, 31138, 0, 14, 13176, 1, 13, 11977, 1, 14, 9245, // 0,13 +0, 14, 29828, 0, 15, 13291, 1, 14, 12746, 1, 15, 9671, // 0,14 +0, 15, 28495, 0, 16, 13368, 1, 15, 13569, 1, 16, 10104, // 0,15 +0, 0, 13291, 0, 1, 9671, 1, 0, 29828, 1, 1, 12746, // 1, 0 +0, 1, 12412, 0, 2, 9202, 1, 1, 31358, 1, 2, 12564, // 1, 1 +0, 2, 11580, 0, 3, 8735, 1, 2, 32886, 1, 3, 12335, // 1, 2 +0, 3, 10808, 0, 4, 8284, 1, 3, 34369, 1, 4, 12075, // 1, 3 +0, 4, 10111, 0, 5, 7865, 1, 4, 35750, 1, 5, 11810, // 1, 4 +0, 5, 9509, 0, 6, 7497, 1, 5, 36955, 1, 6, 11575, // 1, 5 +0, 6, 9020, 0, 7, 7202, 1, 6, 37906, 1, 7, 11408, // 1, 6 +0, 7, 8662, 0, 8, 6997, 1, 7, 38534, 1, 8, 11343, // 1, 7 +1, 8, 38481, 1, 9, 11317, 2, 8, 8718, 2, 9, 7020, // 1, 8 +1, 9, 37866, 1, 10, 11360, 2, 9, 9086, 2, 10, 7224, // 1, 9 +1, 10, 36926, 1, 11, 11507, 2, 10, 9587, 2, 11, 7516, // 1,10 +1, 11, 35730, 1, 12, 11721, 2, 11, 10204, 2, 12, 7881, // 1,11 +1, 12, 34358, 1, 13, 11964, 2, 12, 10918, 2, 13, 8296, // 1,12 +1, 13, 32881, 1, 14, 12203, 2, 13, 11709, 2, 14, 8743, // 1,13 +1, 14, 31358, 1, 15, 12412, 2, 14, 12564, 2, 15, 9202, // 1,14 +1, 15, 29831, 1, 16, 12574, 2, 15, 13470, 2, 16, 9661, // 1,15 +1, 0, 13176, 1, 1, 9245, 2, 0, 31138, 2, 1, 11977, // 2, 0 +1, 1, 12203, 1, 2, 8742, 2, 1, 32881, 2, 2, 11710, // 2, 1 +1, 2, 11272, 1, 3, 8232, 2, 2, 34650, 2, 3, 11382, // 2, 2 +1, 3, 10397, 1, 4, 7728, 2, 3, 36399, 2, 4, 11012, // 2, 3 +1, 4, 9597, 1, 5, 7252, 2, 4, 38057, 2, 5, 10630, // 2, 4 +1, 5, 8902, 1, 6, 6829, 2, 5, 39526, 2, 6, 10279, // 2, 5 +1, 6, 8344, 1, 7, 6491, 2, 6, 40688, 2, 7, 10013, // 2, 6 +1, 7, 7951, 1, 8, 6266, 2, 7, 41432, 2, 8, 9887, // 2, 7 +2, 8, 41389, 2, 9, 9867, 3, 8, 7996, 3, 9, 6284, // 2, 8 +2, 9, 40656, 2, 10, 9977, 3, 9, 8397, 3, 10, 6506, // 2, 9 +2, 10, 39503, 2, 11, 10226, 3, 10, 8966, 3, 11, 6841, // 2,10 +2, 11, 38042, 2, 12, 10559, 3, 11, 9674, 3, 12, 7261, // 2,11 +2, 12, 36392, 2, 13, 10922, 3, 12, 10488, 3, 13, 7734, // 2,12 +2, 13, 34650, 2, 14, 11272, 3, 13, 11382, 3, 14, 8232, // 2,13 +2, 14, 32886, 2, 15, 11580, 3, 14, 12334, 3, 15, 8736, // 2,14 +2, 15, 31146, 2, 16, 11829, 3, 15, 13332, 3, 16, 9229, // 2,15 +2, 0, 13038, 2, 1, 8838, 3, 0, 32391, 3, 1, 11269, // 3, 0 +2, 1, 11964, 2, 2, 8296, 3, 1, 34358, 3, 2, 10918, // 3, 1 +2, 2, 10922, 2, 3, 7734, 3, 2, 36392, 3, 3, 10488, // 3, 2 +2, 3, 9924, 2, 4, 7164, 3, 3, 38450, 3, 4, 9998, // 3, 3 +2, 4, 8995, 2, 5, 6611, 3, 4, 40452, 3, 5, 9478, // 3, 4 +2, 5, 8175, 2, 6, 6108, 3, 5, 42271, 3, 6, 8982, // 3, 5 +2, 6, 7516, 2, 7, 5703, 3, 6, 43733, 3, 7, 8584, // 3, 6 +2, 7, 7072, 2, 8, 5443, 3, 7, 44649, 3, 8, 8372, // 3, 7 +3, 8, 44616, 3, 9, 8359, 4, 8, 7106, 4, 9, 5455, // 3, 8 +3, 9, 43710, 3, 10, 8558, 4, 9, 7556, 4, 10, 5712, // 3, 9 +3, 10, 42256, 3, 11, 8940, 4, 10, 8224, 4, 11, 6116, // 3,10 +3, 11, 40444, 3, 12, 9421, 4, 11, 9056, 4, 12, 6615, // 3,11 +3, 12, 38450, 3, 13, 9924, 4, 12, 9998, 4, 13, 7164, // 3,12 +3, 13, 36399, 3, 14, 10397, 4, 13, 11012, 4, 14, 7728, // 3,13 +3, 14, 34369, 3, 15, 10808, 4, 14, 12074, 4, 15, 8285, // 3,14 +3, 15, 32406, 3, 16, 11143, 4, 15, 13171, 4, 16, 8816, // 3,15 +3, 0, 12899, 3, 1, 8463, 4, 0, 33539, 4, 1, 10635, // 4, 0 +3, 1, 11721, 3, 2, 7881, 4, 1, 35730, 4, 2, 10204, // 4, 1 +3, 2, 10559, 3, 3, 7261, 4, 2, 38042, 4, 3, 9674, // 4, 2 +3, 3, 9421, 3, 4, 6615, 4, 3, 40444, 4, 4, 9056, // 4, 3 +3, 4, 8332, 3, 5, 5965, 4, 4, 42861, 4, 5, 8378, // 4, 4 +3, 5, 7342, 3, 6, 5350, 4, 5, 45146, 4, 6, 7698, // 4, 5 +3, 6, 6530, 3, 7, 4838, 4, 6, 47049, 4, 7, 7119, // 4, 6 +3, 7, 6000, 3, 8, 4513, 4, 7, 48240, 4, 8, 6783, // 4, 7 +4, 8, 48218, 4, 9, 6774, 5, 8, 6023, 5, 9, 4521, // 4, 8 +4, 9, 47035, 4, 10, 7100, 5, 9, 6558, 5, 10, 4843, // 4, 9 +4, 10, 45139, 4, 11, 7667, 5, 10, 7377, 5, 11, 5353, // 4,10 +4, 11, 42861, 4, 12, 8332, 5, 11, 8378, 5, 12, 5965, // 4,11 +4, 12, 40452, 4, 13, 8995, 5, 12, 9478, 5, 13, 6611, // 4,12 +4, 13, 38057, 4, 14, 9597, 5, 13, 10630, 5, 14, 7252, // 4,13 +4, 14, 35750, 4, 15, 10111, 5, 14, 11810, 5, 15, 7865, // 4,14 +4, 15, 33564, 4, 16, 10528, 5, 15, 13007, 5, 16, 8437, // 4,15 +4, 0, 12783, 4, 1, 8135, 5, 0, 34532, 5, 1, 10086, // 5, 0 +4, 1, 11507, 4, 2, 7517, 5, 1, 36926, 5, 2, 9586, // 5, 1 +4, 2, 10226, 4, 3, 6842, 5, 2, 39503, 5, 3, 8965, // 5, 2 +4, 3, 8940, 4, 4, 6116, 5, 3, 42256, 5, 4, 8224, // 5, 3 +4, 4, 7667, 4, 5, 5353, 5, 4, 45139, 5, 5, 7377, // 5, 4 +4, 5, 6451, 4, 6, 4591, 5, 5, 48019, 5, 6, 6475, // 5, 5 +4, 6, 5400, 4, 7, 3911, 5, 6, 50587, 5, 7, 5638, // 5, 6 +4, 7, 4708, 4, 8, 3466, 5, 7, 52266, 5, 8, 5096, // 5, 7 +5, 8, 52253, 5, 9, 5092, 6, 8, 4721, 6, 9, 3470, // 5, 8 +5, 9, 50581, 5, 10, 5624, 6, 9, 5418, 6, 10, 3913, // 5, 9 +5, 10, 48019, 5, 11, 6451, 6, 10, 6475, 6, 11, 4591, // 5,10 +5, 11, 45146, 5, 12, 7342, 6, 11, 7698, 6, 12, 5350, // 5,11 +5, 12, 42271, 5, 13, 8175, 6, 12, 8982, 6, 13, 6108, // 5,12 +5, 13, 39526, 5, 14, 8902, 6, 13, 10279, 6, 14, 6829, // 5,13 +5, 14, 36955, 5, 15, 9509, 6, 14, 11575, 6, 15, 7497, // 5,14 +5, 15, 34567, 5, 16, 9995, 6, 15, 12867, 6, 16, 8107, // 5,15 +5, 0, 12717, 5, 1, 7868, 6, 0, 35315, 6, 1, 9636, // 6, 0 +5, 1, 11360, 5, 2, 7224, 6, 1, 37866, 6, 2, 9086, // 6, 1 +5, 2, 9977, 5, 3, 6506, 6, 2, 40656, 6, 3, 8397, // 6, 2 +5, 3, 8558, 5, 4, 5712, 6, 3, 43710, 6, 4, 7556, // 6, 3 +5, 4, 7100, 5, 5, 4843, 6, 4, 47035, 6, 5, 6558, // 6, 4 +5, 5, 5624, 5, 6, 3913, 6, 5, 50581, 6, 6, 5418, // 6, 5 +5, 6, 4217, 5, 7, 2989, 6, 6, 54105, 6, 7, 4225, // 6, 6 +5, 7, 3180, 5, 8, 2294, 6, 7, 56756, 6, 8, 3306, // 6, 7 +6, 8, 56751, 6, 9, 3303, 7, 8, 3186, 7, 9, 2296, // 6, 8 +6, 9, 54105, 6, 10, 4217, 7, 9, 4225, 7, 10, 2989, // 6, 9 +6, 10, 50587, 6, 11, 5400, 7, 10, 5637, 7, 11, 3912, // 6,10 +6, 11, 47049, 6, 12, 6530, 7, 11, 7119, 7, 12, 4838, // 6,11 +6, 12, 43733, 6, 13, 7516, 7, 12, 8584, 7, 13, 5703, // 6,12 +6, 13, 40688, 6, 14, 8344, 7, 13, 10013, 7, 14, 6491, // 6,13 +6, 14, 37906, 6, 15, 9020, 7, 14, 11407, 7, 15, 7203, // 6,14 +6, 15, 35362, 6, 16, 9558, 7, 15, 12777, 7, 16, 7839, // 6,15 +6, 0, 12728, 6, 1, 7674, 7, 0, 35844, 7, 1, 9290, // 7, 0 +6, 1, 11317, 6, 2, 7020, 7, 1, 38481, 7, 2, 8718, // 7, 1 +6, 2, 9867, 6, 3, 6284, 7, 2, 41389, 7, 3, 7996, // 7, 2 +6, 3, 8359, 6, 4, 5454, 7, 3, 44616, 7, 4, 7107, // 7, 3 +6, 4, 6774, 6, 5, 4521, 7, 4, 48218, 7, 5, 6023, // 7, 4 +6, 5, 5092, 6, 6, 3470, 7, 5, 52253, 7, 6, 4721, // 7, 5 +6, 6, 3303, 6, 7, 2295, 7, 6, 56751, 7, 7, 3187, // 7, 6 +6, 7, 1541, 6, 8, 1090, 7, 7, 61364, 7, 8, 1541, // 7, 7 +7, 8, 61364, 7, 9, 1541, 8, 8, 1542, 8, 9, 1089, // 7, 8 +7, 9, 56756, 7, 10, 3180, 8, 9, 3306, 8, 10, 2294, // 7, 9 +7, 10, 52266, 7, 11, 4708, 8, 10, 5097, 8, 11, 3465, // 7,10 +7, 11, 48240, 7, 12, 6000, 8, 11, 6783, 8, 12, 4513, // 7,11 +7, 12, 44649, 7, 13, 7072, 8, 12, 8373, 8, 13, 5442, // 7,12 +7, 13, 41432, 7, 14, 7951, 8, 13, 9886, 8, 14, 6267, // 7,13 +7, 14, 38534, 7, 15, 8662, 8, 14, 11344, 8, 15, 6996, // 7,14 +7, 15, 35905, 7, 16, 9224, 8, 15, 12764, 8, 16, 7643, // 7,15 +7, -1, 7643, 7, 0, 12764, 8, -1, 9224, 8, 0, 35905, // 8, 0 +7, 0, 6997, 7, 1, 11344, 8, 0, 8662, 8, 1, 38533, // 8, 1 +7, 1, 6266, 7, 2, 9886, 8, 1, 7951, 8, 2, 41433, // 8, 2 +7, 2, 5443, 7, 3, 8373, 8, 2, 7072, 8, 3, 44648, // 8, 3 +7, 3, 4513, 7, 4, 6783, 8, 3, 6000, 8, 4, 48240, // 8, 4 +7, 4, 3466, 7, 5, 5097, 8, 4, 4708, 8, 5, 52265, // 8, 5 +7, 5, 2294, 7, 6, 3306, 8, 5, 3180, 8, 6, 56756, // 8, 6 +7, 6, 1090, 7, 7, 1542, 8, 6, 1541, 8, 7, 61363, // 8, 7 +8, 7, 1542, 8, 8, 61364, 9, 7, 1090, 9, 8, 1540, // 8, 8 +8, 8, 3186, 8, 9, 56751, 9, 8, 2295, 9, 9, 3304, // 8, 9 +8, 9, 4721, 8, 10, 52253, 9, 9, 3470, 9, 10, 5092, // 8,10 +8, 10, 6023, 8, 11, 48218, 9, 10, 4521, 9, 11, 6774, // 8,11 +8, 11, 7106, 8, 12, 44616, 9, 11, 5454, 9, 12, 8360, // 8,12 +8, 12, 7996, 8, 13, 41389, 9, 12, 6284, 9, 13, 9867, // 8,13 +8, 13, 8718, 8, 14, 38481, 9, 13, 7020, 9, 14, 11317, // 8,14 +8, 14, 9290, 8, 15, 35844, 9, 14, 7674, 9, 15, 12728, // 8,15 +8, -1, 7839, 8, 0, 12777, 9, -1, 9558, 9, 0, 35362, // 9, 0 +8, 0, 7202, 8, 1, 11407, 9, 0, 9020, 9, 1, 37907, // 9, 1 +8, 1, 6491, 8, 2, 10013, 9, 1, 8344, 9, 2, 40688, // 9, 2 +8, 2, 5703, 8, 3, 8584, 9, 2, 7516, 9, 3, 43733, // 9, 3 +8, 3, 4838, 8, 4, 7119, 9, 3, 6530, 9, 4, 47049, // 9, 4 +8, 4, 3911, 8, 5, 5637, 9, 4, 5400, 9, 5, 50588, // 9, 5 +8, 5, 2989, 8, 6, 4225, 9, 5, 4217, 9, 6, 54105, // 9, 6 +8, 6, 2295, 8, 7, 3186, 9, 6, 3303, 9, 7, 56752, // 9, 7 +9, 7, 3306, 9, 8, 56756, 10, 7, 2294, 10, 8, 3180, // 9, 8 +9, 8, 4225, 9, 9, 54105, 10, 8, 2989, 10, 9, 4217, // 9, 9 +9, 9, 5418, 9, 10, 50581, 10, 9, 3913, 10, 10, 5624, // 9,10 +9, 10, 6558, 9, 11, 47035, 10, 10, 4843, 10, 11, 7100, // 9,11 +9, 11, 7556, 9, 12, 43710, 10, 11, 5712, 10, 12, 8558, // 9,12 +9, 12, 8397, 9, 13, 40656, 10, 12, 6506, 10, 13, 9977, // 9,13 +9, 13, 9086, 9, 14, 37866, 10, 13, 7224, 10, 14, 11360, // 9,14 +9, 14, 9635, 9, 15, 35315, 10, 14, 7868, 10, 15, 12718, // 9,15 +9, -1, 8107, 9, 0, 12867, 10, -1, 9995, 10, 0, 34567, // 10, 0 +9, 0, 7497, 9, 1, 11575, 10, 0, 9509, 10, 1, 36955, // 10, 1 +9, 1, 6829, 9, 2, 10279, 10, 1, 8902, 10, 2, 39526, // 10, 2 +9, 2, 6108, 9, 3, 8982, 10, 2, 8175, 10, 3, 42271, // 10, 3 +9, 3, 5350, 9, 4, 7698, 10, 3, 7342, 10, 4, 45146, // 10, 4 +9, 4, 4591, 9, 5, 6475, 10, 4, 6451, 10, 5, 48019, // 10, 5 +9, 5, 3913, 9, 6, 5418, 10, 5, 5624, 10, 6, 50581, // 10, 6 +9, 6, 3470, 9, 7, 4721, 10, 6, 5092, 10, 7, 52253, // 10, 7 +10, 7, 5097, 10, 8, 52266, 11, 7, 3466, 11, 8, 4707, // 10, 8 +10, 8, 5637, 10, 9, 50587, 11, 8, 3911, 11, 9, 5401, // 10, 9 +10, 9, 6475, 10, 10, 48019, 11, 9, 4591, 11, 10, 6451, // 10,10 +10, 10, 7377, 10, 11, 45139, 11, 10, 5353, 11, 11, 7667, // 10,11 +10, 11, 8224, 10, 12, 42256, 11, 11, 6116, 11, 12, 8940, // 10,12 +10, 12, 8966, 10, 13, 39503, 11, 12, 6842, 11, 13, 10225, // 10,13 +10, 13, 9587, 10, 14, 36926, 11, 13, 7517, 11, 14, 11506, // 10,14 +10, 14, 10086, 10, 15, 34532, 11, 14, 8135, 11, 15, 12783, // 10,15 +10, -1, 8438, 10, 0, 13007, 11, -1, 10528, 11, 0, 33563, // 11, 0 +10, 0, 7865, 10, 1, 11810, 11, 0, 10111, 11, 1, 35750, // 11, 1 +10, 1, 7252, 10, 2, 10630, 11, 1, 9597, 11, 2, 38057, // 11, 2 +10, 2, 6611, 10, 3, 9478, 11, 2, 8995, 11, 3, 40452, // 11, 3 +10, 3, 5965, 10, 4, 8378, 11, 3, 8332, 11, 4, 42861, // 11, 4 +10, 4, 5353, 10, 5, 7377, 11, 4, 7667, 11, 5, 45139, // 11, 5 +10, 5, 4843, 10, 6, 6558, 11, 5, 7100, 11, 6, 47035, // 11, 6 +10, 6, 4521, 10, 7, 6023, 11, 6, 6774, 11, 7, 48218, // 11, 7 +11, 7, 6783, 11, 8, 48240, 12, 7, 4513, 12, 8, 6000, // 11, 8 +11, 8, 7119, 11, 9, 47049, 12, 8, 4838, 12, 9, 6530, // 11, 9 +11, 9, 7698, 11, 10, 45146, 12, 9, 5350, 12, 10, 7342, // 11,10 +11, 10, 8378, 11, 11, 42861, 12, 10, 5965, 12, 11, 8332, // 11,11 +11, 11, 9056, 11, 12, 40444, 12, 11, 6615, 12, 12, 9421, // 11,12 +11, 12, 9674, 11, 13, 38042, 12, 12, 7261, 12, 13, 10559, // 11,13 +11, 13, 10204, 11, 14, 35730, 12, 13, 7881, 12, 14, 11721, // 11,14 +11, 14, 10635, 11, 15, 33539, 12, 14, 8463, 12, 15, 12899, // 11,15 +11, -1, 8816, 11, 0, 13171, 12, -1, 11143, 12, 0, 32406, // 12, 0 +11, 0, 8284, 11, 1, 12074, 12, 0, 10808, 12, 1, 34370, // 12, 1 +11, 1, 7728, 11, 2, 11012, 12, 1, 10397, 12, 2, 36399, // 12, 2 +11, 2, 7164, 11, 3, 9998, 12, 2, 9924, 12, 3, 38450, // 12, 3 +11, 3, 6615, 11, 4, 9056, 12, 3, 9421, 12, 4, 40444, // 12, 4 +11, 4, 6116, 11, 5, 8224, 12, 4, 8940, 12, 5, 42256, // 12, 5 +11, 5, 5712, 11, 6, 7556, 12, 5, 8558, 12, 6, 43710, // 12, 6 +11, 6, 5454, 11, 7, 7106, 12, 6, 8359, 12, 7, 44617, // 12, 7 +12, 7, 8373, 12, 8, 44649, 13, 7, 5443, 13, 8, 7071, // 12, 8 +12, 8, 8584, 12, 9, 43733, 13, 8, 5703, 13, 9, 7516, // 12, 9 +12, 9, 8982, 12, 10, 42271, 13, 9, 6108, 13, 10, 8175, // 12,10 +12, 10, 9478, 12, 11, 40452, 13, 10, 6611, 13, 11, 8995, // 12,11 +12, 11, 9998, 12, 12, 38450, 13, 11, 7164, 13, 12, 9924, // 12,12 +12, 12, 10488, 12, 13, 36392, 13, 12, 7734, 13, 13, 10922, // 12,13 +12, 13, 10918, 12, 14, 34358, 13, 13, 8296, 13, 14, 11964, // 12,14 +12, 14, 11269, 12, 15, 32391, 13, 14, 8838, 13, 15, 13038, // 12,15 +12, -1, 9229, 12, 0, 13332, 13, -1, 11829, 13, 0, 31146, // 13, 0 +12, 0, 8735, 12, 1, 12334, 13, 0, 11580, 13, 1, 32887, // 13, 1 +12, 1, 8232, 12, 2, 11382, 13, 1, 11272, 13, 2, 34650, // 13, 2 +12, 2, 7734, 12, 3, 10488, 13, 2, 10922, 13, 3, 36392, // 13, 3 +12, 3, 7261, 12, 4, 9674, 13, 3, 10559, 13, 4, 38042, // 13, 4 +12, 4, 6842, 12, 5, 8966, 13, 4, 10226, 13, 5, 39502, // 13, 5 +12, 5, 6506, 12, 6, 8397, 13, 5, 9977, 13, 6, 40656, // 13, 6 +12, 6, 6284, 12, 7, 7996, 13, 6, 9867, 13, 7, 41389, // 13, 7 +13, 7, 9886, 13, 8, 41432, 14, 7, 6266, 14, 8, 7952, // 13, 8 +13, 8, 10013, 13, 9, 40688, 14, 8, 6491, 14, 9, 8344, // 13, 9 +13, 9, 10279, 13, 10, 39526, 14, 9, 6829, 14, 10, 8902, // 13,10 +13, 10, 10630, 13, 11, 38057, 14, 10, 7252, 14, 11, 9597, // 13,11 +13, 11, 11012, 13, 12, 36399, 14, 11, 7728, 14, 12, 10397, // 13,12 +13, 12, 11382, 13, 13, 34650, 14, 12, 8232, 14, 13, 11272, // 13,13 +13, 13, 11709, 13, 14, 32881, 14, 13, 8742, 14, 14, 12204, // 13,14 +13, 14, 11977, 13, 15, 31138, 14, 14, 9245, 14, 15, 13176, // 13,15 +13, -1, 9662, 13, 0, 13470, 14, -1, 12574, 14, 0, 29830, // 14, 0 +13, 0, 9202, 13, 1, 12564, 14, 0, 12412, 14, 1, 31358, // 14, 1 +13, 1, 8742, 13, 2, 11709, 14, 1, 12203, 14, 2, 32882, // 14, 2 +13, 2, 8296, 13, 3, 10918, 14, 2, 11964, 14, 3, 34358, // 14, 3 +13, 3, 7881, 13, 4, 10204, 14, 3, 11721, 14, 4, 35730, // 14, 4 +13, 4, 7517, 13, 5, 9587, 14, 4, 11507, 14, 5, 36925, // 14, 5 +13, 5, 7224, 13, 6, 9086, 14, 5, 11360, 14, 6, 37866, // 14, 6 +13, 6, 7020, 13, 7, 8718, 14, 6, 11317, 14, 7, 38481, // 14, 7 +14, 7, 11344, 14, 8, 38534, 15, 7, 6997, 15, 8, 8661, // 14, 8 +14, 8, 11407, 14, 9, 37906, 15, 8, 7202, 15, 9, 9021, // 14, 9 +14, 9, 11575, 14, 10, 36955, 15, 9, 7497, 15, 10, 9509, // 14,10 +14, 10, 11810, 14, 11, 35750, 15, 10, 7865, 15, 11, 10111, // 14,11 +14, 11, 12074, 14, 12, 34369, 15, 11, 8284, 15, 12, 10809, // 14,12 +14, 12, 12334, 14, 13, 32886, 15, 12, 8735, 15, 13, 11581, // 14,13 +14, 13, 12564, 14, 14, 31358, 15, 13, 9202, 15, 14, 12412, // 14,14 +14, 14, 12746, 14, 15, 29828, 15, 14, 9671, 15, 15, 13291, // 14,15 +14, -1, 10104, 14, 0, 13569, 15, -1, 13368, 15, 0, 28495, // 15, 0 +14, 0, 9671, 14, 1, 12746, 15, 0, 13291, 15, 1, 29828, // 15, 1 +14, 1, 9245, 14, 2, 11977, 15, 1, 13176, 15, 2, 31138, // 15, 2 +14, 2, 8838, 14, 3, 11269, 15, 2, 13038, 15, 3, 32391, // 15, 3 +14, 3, 8463, 14, 4, 10635, 15, 3, 12899, 15, 4, 33539, // 15, 4 +14, 4, 8135, 14, 5, 10086, 15, 4, 12783, 15, 5, 34532, // 15, 5 +14, 5, 7868, 14, 6, 9635, 15, 5, 12717, 15, 6, 35316, // 15, 6 +14, 6, 7674, 14, 7, 9290, 15, 6, 12728, 15, 7, 35844, // 15, 7 +15, 7, 12764, 15, 8, 35905, 16, 7, 7643, 16, 8, 9224, // 15, 8 +15, 8, 12777, 15, 9, 35362, 16, 8, 7839, 16, 9, 9558, // 15, 9 +15, 9, 12867, 15, 10, 34567, 16, 9, 8107, 16, 10, 9995, // 15,10 +15, 10, 13007, 15, 11, 33564, 16, 10, 8438, 16, 11, 10527, // 15,11 +15, 11, 13171, 15, 12, 32406, 16, 11, 8816, 16, 12, 11143, // 15,12 +15, 12, 13332, 15, 13, 31146, 16, 12, 9229, 16, 13, 11829, // 15,13 +15, 13, 13470, 15, 14, 29831, 16, 13, 9662, 16, 14, 12573, // 15,14 +15, 14, 13569, 15, 15, 28495, 16, 14, 10104, 16, 15, 13368, // 15,15 +// angle of -1.5 degrees +-1, 0, 11440, -1, 1, 8358, 0, 0, 34212, 0, 1, 11526, // 0, 0 +-1, 1, 10780, -1, 2, 7983, 0, 1, 35506, 0, 2, 11267, // 0, 1 +-1, 2, 10158, -1, 3, 7620, 0, 2, 36764, 0, 3, 10994, // 0, 2 +-1, 3, 9585, -1, 4, 7276, 0, 3, 37951, 0, 4, 10724, // 0, 3 +-1, 4, 9072, -1, 5, 6965, 0, 4, 39026, 0, 5, 10473, // 0, 4 +-1, 5, 8632, -1, 6, 6699, 0, 5, 39940, 0, 6, 10265, // 0, 5 +-1, 6, 8278, -1, 7, 6489, 0, 6, 40646, 0, 7, 10123, // 0, 6 +-1, 7, 8018, -1, 8, 6346, 0, 7, 41106, 0, 8, 10066, // 0, 7 +0, 8, 41072, 0, 9, 10052, 1, 8, 8052, 1, 9, 6360, // 0, 8 +0, 9, 40618, 0, 10, 10100, 1, 9, 8316, 1, 10, 6502, // 0, 9 +0, 10, 39918, 0, 11, 10232, 1, 10, 8676, 1, 11, 6710, // 0,10 +0, 11, 39009, 0, 12, 10430, 1, 11, 9122, 1, 12, 6975, // 0,11 +0, 12, 37939, 0, 13, 10670, 1, 12, 9642, 1, 13, 7285, // 0,12 +0, 13, 36756, 0, 14, 10930, 1, 13, 10224, 1, 14, 7626, // 0,13 +0, 14, 35502, 0, 15, 11192, 1, 14, 10855, 1, 15, 7987, // 0,14 +0, 15, 34212, 0, 16, 11440, 1, 15, 11526, 1, 16, 8358, // 0,15 +0, 0, 11192, 0, 1, 7987, 1, 0, 35502, 1, 1, 10855, // 1, 0 +0, 1, 10467, 0, 2, 7579, 1, 1, 36959, 1, 2, 10531, // 1, 1 +0, 2, 9777, 0, 3, 7177, 1, 2, 38394, 1, 3, 10188, // 1, 2 +0, 3, 9135, 0, 4, 6792, 1, 3, 39767, 1, 4, 9842, // 1, 3 +0, 4, 8557, 0, 5, 6440, 1, 4, 41026, 1, 5, 9513, // 1, 4 +0, 5, 8061, 0, 6, 6137, 1, 5, 42105, 1, 6, 9233, // 1, 5 +0, 6, 7667, 0, 7, 5900, 1, 6, 42936, 1, 7, 9033, // 1, 6 +0, 7, 7390, 0, 8, 5745, 1, 7, 43461, 1, 8, 8940, // 1, 7 +1, 8, 43433, 1, 9, 8929, 2, 8, 7418, 2, 9, 5756, // 1, 8 +1, 9, 42913, 1, 10, 9014, 2, 9, 7699, 2, 10, 5910, // 1, 9 +1, 10, 42087, 1, 11, 9206, 2, 10, 8098, 2, 11, 6145, // 1,10 +1, 11, 41013, 1, 12, 9478, 2, 11, 8599, 2, 12, 6446, // 1,11 +1, 12, 39759, 1, 13, 9796, 2, 12, 9184, 2, 13, 6797, // 1,12 +1, 13, 38390, 1, 14, 10133, 2, 13, 9834, 2, 14, 7179, // 1,13 +1, 14, 36959, 1, 15, 10467, 2, 14, 10532, 2, 15, 7578, // 1,14 +1, 15, 35506, 1, 16, 10780, 2, 15, 11267, 2, 16, 7983, // 1,15 +1, 0, 10930, 1, 1, 7626, 2, 0, 36756, 2, 1, 10224, // 2, 0 +1, 1, 10133, 1, 2, 7179, 2, 1, 38390, 2, 2, 9834, // 2, 1 +1, 2, 9366, 1, 3, 6732, 2, 2, 40025, 2, 3, 9413, // 2, 2 +1, 3, 8641, 1, 4, 6297, 2, 3, 41618, 2, 4, 8980, // 2, 3 +1, 4, 7981, 1, 5, 5891, 2, 4, 43105, 2, 5, 8559, // 2, 4 +1, 5, 7411, 1, 6, 5537, 2, 5, 44399, 2, 6, 8189, // 2, 5 +1, 6, 6961, 1, 7, 5261, 2, 6, 45401, 2, 7, 7913, // 2, 6 +1, 7, 6658, 1, 8, 5087, 2, 7, 46017, 2, 8, 7774, // 2, 7 +2, 8, 45995, 2, 9, 7766, 3, 8, 6680, 3, 9, 5095, // 2, 8 +2, 9, 45383, 2, 10, 7899, 3, 9, 6986, 3, 10, 5268, // 2, 9 +2, 10, 44386, 2, 11, 8167, 3, 10, 7440, 3, 11, 5543, // 2,10 +2, 11, 43096, 2, 12, 8530, 3, 11, 8015, 3, 12, 5895, // 2,11 +2, 12, 41614, 2, 13, 8941, 3, 12, 8681, 3, 13, 6300, // 2,12 +2, 13, 40025, 2, 14, 9366, 3, 13, 9413, 3, 14, 6732, // 2,13 +2, 14, 38394, 2, 15, 9777, 3, 14, 10188, 3, 15, 7177, // 2,14 +2, 15, 36764, 2, 16, 10158, 3, 15, 10994, 3, 16, 7620, // 2,15 +2, 0, 10670, 2, 1, 7285, 3, 0, 37939, 3, 1, 9642, // 3, 0 +2, 1, 9796, 2, 2, 6797, 3, 1, 39759, 3, 2, 9184, // 3, 1 +2, 2, 8941, 2, 3, 6299, 3, 2, 41614, 3, 3, 8682, // 3, 2 +2, 3, 8120, 2, 4, 5804, 3, 3, 43461, 3, 4, 8151, // 3, 3 +2, 4, 7356, 2, 5, 5330, 3, 4, 45229, 3, 5, 7621, // 3, 4 +2, 5, 6685, 2, 6, 4906, 3, 5, 46806, 3, 6, 7139, // 3, 5 +2, 6, 6154, 2, 7, 4572, 3, 6, 48049, 3, 7, 6761, // 3, 6 +2, 7, 5811, 2, 8, 4366, 3, 7, 48801, 3, 8, 6558, // 3, 7 +3, 8, 48785, 3, 9, 6552, 4, 8, 5827, 4, 9, 4372, // 3, 8 +3, 9, 48037, 3, 10, 6750, 4, 9, 6173, 4, 10, 4576, // 3, 9 +3, 10, 46798, 3, 11, 7121, 4, 10, 6707, 4, 11, 4910, // 3,10 +3, 11, 45224, 3, 12, 7598, 4, 11, 7382, 4, 12, 5332, // 3,11 +3, 12, 43461, 3, 13, 8120, 4, 12, 8151, 4, 13, 5804, // 3,12 +3, 13, 41618, 3, 14, 8641, 4, 13, 8979, 4, 14, 6298, // 3,13 +3, 14, 39767, 3, 15, 9135, 4, 14, 9841, 4, 15, 6793, // 3,14 +3, 15, 37951, 3, 16, 9585, 4, 15, 10723, 4, 16, 7277, // 3,15 +3, 0, 10430, 3, 1, 6975, 4, 0, 39009, 4, 1, 9122, // 4, 0 +3, 1, 9478, 3, 2, 6447, 4, 1, 41013, 4, 2, 8598, // 4, 1 +3, 2, 8530, 3, 3, 5895, 4, 2, 43096, 4, 3, 8015, // 4, 2 +3, 3, 7598, 3, 4, 5331, 4, 3, 45224, 4, 4, 7383, // 4, 3 +3, 4, 6708, 3, 5, 4774, 4, 4, 47328, 4, 5, 6726, // 4, 4 +3, 5, 5901, 3, 6, 4257, 4, 5, 49279, 4, 6, 6099, // 4, 5 +3, 6, 5248, 3, 7, 3834, 4, 6, 50873, 4, 7, 5581, // 4, 6 +3, 7, 4835, 3, 8, 3575, 4, 7, 51842, 4, 8, 5284, // 4, 7 +4, 8, 51832, 4, 9, 5280, 5, 8, 4846, 5, 9, 3578, // 4, 8 +4, 9, 50865, 4, 10, 5573, 5, 9, 5261, 5, 10, 3837, // 4, 9 +4, 10, 49275, 4, 11, 6086, 5, 10, 5917, 5, 11, 4258, // 4,10 +4, 11, 47328, 4, 12, 6708, 5, 11, 6727, 5, 12, 4773, // 4,11 +4, 12, 45229, 4, 13, 7356, 5, 12, 7622, 5, 13, 5329, // 4,12 +4, 13, 43105, 4, 14, 7981, 5, 13, 8559, 5, 14, 5891, // 4,13 +4, 14, 41026, 4, 15, 8557, 5, 14, 9513, 5, 15, 6440, // 4,14 +4, 15, 39026, 4, 16, 9072, 5, 15, 10473, 5, 16, 6965, // 4,15 +4, 0, 10232, 4, 1, 6710, 5, 0, 39918, 5, 1, 8676, // 5, 0 +4, 1, 9206, 4, 2, 6145, 5, 1, 42087, 5, 2, 8098, // 5, 1 +4, 2, 8167, 4, 3, 5543, 5, 2, 44386, 5, 3, 7440, // 5, 2 +4, 3, 7121, 4, 4, 4909, 5, 3, 46798, 5, 4, 6708, // 5, 3 +4, 4, 6086, 4, 5, 4258, 5, 4, 49275, 5, 5, 5917, // 5, 4 +4, 5, 5103, 4, 6, 3621, 5, 5, 51700, 5, 6, 5112, // 5, 5 +4, 6, 4262, 4, 7, 3064, 5, 6, 53816, 5, 7, 4394, // 5, 6 +4, 7, 3720, 4, 8, 2708, 5, 7, 55168, 5, 8, 3940, // 5, 7 +5, 8, 55162, 5, 9, 3938, 6, 8, 3726, 6, 9, 2710, // 5, 8 +5, 9, 53813, 5, 10, 4388, 6, 9, 4269, 6, 10, 3066, // 5, 9 +5, 10, 51700, 5, 11, 5103, 6, 10, 5113, 6, 11, 3620, // 5,10 +5, 11, 49279, 5, 12, 5901, 6, 11, 6099, 6, 12, 4257, // 5,11 +5, 12, 46806, 5, 13, 6685, 6, 12, 7138, 6, 13, 4907, // 5,12 +5, 13, 44399, 5, 14, 7411, 6, 13, 8189, 6, 14, 5537, // 5,13 +5, 14, 42105, 5, 15, 8061, 6, 14, 9233, 6, 15, 6137, // 5,14 +5, 15, 39940, 5, 16, 8632, 6, 15, 10265, 6, 16, 6699, // 5,15 +5, 0, 10100, 5, 1, 6502, 6, 0, 40618, 6, 1, 8316, // 6, 0 +5, 1, 9014, 5, 2, 5910, 6, 1, 42913, 6, 2, 7699, // 6, 1 +5, 2, 7899, 5, 3, 5268, 6, 2, 45383, 6, 3, 6986, // 6, 2 +5, 3, 6750, 5, 4, 4576, 6, 3, 48037, 6, 4, 6173, // 6, 3 +5, 4, 5573, 5, 5, 3837, 6, 4, 50865, 6, 5, 5261, // 6, 4 +5, 5, 4388, 5, 6, 3065, 6, 5, 53813, 6, 6, 4270, // 6, 5 +5, 6, 3271, 5, 7, 2316, 6, 6, 56673, 6, 7, 3276, // 6, 6 +5, 7, 2462, 5, 8, 1766, 6, 7, 58775, 6, 8, 2533, // 6, 7 +6, 8, 58773, 6, 9, 2532, 7, 8, 2464, 7, 9, 1767, // 6, 8 +6, 9, 56673, 6, 10, 3271, 7, 9, 3275, 7, 10, 2317, // 6, 9 +6, 10, 53816, 6, 11, 4262, 7, 10, 4394, 7, 11, 3064, // 6,10 +6, 11, 50873, 6, 12, 5248, 7, 11, 5581, 7, 12, 3834, // 6,11 +6, 12, 48049, 6, 13, 6154, 7, 12, 6761, 7, 13, 4572, // 6,12 +6, 13, 45401, 6, 14, 6961, 7, 13, 7913, 7, 14, 5261, // 6,13 +6, 14, 42936, 6, 15, 7667, 7, 14, 9032, 7, 15, 5901, // 6,14 +6, 15, 40646, 6, 16, 8278, 7, 15, 10123, 7, 16, 6489, // 6,15 +6, 0, 10052, 6, 1, 6360, 7, 0, 41072, 7, 1, 8052, // 7, 0 +6, 1, 8929, 6, 2, 5756, 7, 1, 43433, 7, 2, 7418, // 7, 1 +6, 2, 7766, 6, 3, 5095, 7, 2, 45995, 7, 3, 6680, // 7, 2 +6, 3, 6552, 6, 4, 4372, 7, 3, 48785, 7, 4, 5827, // 7, 3 +6, 4, 5280, 6, 5, 3579, 7, 4, 51832, 7, 5, 4845, // 7, 4 +6, 5, 3938, 6, 6, 2710, 7, 5, 55162, 7, 6, 3726, // 7, 5 +6, 6, 2532, 6, 7, 1767, 7, 6, 58773, 7, 7, 2464, // 7, 6 +6, 7, 1170, 6, 8, 827, 7, 7, 62369, 7, 8, 1170, // 7, 7 +7, 8, 62369, 7, 9, 1170, 8, 8, 1170, 8, 9, 827, // 7, 8 +7, 9, 58775, 7, 10, 2462, 8, 9, 2533, 8, 10, 1766, // 7, 9 +7, 10, 55168, 7, 11, 3720, 8, 10, 3940, 8, 11, 2708, // 7,10 +7, 11, 51842, 7, 12, 4835, 8, 11, 5283, 8, 12, 3576, // 7,11 +7, 12, 48801, 7, 13, 5811, 8, 12, 6558, 8, 13, 4366, // 7,12 +7, 13, 46017, 7, 14, 6658, 8, 13, 7773, 8, 14, 5088, // 7,13 +7, 14, 43461, 7, 15, 7390, 8, 14, 8939, 8, 15, 5746, // 7,14 +7, 15, 41106, 7, 16, 8018, 8, 15, 10066, 8, 16, 6346, // 7,15 +7, -1, 6346, 7, 0, 10066, 8, -1, 8018, 8, 0, 41106, // 8, 0 +7, 0, 5745, 7, 1, 8939, 8, 0, 7390, 8, 1, 43462, // 8, 1 +7, 1, 5087, 7, 2, 7773, 8, 1, 6658, 8, 2, 46018, // 8, 2 +7, 2, 4366, 7, 3, 6558, 8, 2, 5811, 8, 3, 48801, // 8, 3 +7, 3, 3575, 7, 4, 5283, 8, 3, 4835, 8, 4, 51843, // 8, 4 +7, 4, 2708, 7, 5, 3940, 8, 4, 3720, 8, 5, 55168, // 8, 5 +7, 5, 1766, 7, 6, 2533, 8, 5, 2462, 8, 6, 58775, // 8, 6 +7, 6, 827, 7, 7, 1170, 8, 6, 1170, 8, 7, 62369, // 8, 7 +8, 7, 1170, 8, 8, 62369, 9, 7, 827, 9, 8, 1170, // 8, 8 +8, 8, 2464, 8, 9, 58773, 9, 8, 1767, 9, 9, 2532, // 8, 9 +8, 9, 3726, 8, 10, 55162, 9, 9, 2710, 9, 10, 3938, // 8,10 +8, 10, 4846, 8, 11, 51832, 9, 10, 3579, 9, 11, 5279, // 8,11 +8, 11, 5827, 8, 12, 48785, 9, 11, 4372, 9, 12, 6552, // 8,12 +8, 12, 6680, 8, 13, 45995, 9, 12, 5095, 9, 13, 7766, // 8,13 +8, 13, 7418, 8, 14, 43433, 9, 13, 5756, 9, 14, 8929, // 8,14 +8, 14, 8052, 8, 15, 41072, 9, 14, 6360, 9, 15, 10052, // 8,15 +8, -1, 6489, 8, 0, 10123, 9, -1, 8278, 9, 0, 40646, // 9, 0 +8, 0, 5900, 8, 1, 9032, 9, 0, 7667, 9, 1, 42937, // 9, 1 +8, 1, 5261, 8, 2, 7913, 9, 1, 6961, 9, 2, 45401, // 9, 2 +8, 2, 4572, 8, 3, 6761, 9, 2, 6154, 9, 3, 48049, // 9, 3 +8, 3, 3834, 8, 4, 5581, 9, 3, 5248, 9, 4, 50873, // 9, 4 +8, 4, 3064, 8, 5, 4394, 9, 4, 4262, 9, 5, 53816, // 9, 5 +8, 5, 2316, 8, 6, 3275, 9, 5, 3271, 9, 6, 56674, // 9, 6 +8, 6, 1767, 8, 7, 2464, 9, 6, 2532, 9, 7, 58773, // 9, 7 +9, 7, 2533, 9, 8, 58775, 10, 7, 1766, 10, 8, 2462, // 9, 8 +9, 8, 3275, 9, 9, 56673, 10, 8, 2316, 10, 9, 3272, // 9, 9 +9, 9, 4269, 9, 10, 53813, 10, 9, 3065, 10, 10, 4389, // 9,10 +9, 10, 5261, 9, 11, 50865, 10, 10, 3837, 10, 11, 5573, // 9,11 +9, 11, 6173, 9, 12, 48037, 10, 11, 4576, 10, 12, 6750, // 9,12 +9, 12, 6986, 9, 13, 45383, 10, 12, 5268, 10, 13, 7899, // 9,13 +9, 13, 7699, 9, 14, 42913, 10, 13, 5910, 10, 14, 9014, // 9,14 +9, 14, 8316, 9, 15, 40618, 10, 14, 6502, 10, 15, 10100, // 9,15 +9, -1, 6699, 9, 0, 10265, 10, -1, 8632, 10, 0, 39940, // 10, 0 +9, 0, 6137, 9, 1, 9233, 10, 0, 8061, 10, 1, 42105, // 10, 1 +9, 1, 5537, 9, 2, 8189, 10, 1, 7411, 10, 2, 44399, // 10, 2 +9, 2, 4906, 9, 3, 7138, 10, 2, 6685, 10, 3, 46807, // 10, 3 +9, 3, 4257, 9, 4, 6099, 10, 3, 5901, 10, 4, 49279, // 10, 4 +9, 4, 3621, 9, 5, 5113, 10, 4, 5103, 10, 5, 51699, // 10, 5 +9, 5, 3065, 9, 6, 4269, 10, 5, 4388, 10, 6, 53814, // 10, 6 +9, 6, 2710, 9, 7, 3726, 10, 6, 3938, 10, 7, 55162, // 10, 7 +10, 7, 3940, 10, 8, 55168, 11, 7, 2708, 11, 8, 3720, // 10, 8 +10, 8, 4394, 10, 9, 53816, 11, 8, 3064, 11, 9, 4262, // 10, 9 +10, 9, 5113, 10, 10, 51700, 11, 9, 3621, 11, 10, 5102, // 10,10 +10, 10, 5917, 10, 11, 49275, 11, 10, 4258, 11, 11, 6086, // 10,11 +10, 11, 6707, 10, 12, 46798, 11, 11, 4909, 11, 12, 7122, // 10,12 +10, 12, 7440, 10, 13, 44386, 11, 12, 5543, 11, 13, 8167, // 10,13 +10, 13, 8098, 10, 14, 42087, 11, 13, 6145, 11, 14, 9206, // 10,14 +10, 14, 8676, 10, 15, 39918, 11, 14, 6710, 11, 15, 10232, // 10,15 +10, -1, 6965, 10, 0, 10473, 11, -1, 9072, 11, 0, 39026, // 11, 0 +10, 0, 6440, 10, 1, 9513, 11, 0, 8557, 11, 1, 41026, // 11, 1 +10, 1, 5891, 10, 2, 8559, 11, 1, 7981, 11, 2, 43105, // 11, 2 +10, 2, 5330, 10, 3, 7622, 11, 2, 7356, 11, 3, 45228, // 11, 3 +10, 3, 4774, 10, 4, 6727, 11, 3, 6708, 11, 4, 47327, // 11, 4 +10, 4, 4258, 10, 5, 5917, 11, 4, 6086, 11, 5, 49275, // 11, 5 +10, 5, 3837, 10, 6, 5261, 11, 5, 5573, 11, 6, 50865, // 11, 6 +10, 6, 3579, 10, 7, 4846, 11, 6, 5280, 11, 7, 51831, // 11, 7 +11, 7, 5283, 11, 8, 51842, 12, 7, 3575, 12, 8, 4836, // 11, 8 +11, 8, 5581, 11, 9, 50873, 12, 8, 3834, 12, 9, 5248, // 11, 9 +11, 9, 6099, 11, 10, 49279, 12, 9, 4257, 12, 10, 5901, // 11,10 +11, 10, 6727, 11, 11, 47328, 12, 10, 4774, 12, 11, 6707, // 11,11 +11, 11, 7382, 11, 12, 45224, 12, 11, 5331, 12, 12, 7599, // 11,12 +11, 12, 8015, 11, 13, 43096, 12, 12, 5895, 12, 13, 8530, // 11,13 +11, 13, 8599, 11, 14, 41013, 12, 13, 6447, 12, 14, 9477, // 11,14 +11, 14, 9122, 11, 15, 39009, 12, 14, 6975, 12, 15, 10430, // 11,15 +11, -1, 7276, 11, 0, 10723, 12, -1, 9585, 12, 0, 37952, // 12, 0 +11, 0, 6792, 11, 1, 9841, 12, 0, 9135, 12, 1, 39768, // 12, 1 +11, 1, 6297, 11, 2, 8979, 12, 1, 8641, 12, 2, 41619, // 12, 2 +11, 2, 5804, 11, 3, 8151, 12, 2, 8120, 12, 3, 43461, // 12, 3 +11, 3, 5331, 11, 4, 7382, 12, 3, 7598, 12, 4, 45225, // 12, 4 +11, 4, 4909, 11, 5, 6707, 12, 4, 7121, 12, 5, 46799, // 12, 5 +11, 5, 4576, 11, 6, 6173, 12, 5, 6750, 12, 6, 48037, // 12, 6 +11, 6, 4372, 11, 7, 5827, 12, 6, 6552, 12, 7, 48785, // 12, 7 +12, 7, 6558, 12, 8, 48801, 13, 7, 4366, 13, 8, 5811, // 12, 8 +12, 8, 6761, 12, 9, 48049, 13, 8, 4572, 13, 9, 6154, // 12, 9 +12, 9, 7138, 12, 10, 46806, 13, 9, 4906, 13, 10, 6686, // 12,10 +12, 10, 7622, 12, 11, 45229, 13, 10, 5330, 13, 11, 7355, // 12,11 +12, 11, 8151, 12, 12, 43461, 13, 11, 5804, 13, 12, 8120, // 12,12 +12, 12, 8681, 12, 13, 41614, 13, 12, 6299, 13, 13, 8942, // 12,13 +12, 13, 9184, 12, 14, 39759, 13, 13, 6797, 13, 14, 9796, // 12,14 +12, 14, 9642, 12, 15, 37939, 13, 14, 7285, 13, 15, 10670, // 12,15 +12, -1, 7620, 12, 0, 10994, 13, -1, 10158, 13, 0, 36764, // 13, 0 +12, 0, 7177, 12, 1, 10188, 13, 0, 9777, 13, 1, 38394, // 13, 1 +12, 1, 6732, 12, 2, 9413, 13, 1, 9366, 13, 2, 40025, // 13, 2 +12, 2, 6299, 12, 3, 8681, 13, 2, 8941, 13, 3, 41615, // 13, 3 +12, 3, 5895, 12, 4, 8015, 13, 3, 8530, 13, 4, 43096, // 13, 4 +12, 4, 5543, 12, 5, 7440, 13, 4, 8167, 13, 5, 44386, // 13, 5 +12, 5, 5268, 12, 6, 6986, 13, 5, 7899, 13, 6, 45383, // 13, 6 +12, 6, 5095, 12, 7, 6680, 13, 6, 7766, 13, 7, 45995, // 13, 7 +13, 7, 7773, 13, 8, 46017, 14, 7, 5087, 14, 8, 6659, // 13, 8 +13, 8, 7913, 13, 9, 45401, 14, 8, 5261, 14, 9, 6961, // 13, 9 +13, 9, 8189, 13, 10, 44399, 14, 9, 5537, 14, 10, 7411, // 13,10 +13, 10, 8559, 13, 11, 43105, 14, 10, 5891, 14, 11, 7981, // 13,11 +13, 11, 8979, 13, 12, 41618, 14, 11, 6297, 14, 12, 8642, // 13,12 +13, 12, 9413, 13, 13, 40025, 14, 12, 6732, 14, 13, 9366, // 13,13 +13, 13, 9834, 13, 14, 38390, 14, 13, 7179, 14, 14, 10133, // 13,14 +13, 14, 10224, 13, 15, 36756, 14, 14, 7626, 14, 15, 10930, // 13,15 +13, -1, 7983, 13, 0, 11267, 14, -1, 10780, 14, 0, 35506, // 14, 0 +13, 0, 7579, 13, 1, 10532, 14, 0, 10467, 14, 1, 36958, // 14, 1 +13, 1, 7179, 13, 2, 9834, 14, 1, 10133, 14, 2, 38390, // 14, 2 +13, 2, 6797, 13, 3, 9184, 14, 2, 9796, 14, 3, 39759, // 14, 3 +13, 3, 6447, 13, 4, 8599, 14, 3, 9478, 14, 4, 41012, // 14, 4 +13, 4, 6145, 13, 5, 8098, 14, 4, 9206, 14, 5, 42087, // 14, 5 +13, 5, 5910, 13, 6, 7699, 14, 5, 9014, 14, 6, 42913, // 14, 6 +13, 6, 5756, 13, 7, 7418, 14, 6, 8929, 14, 7, 43433, // 14, 7 +14, 7, 8939, 14, 8, 43461, 15, 7, 5745, 15, 8, 7391, // 14, 8 +14, 8, 9032, 14, 9, 42936, 15, 8, 5900, 15, 9, 7668, // 14, 9 +14, 9, 9233, 14, 10, 42105, 15, 9, 6137, 15, 10, 8061, // 14,10 +14, 10, 9513, 14, 11, 41026, 15, 10, 6440, 15, 11, 8557, // 14,11 +14, 11, 9841, 14, 12, 39767, 15, 11, 6792, 15, 12, 9136, // 14,12 +14, 12, 10188, 14, 13, 38394, 15, 12, 7177, 15, 13, 9777, // 14,13 +14, 13, 10532, 14, 14, 36959, 15, 13, 7579, 15, 14, 10466, // 14,14 +14, 14, 10855, 14, 15, 35502, 15, 14, 7987, 15, 15, 11192, // 14,15 +14, -1, 8358, 14, 0, 11526, 15, -1, 11440, 15, 0, 34212, // 15, 0 +14, 0, 7987, 14, 1, 10855, 15, 0, 11192, 15, 1, 35502, // 15, 1 +14, 1, 7626, 14, 2, 10224, 15, 1, 10930, 15, 2, 36756, // 15, 2 +14, 2, 7285, 14, 3, 9642, 15, 2, 10670, 15, 3, 37939, // 15, 3 +14, 3, 6975, 14, 4, 9122, 15, 3, 10430, 15, 4, 39009, // 15, 4 +14, 4, 6710, 14, 5, 8676, 15, 4, 10232, 15, 5, 39918, // 15, 5 +14, 5, 6502, 14, 6, 8316, 15, 5, 10100, 15, 6, 40618, // 15, 6 +14, 6, 6360, 14, 7, 8052, 15, 6, 10052, 15, 7, 41072, // 15, 7 +15, 7, 10066, 15, 8, 41106, 16, 7, 6346, 16, 8, 8018, // 15, 8 +15, 8, 10123, 15, 9, 40646, 16, 8, 6489, 16, 9, 8278, // 15, 9 +15, 9, 10265, 15, 10, 39940, 16, 9, 6699, 16, 10, 8632, // 15,10 +15, 10, 10473, 15, 11, 39026, 16, 10, 6965, 16, 11, 9072, // 15,11 +15, 11, 10723, 15, 12, 37951, 16, 11, 7276, 16, 12, 9586, // 15,12 +15, 12, 10994, 15, 13, 36764, 16, 12, 7620, 16, 13, 10158, // 15,13 +15, 13, 11267, 15, 14, 35506, 16, 13, 7983, 16, 14, 10780, // 15,14 +15, 14, 11526, 15, 15, 34212, 16, 14, 8358, 16, 15, 11440, // 15,15 +// angle of -1.0 degrees +-1, 0, 8769, -1, 1, 6280, 0, 0, 41693, 0, 1, 8794, // 0, 0 +-1, 1, 8265, -1, 2, 5974, 0, 1, 42823, 0, 2, 8474, // 0, 1 +-1, 2, 7791, -1, 3, 5682, 0, 2, 43904, 0, 3, 8159, // 0, 2 +-1, 3, 7356, -1, 4, 5410, 0, 3, 44907, 0, 4, 7863, // 0, 3 +-1, 4, 6970, -1, 5, 5169, 0, 4, 45799, 0, 5, 7598, // 0, 4 +-1, 5, 6644, -1, 6, 4967, 0, 5, 46541, 0, 6, 7384, // 0, 5 +-1, 6, 6391, -1, 7, 4814, 0, 6, 47098, 0, 7, 7233, // 0, 6 +-1, 7, 6217, -1, 8, 4718, 0, 7, 47440, 0, 8, 7161, // 0, 7 +0, 8, 47426, 0, 9, 7158, 1, 8, 6230, 1, 9, 4722, // 0, 8 +0, 9, 47086, 0, 10, 7227, 1, 9, 6405, 1, 10, 4818, // 0, 9 +0, 10, 46532, 0, 11, 7374, 1, 10, 6659, 1, 11, 4971, // 0,10 +0, 11, 45791, 0, 12, 7587, 1, 11, 6986, 1, 12, 5172, // 0,11 +0, 12, 44901, 0, 13, 7848, 1, 12, 7374, 1, 13, 5413, // 0,12 +0, 13, 43900, 0, 14, 8141, 1, 13, 7812, 1, 14, 5683, // 0,13 +0, 14, 42821, 0, 15, 8452, 1, 14, 8288, 1, 15, 5975, // 0,14 +0, 15, 41693, 0, 16, 8769, 1, 15, 8795, 1, 16, 6279, // 0,15 +0, 0, 8452, 0, 1, 5975, 1, 0, 42821, 1, 1, 8288, // 1, 0 +0, 1, 7901, 0, 2, 5640, 1, 1, 44074, 1, 2, 7921, // 1, 1 +0, 2, 7378, 0, 3, 5315, 1, 2, 45288, 1, 3, 7555, // 1, 2 +0, 3, 6892, 0, 4, 5009, 1, 3, 46430, 1, 4, 7205, // 1, 3 +0, 4, 6458, 0, 5, 4734, 1, 4, 47458, 1, 5, 6886, // 1, 4 +0, 5, 6092, 0, 6, 4502, 1, 5, 48322, 1, 6, 6620, // 1, 5 +0, 6, 5809, 0, 7, 4327, 1, 6, 48969, 1, 7, 6431, // 1, 6 +0, 7, 5623, 0, 8, 4221, 1, 7, 49358, 1, 8, 6334, // 1, 7 +1, 8, 49347, 1, 9, 6332, 2, 8, 5633, 2, 9, 4224, // 1, 8 +1, 9, 48960, 1, 10, 6425, 2, 9, 5820, 2, 10, 4331, // 1, 9 +1, 10, 48314, 1, 11, 6613, 2, 10, 6104, 2, 11, 4505, // 1,10 +1, 11, 47453, 1, 12, 6875, 2, 11, 6472, 2, 12, 4736, // 1,11 +1, 12, 46427, 1, 13, 7191, 2, 12, 6908, 2, 13, 5010, // 1,12 +1, 13, 45286, 1, 14, 7539, 2, 13, 7395, 2, 14, 5316, // 1,13 +1, 14, 44074, 1, 15, 7901, 2, 14, 7921, 2, 15, 5640, // 1,14 +1, 15, 42823, 1, 16, 8265, 2, 15, 8474, 2, 16, 5974, // 1,15 +1, 0, 8141, 1, 1, 5684, 2, 0, 43900, 2, 1, 7811, // 2, 0 +1, 1, 7539, 1, 2, 5316, 2, 1, 45286, 2, 2, 7395, // 2, 1 +1, 2, 6959, 1, 3, 4954, 2, 2, 46650, 2, 3, 6973, // 2, 2 +1, 3, 6414, 1, 4, 4607, 2, 3, 47955, 2, 4, 6560, // 2, 3 +1, 4, 5920, 1, 5, 4290, 2, 4, 49150, 2, 5, 6176, // 2, 4 +1, 5, 5499, 1, 6, 4019, 2, 5, 50171, 2, 6, 5847, // 2, 5 +1, 6, 5175, 1, 7, 3813, 2, 6, 50942, 2, 7, 5606, // 2, 6 +1, 7, 4970, 1, 8, 3691, 2, 7, 51395, 2, 8, 5480, // 2, 7 +2, 8, 51387, 2, 9, 5478, 3, 8, 4978, 3, 9, 3693, // 2, 8 +2, 9, 50935, 2, 10, 5602, 3, 9, 5184, 3, 10, 3815, // 2, 9 +2, 10, 50165, 2, 11, 5842, 3, 10, 5508, 3, 11, 4021, // 2,10 +2, 11, 49147, 2, 12, 6168, 3, 11, 5930, 3, 12, 4291, // 2,11 +2, 12, 47953, 2, 13, 6549, 3, 12, 6426, 3, 13, 4608, // 2,12 +2, 13, 46650, 2, 14, 6959, 3, 13, 6973, 3, 14, 4954, // 2,13 +2, 14, 45288, 2, 15, 7378, 3, 14, 7555, 3, 15, 5315, // 2,14 +2, 15, 43904, 2, 16, 7791, 3, 15, 8159, 3, 16, 5682, // 2,15 +2, 0, 7848, 2, 1, 5413, 3, 0, 44901, 3, 1, 7374, // 3, 0 +2, 1, 7191, 2, 2, 5011, 3, 1, 46427, 3, 2, 6907, // 3, 1 +2, 2, 6549, 2, 3, 4608, 3, 2, 47953, 3, 3, 6426, // 3, 2 +2, 3, 5934, 2, 4, 4214, 3, 3, 49445, 3, 4, 5943, // 3, 3 +2, 4, 5365, 2, 5, 3845, 3, 4, 50844, 3, 5, 5482, // 3, 4 +2, 5, 4872, 2, 6, 3522, 3, 5, 52069, 3, 6, 5073, // 3, 5 +2, 6, 4489, 2, 7, 3273, 3, 6, 53012, 3, 7, 4762, // 3, 6 +2, 7, 4254, 2, 8, 3126, 3, 7, 53562, 3, 8, 4594, // 3, 7 +3, 8, 53557, 3, 9, 4592, 4, 8, 4259, 4, 9, 3128, // 3, 8 +3, 9, 53008, 3, 10, 4759, 4, 9, 4495, 4, 10, 3274, // 3, 9 +3, 10, 52066, 3, 11, 5069, 4, 10, 4879, 4, 11, 3522, // 3,10 +3, 11, 50843, 3, 12, 5474, 4, 11, 5373, 4, 12, 3846, // 3,11 +3, 12, 49445, 3, 13, 5934, 4, 12, 5943, 4, 13, 4214, // 3,12 +3, 13, 47955, 3, 14, 6414, 4, 13, 6560, 4, 14, 4607, // 3,13 +3, 14, 46430, 3, 15, 6892, 4, 14, 7204, 4, 15, 5010, // 3,14 +3, 15, 44907, 3, 16, 7356, 4, 15, 7863, 4, 16, 5410, // 3,15 +3, 0, 7587, 3, 1, 5172, 4, 0, 45791, 4, 1, 6986, // 4, 0 +3, 1, 6875, 3, 2, 4736, 4, 1, 47453, 4, 2, 6472, // 4, 1 +3, 2, 6168, 3, 3, 4291, 4, 2, 49147, 4, 3, 5930, // 4, 2 +3, 3, 5474, 3, 4, 3846, 4, 3, 50843, 4, 4, 5373, // 4, 3 +3, 4, 4816, 3, 5, 3415, 4, 4, 52484, 4, 5, 4821, // 4, 4 +3, 5, 4226, 3, 6, 3023, 4, 5, 53975, 4, 6, 4312, // 4, 5 +3, 6, 3755, 3, 7, 2710, 4, 6, 55166, 4, 7, 3905, // 4, 6 +3, 7, 3469, 3, 8, 2524, 4, 7, 55870, 4, 8, 3673, // 4, 7 +4, 8, 55867, 4, 9, 3671, 5, 8, 3473, 5, 9, 2525, // 4, 8 +4, 9, 55164, 4, 10, 3902, 5, 9, 3759, 5, 10, 2711, // 4, 9 +4, 10, 53973, 4, 11, 4309, 5, 10, 4230, 5, 11, 3024, // 4,10 +4, 11, 52484, 4, 12, 4816, 5, 11, 4822, 5, 12, 3414, // 4,11 +4, 12, 50844, 4, 13, 5365, 5, 12, 5481, 5, 13, 3846, // 4,12 +4, 13, 49150, 4, 14, 5920, 5, 13, 6176, 5, 14, 4290, // 4,13 +4, 14, 47458, 4, 15, 6458, 5, 14, 6886, 5, 15, 4734, // 4,14 +4, 15, 45799, 4, 16, 6970, 5, 15, 7599, 5, 16, 5168, // 4,15 +4, 0, 7374, 4, 1, 4971, 5, 0, 46532, 5, 1, 6659, // 5, 0 +4, 1, 6613, 4, 2, 4505, 5, 1, 48314, 5, 2, 6104, // 5, 1 +4, 2, 5842, 4, 3, 4020, 5, 2, 50165, 5, 3, 5509, // 5, 2 +4, 3, 5069, 4, 4, 3523, 5, 3, 52066, 5, 4, 4878, // 5, 3 +4, 4, 4309, 4, 5, 3023, 5, 4, 53973, 5, 5, 4231, // 5, 4 +4, 5, 3595, 4, 6, 2546, 5, 5, 55798, 5, 6, 3597, // 5, 5 +4, 6, 2993, 4, 7, 2138, 5, 6, 57354, 5, 7, 3051, // 5, 6 +4, 7, 2615, 4, 8, 1884, 5, 7, 58324, 5, 8, 2713, // 5, 7 +5, 8, 58322, 5, 9, 2713, 6, 8, 2616, 6, 9, 1885, // 5, 8 +5, 9, 57353, 5, 10, 3050, 6, 9, 2995, 6, 10, 2138, // 5, 9 +5, 10, 55798, 5, 11, 3595, 6, 10, 3598, 6, 11, 2545, // 5,10 +5, 11, 53975, 5, 12, 4226, 6, 11, 4313, 6, 12, 3022, // 5,11 +5, 12, 52069, 5, 13, 4872, 6, 12, 5073, 6, 13, 3522, // 5,12 +5, 13, 50171, 5, 14, 5499, 6, 13, 5848, 6, 14, 4018, // 5,13 +5, 14, 48322, 5, 15, 6092, 6, 14, 6620, 6, 15, 4502, // 5,14 +5, 15, 46541, 5, 16, 6644, 6, 15, 7383, 6, 16, 4968, // 5,15 +5, 0, 7227, 5, 1, 4818, 6, 0, 47086, 6, 1, 6405, // 6, 0 +5, 1, 6425, 5, 2, 4330, 6, 1, 48960, 6, 2, 5821, // 6, 1 +5, 2, 5602, 5, 3, 3815, 6, 2, 50935, 6, 3, 5184, // 6, 2 +5, 3, 4759, 5, 4, 3274, 6, 3, 53008, 6, 4, 4495, // 6, 3 +5, 4, 3902, 5, 5, 2711, 6, 4, 55164, 6, 5, 3759, // 6, 4 +5, 5, 3050, 5, 6, 2138, 6, 5, 57353, 6, 6, 2995, // 6, 5 +5, 6, 2258, 5, 7, 1597, 6, 6, 59422, 6, 7, 2259, // 6, 6 +5, 7, 1695, 5, 8, 1209, 6, 7, 60906, 6, 8, 1726, // 6, 7 +6, 8, 60905, 6, 9, 1726, 7, 8, 1695, 7, 9, 1210, // 6, 8 +6, 9, 59422, 6, 10, 2258, 7, 9, 2259, 7, 10, 1597, // 6, 9 +6, 10, 57354, 6, 11, 2993, 7, 10, 3051, 7, 11, 2138, // 6,10 +6, 11, 55166, 6, 12, 3755, 7, 11, 3904, 7, 12, 2711, // 6,11 +6, 12, 53012, 6, 13, 4489, 7, 12, 4762, 7, 13, 3273, // 6,12 +6, 13, 50942, 6, 14, 5175, 7, 13, 5606, 7, 14, 3813, // 6,13 +6, 14, 48969, 6, 15, 5809, 7, 14, 6430, 7, 15, 4328, // 6,14 +6, 15, 47098, 6, 16, 6391, 7, 15, 7233, 7, 16, 4814, // 6,15 +6, 0, 7158, 6, 1, 4722, 7, 0, 47426, 7, 1, 6230, // 7, 0 +6, 1, 6332, 6, 2, 4224, 7, 1, 49347, 7, 2, 5633, // 7, 1 +6, 2, 5478, 6, 3, 3693, 7, 2, 51387, 7, 3, 4978, // 7, 2 +6, 3, 4592, 6, 4, 3128, 7, 3, 53557, 7, 4, 4259, // 7, 3 +6, 4, 3671, 6, 5, 2525, 7, 4, 55867, 7, 5, 3473, // 7, 4 +6, 5, 2713, 6, 6, 1884, 7, 5, 58322, 7, 6, 2617, // 7, 5 +6, 6, 1726, 6, 7, 1210, 7, 6, 60905, 7, 7, 1695, // 7, 6 +6, 7, 789, 6, 8, 558, 7, 7, 63399, 7, 8, 790, // 7, 7 +7, 8, 63399, 7, 9, 789, 8, 8, 789, 8, 9, 559, // 7, 8 +7, 9, 60906, 7, 10, 1695, 8, 9, 1726, 8, 10, 1209, // 7, 9 +7, 10, 58324, 7, 11, 2615, 8, 10, 2714, 8, 11, 1883, // 7,10 +7, 11, 55870, 7, 12, 3469, 8, 11, 3672, 8, 12, 2525, // 7,11 +7, 12, 53562, 7, 13, 4254, 8, 12, 4594, 8, 13, 3126, // 7,12 +7, 13, 51395, 7, 14, 4970, 8, 13, 5480, 8, 14, 3691, // 7,13 +7, 14, 49358, 7, 15, 5623, 8, 14, 6335, 8, 15, 4220, // 7,14 +7, 15, 47440, 7, 16, 6217, 8, 15, 7161, 8, 16, 4718, // 7,15 +7, -1, 4718, 7, 0, 7161, 8, -1, 6217, 8, 0, 47440, // 8, 0 +7, 0, 4221, 7, 1, 6335, 8, 0, 5623, 8, 1, 49357, // 8, 1 +7, 1, 3691, 7, 2, 5480, 8, 1, 4970, 8, 2, 51395, // 8, 2 +7, 2, 3126, 7, 3, 4594, 8, 2, 4254, 8, 3, 53562, // 8, 3 +7, 3, 2524, 7, 4, 3672, 8, 3, 3469, 8, 4, 55871, // 8, 4 +7, 4, 1884, 7, 5, 2714, 8, 4, 2615, 8, 5, 58323, // 8, 5 +7, 5, 1209, 7, 6, 1726, 8, 5, 1695, 8, 6, 60906, // 8, 6 +7, 6, 558, 7, 7, 789, 8, 6, 789, 8, 7, 63400, // 8, 7 +8, 7, 789, 8, 8, 63399, 9, 7, 558, 9, 8, 790, // 8, 8 +8, 8, 1695, 8, 9, 60905, 9, 8, 1210, 9, 9, 1726, // 8, 9 +8, 9, 2616, 8, 10, 58322, 9, 9, 1884, 9, 10, 2714, // 8,10 +8, 10, 3473, 8, 11, 55867, 9, 10, 2525, 9, 11, 3671, // 8,11 +8, 11, 4259, 8, 12, 53557, 9, 11, 3128, 9, 12, 4592, // 8,12 +8, 12, 4978, 8, 13, 51387, 9, 12, 3693, 9, 13, 5478, // 8,13 +8, 13, 5633, 8, 14, 49347, 9, 13, 4224, 9, 14, 6332, // 8,14 +8, 14, 6230, 8, 15, 47426, 9, 14, 4722, 9, 15, 7158, // 8,15 +8, -1, 4814, 8, 0, 7233, 9, -1, 6391, 9, 0, 47098, // 9, 0 +8, 0, 4327, 8, 1, 6430, 9, 0, 5809, 9, 1, 48970, // 9, 1 +8, 1, 3813, 8, 2, 5606, 9, 1, 5175, 9, 2, 50942, // 9, 2 +8, 2, 3273, 8, 3, 4762, 9, 2, 4489, 9, 3, 53012, // 9, 3 +8, 3, 2710, 8, 4, 3904, 9, 3, 3755, 9, 4, 55167, // 9, 4 +8, 4, 2138, 8, 5, 3051, 9, 4, 2993, 9, 5, 57354, // 9, 5 +8, 5, 1597, 8, 6, 2259, 9, 5, 2258, 9, 6, 59422, // 9, 6 +8, 6, 1210, 8, 7, 1695, 9, 6, 1726, 9, 7, 60905, // 9, 7 +9, 7, 1726, 9, 8, 60906, 10, 7, 1209, 10, 8, 1695, // 9, 8 +9, 8, 2259, 9, 9, 59422, 10, 8, 1597, 10, 9, 2258, // 9, 9 +9, 9, 2995, 9, 10, 57353, 10, 9, 2138, 10, 10, 3050, // 9,10 +9, 10, 3759, 9, 11, 55164, 10, 10, 2711, 10, 11, 3902, // 9,11 +9, 11, 4495, 9, 12, 53008, 10, 11, 3274, 10, 12, 4759, // 9,12 +9, 12, 5184, 9, 13, 50935, 10, 12, 3815, 10, 13, 5602, // 9,13 +9, 13, 5820, 9, 14, 48960, 10, 13, 4330, 10, 14, 6426, // 9,14 +9, 14, 6405, 9, 15, 47086, 10, 14, 4818, 10, 15, 7227, // 9,15 +9, -1, 4967, 9, 0, 7383, 10, -1, 6644, 10, 0, 46542, // 10, 0 +9, 0, 4502, 9, 1, 6620, 10, 0, 6092, 10, 1, 48322, // 10, 1 +9, 1, 4019, 9, 2, 5848, 10, 1, 5499, 10, 2, 50170, // 10, 2 +9, 2, 3522, 9, 3, 5073, 10, 2, 4872, 10, 3, 52069, // 10, 3 +9, 3, 3023, 9, 4, 4313, 10, 3, 4226, 10, 4, 53974, // 10, 4 +9, 4, 2546, 9, 5, 3598, 10, 4, 3595, 10, 5, 55797, // 10, 5 +9, 5, 2138, 9, 6, 2995, 10, 5, 3050, 10, 6, 57353, // 10, 6 +9, 6, 1884, 9, 7, 2616, 10, 6, 2713, 10, 7, 58323, // 10, 7 +10, 7, 2714, 10, 8, 58324, 11, 7, 1884, 11, 8, 2614, // 10, 8 +10, 8, 3051, 10, 9, 57354, 11, 8, 2138, 11, 9, 2993, // 10, 9 +10, 9, 3598, 10, 10, 55798, 11, 9, 2546, 11, 10, 3594, // 10,10 +10, 10, 4230, 10, 11, 53973, 11, 10, 3023, 11, 11, 4310, // 10,11 +10, 11, 4879, 10, 12, 52066, 11, 11, 3523, 11, 12, 5068, // 10,12 +10, 12, 5508, 10, 13, 50165, 11, 12, 4020, 11, 13, 5843, // 10,13 +10, 13, 6104, 10, 14, 48314, 11, 13, 4505, 11, 14, 6613, // 10,14 +10, 14, 6659, 10, 15, 46532, 11, 14, 4971, 11, 15, 7374, // 10,15 +10, -1, 5169, 10, 0, 7599, 11, -1, 6970, 11, 0, 45798, // 11, 0 +10, 0, 4734, 10, 1, 6886, 11, 0, 6458, 11, 1, 47458, // 11, 1 +10, 1, 4290, 10, 2, 6176, 11, 1, 5920, 11, 2, 49150, // 11, 2 +10, 2, 3845, 10, 3, 5481, 11, 2, 5365, 11, 3, 50845, // 11, 3 +10, 3, 3415, 10, 4, 4822, 11, 3, 4816, 11, 4, 52483, // 11, 4 +10, 4, 3023, 10, 5, 4230, 11, 4, 4309, 11, 5, 53974, // 11, 5 +10, 5, 2711, 10, 6, 3759, 11, 5, 3902, 11, 6, 55164, // 11, 6 +10, 6, 2525, 10, 7, 3473, 11, 6, 3671, 11, 7, 55867, // 11, 7 +11, 7, 3672, 11, 8, 55870, 12, 7, 2524, 12, 8, 3470, // 11, 8 +11, 8, 3904, 11, 9, 55166, 12, 8, 2710, 12, 9, 3756, // 11, 9 +11, 9, 4313, 11, 10, 53975, 12, 9, 3023, 12, 10, 4225, // 11,10 +11, 10, 4822, 11, 11, 52484, 12, 10, 3415, 12, 11, 4815, // 11,11 +11, 11, 5373, 11, 12, 50843, 12, 11, 3846, 12, 12, 5474, // 11,12 +11, 12, 5930, 11, 13, 49147, 12, 12, 4291, 12, 13, 6168, // 11,13 +11, 13, 6472, 11, 14, 47453, 12, 13, 4736, 12, 14, 6875, // 11,14 +11, 14, 6986, 11, 15, 45791, 12, 14, 5172, 12, 15, 7587, // 11,15 +11, -1, 5410, 11, 0, 7863, 12, -1, 7356, 12, 0, 44907, // 12, 0 +11, 0, 5009, 11, 1, 7204, 12, 0, 6892, 12, 1, 46431, // 12, 1 +11, 1, 4607, 11, 2, 6560, 12, 1, 6414, 12, 2, 47955, // 12, 2 +11, 2, 4214, 11, 3, 5943, 12, 2, 5934, 12, 3, 49445, // 12, 3 +11, 3, 3846, 11, 4, 5373, 12, 3, 5474, 12, 4, 50843, // 12, 4 +11, 4, 3523, 11, 5, 4879, 12, 4, 5069, 12, 5, 52065, // 12, 5 +11, 5, 3274, 11, 6, 4495, 12, 5, 4759, 12, 6, 53008, // 12, 6 +11, 6, 3128, 11, 7, 4259, 12, 6, 4592, 12, 7, 53557, // 12, 7 +12, 7, 4594, 12, 8, 53562, 13, 7, 3126, 13, 8, 4254, // 12, 8 +12, 8, 4762, 12, 9, 53012, 13, 8, 3273, 13, 9, 4489, // 12, 9 +12, 9, 5073, 12, 10, 52069, 13, 9, 3522, 13, 10, 4872, // 12,10 +12, 10, 5481, 12, 11, 50844, 13, 10, 3845, 13, 11, 5366, // 12,11 +12, 11, 5943, 12, 12, 49445, 13, 11, 4214, 13, 12, 5934, // 12,12 +12, 12, 6426, 12, 13, 47953, 13, 12, 4608, 13, 13, 6549, // 12,13 +12, 13, 6908, 12, 14, 46427, 13, 13, 5011, 13, 14, 7190, // 12,14 +12, 14, 7374, 12, 15, 44901, 13, 14, 5413, 13, 15, 7848, // 12,15 +12, -1, 5682, 12, 0, 8159, 13, -1, 7791, 13, 0, 43904, // 13, 0 +12, 0, 5315, 12, 1, 7555, 13, 0, 7378, 13, 1, 45288, // 13, 1 +12, 1, 4954, 12, 2, 6973, 13, 1, 6959, 13, 2, 46650, // 13, 2 +12, 2, 4608, 12, 3, 6426, 13, 2, 6549, 13, 3, 47953, // 13, 3 +12, 3, 4291, 12, 4, 5930, 13, 3, 6168, 13, 4, 49147, // 13, 4 +12, 4, 4020, 12, 5, 5508, 13, 4, 5842, 13, 5, 50166, // 13, 5 +12, 5, 3815, 12, 6, 5184, 13, 5, 5602, 13, 6, 50935, // 13, 6 +12, 6, 3693, 12, 7, 4978, 13, 6, 5478, 13, 7, 51387, // 13, 7 +13, 7, 5480, 13, 8, 51395, 14, 7, 3691, 14, 8, 4970, // 13, 8 +13, 8, 5606, 13, 9, 50942, 14, 8, 3813, 14, 9, 5175, // 13, 9 +13, 9, 5848, 13, 10, 50171, 14, 9, 4019, 14, 10, 5498, // 13,10 +13, 10, 6176, 13, 11, 49150, 14, 10, 4290, 14, 11, 5920, // 13,11 +13, 11, 6560, 13, 12, 47955, 14, 11, 4607, 14, 12, 6414, // 13,12 +13, 12, 6973, 13, 13, 46650, 14, 12, 4954, 14, 13, 6959, // 13,13 +13, 13, 7395, 13, 14, 45286, 14, 13, 5316, 14, 14, 7539, // 13,14 +13, 14, 7812, 13, 15, 43900, 14, 14, 5684, 14, 15, 8140, // 13,15 +13, -1, 5974, 13, 0, 8474, 14, -1, 8265, 14, 0, 42823, // 14, 0 +13, 0, 5640, 13, 1, 7921, 14, 0, 7901, 14, 1, 44074, // 14, 1 +13, 1, 5316, 13, 2, 7395, 14, 1, 7539, 14, 2, 45286, // 14, 2 +13, 2, 5011, 13, 3, 6908, 14, 2, 7191, 14, 3, 46426, // 14, 3 +13, 3, 4736, 13, 4, 6472, 14, 3, 6875, 14, 4, 47453, // 14, 4 +13, 4, 4505, 13, 5, 6104, 14, 4, 6613, 14, 5, 48314, // 14, 5 +13, 5, 4330, 13, 6, 5820, 14, 5, 6425, 14, 6, 48961, // 14, 6 +13, 6, 4224, 13, 7, 5633, 14, 6, 6332, 14, 7, 49347, // 14, 7 +14, 7, 6335, 14, 8, 49358, 15, 7, 4221, 15, 8, 5622, // 14, 8 +14, 8, 6430, 14, 9, 48969, 15, 8, 4327, 15, 9, 5810, // 14, 9 +14, 9, 6620, 14, 10, 48322, 15, 9, 4502, 15, 10, 6092, // 14,10 +14, 10, 6886, 14, 11, 47458, 15, 10, 4734, 15, 11, 6458, // 14,11 +14, 11, 7204, 14, 12, 46430, 15, 11, 5009, 15, 12, 6893, // 14,12 +14, 12, 7555, 14, 13, 45288, 15, 12, 5315, 15, 13, 7378, // 14,13 +14, 13, 7921, 14, 14, 44074, 15, 13, 5640, 15, 14, 7901, // 14,14 +14, 14, 8288, 14, 15, 42821, 15, 14, 5975, 15, 15, 8452, // 14,15 +14, -1, 6280, 14, 0, 8795, 15, -1, 8769, 15, 0, 41692, // 15, 0 +14, 0, 5975, 14, 1, 8288, 15, 0, 8452, 15, 1, 42821, // 15, 1 +14, 1, 5684, 14, 2, 7812, 15, 1, 8141, 15, 2, 43899, // 15, 2 +14, 2, 5413, 14, 3, 7374, 15, 2, 7848, 15, 3, 44901, // 15, 3 +14, 3, 5172, 14, 4, 6986, 15, 3, 7587, 15, 4, 45791, // 15, 4 +14, 4, 4971, 14, 5, 6659, 15, 4, 7374, 15, 5, 46532, // 15, 5 +14, 5, 4818, 14, 6, 6405, 15, 5, 7227, 15, 6, 47086, // 15, 6 +14, 6, 4722, 14, 7, 6230, 15, 6, 7158, 15, 7, 47426, // 15, 7 +15, 7, 7161, 15, 8, 47440, 16, 7, 4718, 16, 8, 6217, // 15, 8 +15, 8, 7233, 15, 9, 47098, 16, 8, 4814, 16, 9, 6391, // 15, 9 +15, 9, 7383, 15, 10, 46541, 16, 9, 4967, 16, 10, 6645, // 15,10 +15, 10, 7599, 15, 11, 45799, 16, 10, 5169, 16, 11, 6969, // 15,11 +15, 11, 7863, 15, 12, 44907, 16, 11, 5410, 16, 12, 7356, // 15,12 +15, 12, 8159, 15, 13, 43904, 16, 12, 5682, 16, 13, 7791, // 15,13 +15, 13, 8474, 15, 14, 42823, 16, 13, 5974, 16, 14, 8265, // 15,14 +15, 14, 8795, 15, 15, 41693, 16, 14, 6280, 16, 15, 8768, // 15,15 +// angle of -0.5 degrees +-1, 0, 5106, -1, 1, 3621, 0, 0, 51699, 0, 1, 5110, // 0, 0 +-1, 1, 4803, -1, 2, 3421, 0, 1, 52457, 0, 2, 4855, // 0, 1 +-1, 2, 4521, -1, 3, 3235, 0, 2, 53168, 0, 3, 4612, // 0, 2 +-1, 3, 4264, -1, 4, 3064, 0, 3, 53815, 0, 4, 4393, // 0, 3 +-1, 4, 4041, -1, 5, 2916, 0, 4, 54378, 0, 5, 4201, // 0, 4 +-1, 5, 3858, -1, 6, 2796, 0, 5, 54835, 0, 6, 4047, // 0, 5 +-1, 6, 3722, -1, 7, 2709, 0, 6, 55166, 0, 7, 3939, // 0, 6 +-1, 7, 3638, -1, 8, 2659, 0, 7, 55354, 0, 8, 3885, // 0, 7 +0, 8, 55352, 0, 9, 3885, 1, 8, 3640, 1, 9, 2659, // 0, 8 +0, 9, 55164, 0, 10, 3939, 1, 9, 3724, 1, 10, 2709, // 0, 9 +0, 10, 54833, 0, 11, 4046, 1, 10, 3860, 1, 11, 2797, // 0,10 +0, 11, 54376, 0, 12, 4200, 1, 11, 4043, 1, 12, 2917, // 0,11 +0, 12, 53814, 0, 13, 4390, 1, 12, 4267, 1, 13, 3065, // 0,12 +0, 13, 53168, 0, 14, 4610, 1, 13, 4523, 1, 14, 3235, // 0,13 +0, 14, 52457, 0, 15, 4851, 1, 14, 4806, 1, 15, 3422, // 0,14 +0, 15, 51699, 0, 16, 5106, 1, 15, 5110, 1, 16, 3621, // 0,15 +0, 0, 4851, 0, 1, 3422, 1, 0, 52457, 1, 1, 4806, // 1, 0 +0, 1, 4522, 0, 2, 3204, 1, 1, 53285, 1, 2, 4525, // 1, 1 +0, 2, 4212, 0, 3, 2998, 1, 2, 54072, 1, 3, 4254, // 1, 2 +0, 3, 3927, 0, 4, 2808, 1, 3, 54796, 1, 4, 4005, // 1, 3 +0, 4, 3677, 0, 5, 2640, 1, 4, 55435, 1, 5, 3784, // 1, 4 +0, 5, 3470, 0, 6, 2502, 1, 5, 55959, 1, 6, 3605, // 1, 5 +0, 6, 3317, 0, 7, 2402, 1, 6, 56340, 1, 7, 3477, // 1, 6 +0, 7, 3225, 0, 8, 2346, 1, 7, 56554, 1, 8, 3411, // 1, 7 +1, 8, 56552, 1, 9, 3411, 2, 8, 3227, 2, 9, 2346, // 1, 8 +1, 9, 56339, 1, 10, 3476, 2, 9, 3319, 2, 10, 2402, // 1, 9 +1, 10, 55958, 1, 11, 3604, 2, 10, 3472, 2, 11, 2502, // 1,10 +1, 11, 55434, 1, 12, 3783, 2, 11, 3678, 2, 12, 2641, // 1,11 +1, 12, 54796, 1, 13, 4003, 2, 12, 3929, 2, 13, 2808, // 1,12 +1, 13, 54071, 1, 14, 4253, 2, 13, 4214, 2, 14, 2998, // 1,13 +1, 14, 53285, 1, 15, 4522, 2, 14, 4525, 2, 15, 3204, // 1,14 +1, 15, 52457, 1, 16, 4803, 2, 15, 4854, 2, 16, 3422, // 1,15 +1, 0, 4610, 1, 1, 3235, 2, 0, 53168, 2, 1, 4523, // 2, 0 +1, 1, 4253, 1, 2, 2998, 2, 1, 54071, 2, 2, 4214, // 2, 1 +1, 2, 3911, 1, 3, 2770, 2, 2, 54941, 2, 3, 3914, // 2, 2 +1, 3, 3594, 1, 4, 2556, 2, 3, 55756, 2, 4, 3630, // 2, 3 +1, 4, 3310, 1, 5, 2365, 2, 4, 56487, 2, 5, 3374, // 2, 4 +1, 5, 3073, 1, 6, 2205, 2, 5, 57096, 2, 6, 3162, // 2, 5 +1, 6, 2897, 1, 7, 2088, 2, 6, 57545, 2, 7, 3006, // 2, 6 +1, 7, 2794, 1, 8, 2022, 2, 7, 57795, 2, 8, 2925, // 2, 7 +2, 8, 57793, 2, 9, 2926, 3, 8, 2795, 3, 9, 2022, // 2, 8 +2, 9, 57544, 2, 10, 3007, 3, 9, 2898, 3, 10, 2087, // 2, 9 +2, 10, 57095, 2, 11, 3161, 3, 10, 3074, 3, 11, 2206, // 2,10 +2, 11, 56486, 2, 12, 3373, 3, 11, 3311, 3, 12, 2366, // 2,11 +2, 12, 55756, 2, 13, 3628, 3, 12, 3595, 3, 13, 2557, // 2,12 +2, 13, 54941, 2, 14, 3911, 3, 13, 3913, 3, 14, 2771, // 2,13 +2, 14, 54072, 2, 15, 4212, 3, 14, 4255, 3, 15, 2997, // 2,14 +2, 15, 53168, 2, 16, 4521, 3, 15, 4612, 3, 16, 3235, // 2,15 +2, 0, 4390, 2, 1, 3065, 3, 0, 53814, 3, 1, 4267, // 3, 0 +2, 1, 4003, 2, 2, 2808, 3, 1, 54796, 3, 2, 3929, // 3, 1 +2, 2, 3628, 2, 3, 2557, 3, 2, 55756, 3, 3, 3595, // 3, 2 +2, 3, 3273, 2, 4, 2317, 3, 3, 56673, 3, 4, 3273, // 3, 3 +2, 4, 2948, 2, 5, 2096, 3, 4, 57514, 3, 5, 2978, // 3, 4 +2, 5, 2672, 2, 6, 1908, 3, 5, 58234, 3, 6, 2722, // 3, 5 +2, 6, 2463, 2, 7, 1766, 3, 6, 58775, 3, 7, 2532, // 3, 6 +2, 7, 2342, 2, 8, 1687, 3, 7, 59077, 3, 8, 2430, // 3, 7 +3, 8, 59076, 3, 9, 2430, 4, 8, 2343, 4, 9, 1687, // 3, 8 +3, 9, 58774, 3, 10, 2532, 4, 9, 2464, 4, 10, 1766, // 3, 9 +3, 10, 58233, 3, 11, 2722, 4, 10, 2673, 4, 11, 1908, // 3,10 +3, 11, 57514, 3, 12, 2976, 4, 11, 2950, 4, 12, 2096, // 3,11 +3, 12, 56673, 3, 13, 3273, 4, 12, 3274, 4, 13, 2316, // 3,12 +3, 13, 55756, 3, 14, 3594, 4, 13, 3630, 4, 14, 2556, // 3,13 +3, 14, 54796, 3, 15, 3927, 4, 14, 4005, 4, 15, 2808, // 3,14 +3, 15, 53815, 3, 16, 4264, 4, 15, 4392, 4, 16, 3065, // 3,15 +3, 0, 4200, 3, 1, 2917, 4, 0, 54376, 4, 1, 4043, // 4, 0 +3, 1, 3783, 3, 2, 2640, 4, 1, 55434, 4, 2, 3679, // 4, 1 +3, 2, 3373, 3, 3, 2365, 4, 2, 56486, 4, 3, 3312, // 4, 2 +3, 3, 2976, 3, 4, 2096, 4, 3, 57514, 4, 4, 2950, // 4, 3 +3, 4, 2604, 3, 5, 1843, 4, 4, 58484, 4, 5, 2605, // 4, 4 +3, 5, 2276, 3, 6, 1617, 4, 5, 59346, 4, 6, 2297, // 4, 5 +3, 6, 2020, 3, 7, 1442, 4, 6, 60018, 4, 7, 2056, // 4, 6 +3, 7, 1871, 3, 8, 1341, 4, 7, 60402, 4, 8, 1922, // 4, 7 +4, 8, 60402, 4, 9, 1922, 5, 8, 1871, 5, 9, 1341, // 4, 8 +4, 9, 60017, 4, 10, 2057, 5, 9, 2020, 5, 10, 1442, // 4, 9 +4, 10, 59345, 4, 11, 2297, 5, 10, 2276, 5, 11, 1618, // 4,10 +4, 11, 58484, 4, 12, 2604, 5, 11, 2605, 5, 12, 1843, // 4,11 +4, 12, 57514, 4, 13, 2948, 5, 12, 2977, 5, 13, 2097, // 4,12 +4, 13, 56487, 4, 14, 3310, 5, 13, 3374, 5, 14, 2365, // 4,13 +4, 14, 55435, 4, 15, 3677, 5, 14, 3785, 5, 15, 2639, // 4,14 +4, 15, 54378, 4, 16, 4041, 5, 15, 4201, 5, 16, 2916, // 4,15 +4, 0, 4046, 4, 1, 2797, 5, 0, 54833, 5, 1, 3860, // 5, 0 +4, 1, 3604, 4, 2, 2503, 5, 1, 55958, 5, 2, 3471, // 5, 1 +4, 2, 3161, 4, 3, 2205, 5, 2, 57095, 5, 3, 3075, // 5, 2 +4, 3, 2722, 4, 4, 1908, 5, 3, 58233, 5, 4, 2673, // 5, 3 +4, 4, 2297, 4, 5, 1617, 5, 4, 59345, 5, 5, 2277, // 5, 4 +4, 5, 1904, 4, 6, 1347, 5, 5, 60381, 5, 6, 1904, // 5, 5 +4, 6, 1578, 4, 7, 1121, 5, 6, 61243, 5, 7, 1594, // 5, 6 +4, 7, 1380, 4, 8, 985, 5, 7, 61767, 5, 8, 1404, // 5, 7 +5, 8, 61767, 5, 9, 1405, 6, 8, 1380, 6, 9, 984, // 5, 8 +5, 9, 61243, 5, 10, 1593, 6, 9, 1579, 6, 10, 1121, // 5, 9 +5, 10, 60381, 5, 11, 1904, 6, 10, 1904, 6, 11, 1347, // 5,10 +5, 11, 59346, 5, 12, 2276, 6, 11, 2297, 6, 12, 1617, // 5,11 +5, 12, 58234, 5, 13, 2672, 6, 12, 2723, 6, 13, 1907, // 5,12 +5, 13, 57096, 5, 14, 3073, 6, 13, 3161, 6, 14, 2206, // 5,13 +5, 14, 55959, 5, 15, 3470, 6, 14, 3605, 6, 15, 2502, // 5,14 +5, 15, 54835, 5, 16, 3858, 6, 15, 4047, 6, 16, 2796, // 5,15 +5, 0, 3939, 5, 1, 2709, 6, 0, 55164, 6, 1, 3724, // 6, 0 +5, 1, 3476, 5, 2, 2403, 6, 1, 56339, 6, 2, 3318, // 6, 1 +5, 2, 3007, 5, 3, 2088, 6, 2, 57544, 6, 3, 2897, // 6, 2 +5, 3, 2532, 5, 4, 1767, 6, 3, 58774, 6, 4, 2463, // 6, 3 +5, 4, 2057, 5, 5, 1442, 6, 4, 60017, 6, 5, 2020, // 6, 4 +5, 5, 1593, 5, 6, 1121, 6, 5, 61243, 6, 6, 1579, // 6, 5 +5, 6, 1170, 5, 7, 827, 6, 6, 62369, 6, 7, 1170, // 6, 6 +5, 7, 875, 5, 8, 622, 6, 7, 63156, 6, 8, 883, // 6, 7 +6, 8, 63156, 6, 9, 883, 7, 8, 875, 7, 9, 622, // 6, 8 +6, 9, 62369, 6, 10, 1170, 7, 9, 1170, 7, 10, 827, // 6, 9 +6, 10, 61243, 6, 11, 1578, 7, 10, 1593, 7, 11, 1122, // 6,10 +6, 11, 60018, 6, 12, 2020, 7, 11, 2057, 7, 12, 1441, // 6,11 +6, 12, 58775, 6, 13, 2463, 7, 12, 2532, 7, 13, 1766, // 6,12 +6, 13, 57545, 6, 14, 2897, 7, 13, 3007, 7, 14, 2087, // 6,13 +6, 14, 56340, 6, 15, 3317, 7, 14, 3477, 7, 15, 2402, // 6,14 +6, 15, 55166, 6, 16, 3722, 7, 15, 3940, 7, 16, 2708, // 6,15 +6, 0, 3885, 6, 1, 2659, 7, 0, 55352, 7, 1, 3640, // 7, 0 +6, 1, 3411, 6, 2, 2346, 7, 1, 56552, 7, 2, 3227, // 7, 1 +6, 2, 2926, 6, 3, 2022, 7, 2, 57793, 7, 3, 2795, // 7, 2 +6, 3, 2430, 6, 4, 1687, 7, 3, 59076, 7, 4, 2343, // 7, 3 +6, 4, 1922, 6, 5, 1341, 7, 4, 60402, 7, 5, 1871, // 7, 4 +6, 5, 1405, 6, 6, 985, 7, 5, 61767, 7, 6, 1379, // 7, 5 +6, 6, 883, 6, 7, 622, 7, 6, 63156, 7, 7, 875, // 7, 6 +6, 7, 399, 6, 8, 282, 7, 7, 64455, 7, 8, 400, // 7, 7 +7, 8, 64455, 7, 9, 399, 8, 8, 399, 8, 9, 283, // 7, 8 +7, 9, 63156, 7, 10, 875, 8, 9, 883, 8, 10, 622, // 7, 9 +7, 10, 61767, 7, 11, 1380, 8, 10, 1405, 8, 11, 984, // 7,10 +7, 11, 60402, 7, 12, 1871, 8, 11, 1922, 8, 12, 1341, // 7,11 +7, 12, 59077, 7, 13, 2342, 8, 12, 2430, 8, 13, 1687, // 7,12 +7, 13, 57795, 7, 14, 2794, 8, 13, 2926, 8, 14, 2021, // 7,13 +7, 14, 56554, 7, 15, 3225, 8, 14, 3411, 8, 15, 2346, // 7,14 +7, 15, 55354, 7, 16, 3638, 8, 15, 3885, 8, 16, 2659, // 7,15 +7, -1, 2659, 7, 0, 3885, 8, -1, 3638, 8, 0, 55354, // 8, 0 +7, 0, 2346, 7, 1, 3411, 8, 0, 3225, 8, 1, 56554, // 8, 1 +7, 1, 2022, 7, 2, 2926, 8, 1, 2794, 8, 2, 57794, // 8, 2 +7, 2, 1687, 7, 3, 2430, 8, 2, 2342, 8, 3, 59077, // 8, 3 +7, 3, 1341, 7, 4, 1922, 8, 3, 1871, 8, 4, 60402, // 8, 4 +7, 4, 985, 7, 5, 1405, 8, 4, 1380, 8, 5, 61766, // 8, 5 +7, 5, 622, 7, 6, 883, 8, 5, 875, 8, 6, 63156, // 8, 6 +7, 6, 282, 7, 7, 399, 8, 6, 399, 8, 7, 64456, // 8, 7 +8, 7, 399, 8, 8, 64455, 9, 7, 282, 9, 8, 400, // 8, 8 +8, 8, 875, 8, 9, 63156, 9, 8, 622, 9, 9, 883, // 8, 9 +8, 9, 1380, 8, 10, 61767, 9, 9, 985, 9, 10, 1404, // 8,10 +8, 10, 1871, 8, 11, 60402, 9, 10, 1341, 9, 11, 1922, // 8,11 +8, 11, 2343, 8, 12, 59076, 9, 11, 1687, 9, 12, 2430, // 8,12 +8, 12, 2795, 8, 13, 57793, 9, 12, 2022, 9, 13, 2926, // 8,13 +8, 13, 3227, 8, 14, 56552, 9, 13, 2346, 9, 14, 3411, // 8,14 +8, 14, 3640, 8, 15, 55352, 9, 14, 2659, 9, 15, 3885, // 8,15 +8, -1, 2709, 8, 0, 3940, 9, -1, 3722, 9, 0, 55165, // 9, 0 +8, 0, 2402, 8, 1, 3477, 9, 0, 3317, 9, 1, 56340, // 9, 1 +8, 1, 2088, 8, 2, 3007, 9, 1, 2897, 9, 2, 57544, // 9, 2 +8, 2, 1766, 8, 3, 2532, 9, 2, 2463, 9, 3, 58775, // 9, 3 +8, 3, 1442, 8, 4, 2057, 9, 3, 2020, 9, 4, 60017, // 9, 4 +8, 4, 1121, 8, 5, 1593, 9, 4, 1578, 9, 5, 61244, // 9, 5 +8, 5, 827, 8, 6, 1170, 9, 5, 1170, 9, 6, 62369, // 9, 6 +8, 6, 622, 8, 7, 875, 9, 6, 883, 9, 7, 63156, // 9, 7 +9, 7, 883, 9, 8, 63156, 10, 7, 622, 10, 8, 875, // 9, 8 +9, 8, 1170, 9, 9, 62369, 10, 8, 827, 10, 9, 1170, // 9, 9 +9, 9, 1579, 9, 10, 61243, 10, 9, 1121, 10, 10, 1593, // 9,10 +9, 10, 2020, 9, 11, 60017, 10, 10, 1442, 10, 11, 2057, // 9,11 +9, 11, 2464, 9, 12, 58774, 10, 11, 1767, 10, 12, 2531, // 9,12 +9, 12, 2898, 9, 13, 57544, 10, 12, 2088, 10, 13, 3006, // 9,13 +9, 13, 3319, 9, 14, 56339, 10, 13, 2403, 10, 14, 3475, // 9,14 +9, 14, 3724, 9, 15, 55164, 10, 14, 2709, 10, 15, 3939, // 9,15 +9, -1, 2796, 9, 0, 4047, 10, -1, 3858, 10, 0, 54835, // 10, 0 +9, 0, 2502, 9, 1, 3605, 10, 0, 3470, 10, 1, 55959, // 10, 1 +9, 1, 2205, 9, 2, 3161, 10, 1, 3073, 10, 2, 57097, // 10, 2 +9, 2, 1908, 9, 3, 2723, 10, 2, 2672, 10, 3, 58233, // 10, 3 +9, 3, 1617, 9, 4, 2297, 10, 3, 2276, 10, 4, 59346, // 10, 4 +9, 4, 1347, 9, 5, 1904, 10, 4, 1904, 10, 5, 60381, // 10, 5 +9, 5, 1121, 9, 6, 1579, 10, 5, 1593, 10, 6, 61243, // 10, 6 +9, 6, 985, 9, 7, 1380, 10, 6, 1405, 10, 7, 61766, // 10, 7 +10, 7, 1405, 10, 8, 61767, 11, 7, 985, 11, 8, 1379, // 10, 8 +10, 8, 1593, 10, 9, 61243, 11, 8, 1121, 11, 9, 1579, // 10, 9 +10, 9, 1904, 10, 10, 60381, 11, 9, 1347, 11, 10, 1904, // 10,10 +10, 10, 2276, 10, 11, 59345, 11, 10, 1617, 11, 11, 2298, // 10,11 +10, 11, 2673, 10, 12, 58233, 11, 11, 1908, 11, 12, 2722, // 10,12 +10, 12, 3074, 10, 13, 57095, 11, 12, 2205, 11, 13, 3162, // 10,13 +10, 13, 3472, 10, 14, 55958, 11, 13, 2503, 11, 14, 3603, // 10,14 +10, 14, 3860, 10, 15, 54833, 11, 14, 2797, 11, 15, 4046, // 10,15 +10, -1, 2916, 10, 0, 4201, 11, -1, 4041, 11, 0, 54378, // 11, 0 +10, 0, 2640, 10, 1, 3785, 11, 0, 3677, 11, 1, 55434, // 11, 1 +10, 1, 2365, 10, 2, 3374, 11, 1, 3310, 11, 2, 56487, // 11, 2 +10, 2, 2096, 10, 3, 2977, 11, 2, 2948, 11, 3, 57515, // 11, 3 +10, 3, 1843, 10, 4, 2605, 11, 3, 2604, 11, 4, 58484, // 11, 4 +10, 4, 1617, 10, 5, 2276, 11, 4, 2297, 11, 5, 59346, // 11, 5 +10, 5, 1442, 10, 6, 2020, 11, 5, 2057, 11, 6, 60017, // 11, 6 +10, 6, 1341, 10, 7, 1871, 11, 6, 1922, 11, 7, 60402, // 11, 7 +11, 7, 1922, 11, 8, 60402, 12, 7, 1341, 12, 8, 1871, // 11, 8 +11, 8, 2057, 11, 9, 60018, 12, 8, 1442, 12, 9, 2019, // 11, 9 +11, 9, 2297, 11, 10, 59346, 12, 9, 1617, 12, 10, 2276, // 11,10 +11, 10, 2605, 11, 11, 58484, 12, 10, 1843, 12, 11, 2604, // 11,11 +11, 11, 2950, 11, 12, 57514, 12, 11, 2096, 12, 12, 2976, // 11,12 +11, 12, 3311, 11, 13, 56486, 12, 12, 2365, 12, 13, 3374, // 11,13 +11, 13, 3678, 11, 14, 55434, 12, 13, 2640, 12, 14, 3784, // 11,14 +11, 14, 4043, 11, 15, 54376, 12, 14, 2917, 12, 15, 4200, // 11,15 +11, -1, 3064, 11, 0, 4392, 12, -1, 4264, 12, 0, 53816, // 12, 0 +11, 0, 2808, 11, 1, 4005, 12, 0, 3927, 12, 1, 54796, // 12, 1 +11, 1, 2556, 11, 2, 3630, 12, 1, 3594, 12, 2, 55756, // 12, 2 +11, 2, 2317, 11, 3, 3274, 12, 2, 3273, 12, 3, 56672, // 12, 3 +11, 3, 2096, 11, 4, 2950, 12, 3, 2976, 12, 4, 57514, // 12, 4 +11, 4, 1908, 11, 5, 2673, 12, 4, 2722, 12, 5, 58233, // 12, 5 +11, 5, 1767, 11, 6, 2464, 12, 5, 2532, 12, 6, 58773, // 12, 6 +11, 6, 1687, 11, 7, 2343, 12, 6, 2430, 12, 7, 59076, // 12, 7 +12, 7, 2430, 12, 8, 59077, 13, 7, 1687, 13, 8, 2342, // 12, 8 +12, 8, 2532, 12, 9, 58775, 13, 8, 1766, 13, 9, 2463, // 12, 9 +12, 9, 2723, 12, 10, 58234, 13, 9, 1908, 13, 10, 2671, // 12,10 +12, 10, 2977, 12, 11, 57514, 13, 10, 2096, 13, 11, 2949, // 12,11 +12, 11, 3274, 12, 12, 56673, 13, 11, 2317, 13, 12, 3272, // 12,12 +12, 12, 3595, 12, 13, 55756, 13, 12, 2557, 13, 13, 3628, // 12,13 +12, 13, 3929, 12, 14, 54796, 13, 13, 2808, 13, 14, 4003, // 12,14 +12, 14, 4267, 12, 15, 53814, 13, 14, 3065, 13, 15, 4390, // 12,15 +12, -1, 3235, 12, 0, 4612, 13, -1, 4521, 13, 0, 53168, // 13, 0 +12, 0, 2998, 12, 1, 4255, 13, 0, 4212, 13, 1, 54071, // 13, 1 +12, 1, 2770, 12, 2, 3913, 13, 1, 3911, 13, 2, 54942, // 13, 2 +12, 2, 2557, 12, 3, 3595, 13, 2, 3628, 13, 3, 55756, // 13, 3 +12, 3, 2365, 12, 4, 3311, 13, 3, 3373, 13, 4, 56487, // 13, 4 +12, 4, 2205, 12, 5, 3074, 13, 4, 3161, 13, 5, 57096, // 13, 5 +12, 5, 2088, 12, 6, 2898, 13, 5, 3007, 13, 6, 57543, // 13, 6 +12, 6, 2022, 12, 7, 2795, 13, 6, 2926, 13, 7, 57793, // 13, 7 +13, 7, 2926, 13, 8, 57795, 14, 7, 2022, 14, 8, 2793, // 13, 8 +13, 8, 3007, 13, 9, 57545, 14, 8, 2088, 14, 9, 2896, // 13, 9 +13, 9, 3161, 13, 10, 57096, 14, 9, 2205, 14, 10, 3074, // 13,10 +13, 10, 3374, 13, 11, 56487, 14, 10, 2365, 14, 11, 3310, // 13,11 +13, 11, 3630, 13, 12, 55756, 14, 11, 2556, 14, 12, 3594, // 13,12 +13, 12, 3913, 13, 13, 54941, 14, 12, 2770, 14, 13, 3912, // 13,13 +13, 13, 4214, 13, 14, 54071, 14, 13, 2998, 14, 14, 4253, // 13,14 +13, 14, 4523, 13, 15, 53168, 14, 14, 3235, 14, 15, 4610, // 13,15 +13, -1, 3421, 13, 0, 4854, 14, -1, 4803, 14, 0, 52458, // 14, 0 +13, 0, 3204, 13, 1, 4525, 14, 0, 4522, 14, 1, 53285, // 14, 1 +13, 1, 2998, 13, 2, 4214, 14, 1, 4253, 14, 2, 54071, // 14, 2 +13, 2, 2808, 13, 3, 3929, 14, 2, 4003, 14, 3, 54796, // 14, 3 +13, 3, 2640, 13, 4, 3678, 14, 3, 3783, 14, 4, 55435, // 14, 4 +13, 4, 2503, 13, 5, 3472, 14, 4, 3604, 14, 5, 55957, // 14, 5 +13, 5, 2403, 13, 6, 3319, 14, 5, 3476, 14, 6, 56338, // 14, 6 +13, 6, 2346, 13, 7, 3227, 14, 6, 3411, 14, 7, 56552, // 14, 7 +14, 7, 3411, 14, 8, 56554, 15, 7, 2346, 15, 8, 3225, // 14, 8 +14, 8, 3477, 14, 9, 56340, 15, 8, 2402, 15, 9, 3317, // 14, 9 +14, 9, 3605, 14, 10, 55959, 15, 9, 2502, 15, 10, 3470, // 14,10 +14, 10, 3785, 14, 11, 55435, 15, 10, 2640, 15, 11, 3676, // 14,11 +14, 11, 4005, 14, 12, 54796, 15, 11, 2808, 15, 12, 3927, // 14,12 +14, 12, 4255, 14, 13, 54072, 15, 12, 2998, 15, 13, 4211, // 14,13 +14, 13, 4525, 14, 14, 53285, 15, 13, 3204, 15, 14, 4522, // 14,14 +14, 14, 4806, 14, 15, 52457, 15, 14, 3422, 15, 15, 4851, // 14,15 +14, -1, 3621, 14, 0, 5110, 15, -1, 5106, 15, 0, 51699, // 15, 0 +14, 0, 3422, 14, 1, 4806, 15, 0, 4851, 15, 1, 52457, // 15, 1 +14, 1, 3235, 14, 2, 4523, 15, 1, 4610, 15, 2, 53168, // 15, 2 +14, 2, 3065, 14, 3, 4267, 15, 2, 4390, 15, 3, 53814, // 15, 3 +14, 3, 2917, 14, 4, 4043, 15, 3, 4200, 15, 4, 54376, // 15, 4 +14, 4, 2797, 14, 5, 3860, 15, 4, 4046, 15, 5, 54833, // 15, 5 +14, 5, 2709, 14, 6, 3724, 15, 5, 3939, 15, 6, 55164, // 15, 6 +14, 6, 2659, 14, 7, 3640, 15, 6, 3885, 15, 7, 55352, // 15, 7 +15, 7, 3885, 15, 8, 55354, 16, 7, 2659, 16, 8, 3638, // 15, 8 +15, 8, 3940, 15, 9, 55166, 16, 8, 2709, 16, 9, 3721, // 15, 9 +15, 9, 4047, 15, 10, 54835, 16, 9, 2796, 16, 10, 3858, // 15,10 +15, 10, 4201, 15, 11, 54378, 16, 10, 2916, 16, 11, 4041, // 15,11 +15, 11, 4392, 15, 12, 53815, 16, 11, 3064, 16, 12, 4265, // 15,12 +15, 12, 4612, 15, 13, 53168, 16, 12, 3235, 16, 13, 4521, // 15,13 +15, 13, 4854, 15, 14, 52457, 16, 13, 3421, 16, 14, 4804, // 15,14 +15, 14, 5110, 15, 15, 51699, 16, 14, 3621, 16, 15, 5106, // 15,15 +// angle of 0.0 degrees +0, 0, 16384, 0, 0, 16384, 0, 0, 16384, 0, 0, 16384, // 0, 0 +0, 1, 16384, 0, 1, 16384, 0, 1, 16384, 0, 1, 16384, // 0, 1 +0, 2, 16384, 0, 2, 16384, 0, 2, 16384, 0, 2, 16384, // 0, 2 +0, 3, 16384, 0, 3, 16384, 0, 3, 16384, 0, 3, 16384, // 0, 3 +0, 4, 16384, 0, 4, 16384, 0, 4, 16384, 0, 4, 16384, // 0, 4 +0, 5, 16384, 0, 5, 16384, 0, 5, 16384, 0, 5, 16384, // 0, 5 +0, 6, 16384, 0, 6, 16384, 0, 6, 16384, 0, 6, 16384, // 0, 6 +0, 7, 16384, 0, 7, 16384, 0, 7, 16384, 0, 7, 16384, // 0, 7 +0, 8, 16384, 0, 8, 16384, 0, 8, 16384, 0, 8, 16384, // 0, 8 +0, 9, 16384, 0, 9, 16384, 0, 9, 16384, 0, 9, 16384, // 0, 9 +0, 10, 16384, 0, 10, 16384, 0, 10, 16384, 0, 10, 16384, // 0,10 +0, 11, 16384, 0, 11, 16384, 0, 11, 16384, 0, 11, 16384, // 0,11 +0, 12, 16384, 0, 12, 16384, 0, 12, 16384, 0, 12, 16384, // 0,12 +0, 13, 16384, 0, 13, 16384, 0, 13, 16384, 0, 13, 16384, // 0,13 +0, 14, 16384, 0, 14, 16384, 0, 14, 16384, 0, 14, 16384, // 0,14 +0, 15, 16384, 0, 15, 16384, 0, 15, 16384, 0, 15, 16384, // 0,15 +1, 0, 16384, 1, 0, 16384, 1, 0, 16384, 1, 0, 16384, // 1, 0 +1, 1, 16384, 1, 1, 16384, 1, 1, 16384, 1, 1, 16384, // 1, 1 +1, 2, 16384, 1, 2, 16384, 1, 2, 16384, 1, 2, 16384, // 1, 2 +1, 3, 16384, 1, 3, 16384, 1, 3, 16384, 1, 3, 16384, // 1, 3 +1, 4, 16384, 1, 4, 16384, 1, 4, 16384, 1, 4, 16384, // 1, 4 +1, 5, 16384, 1, 5, 16384, 1, 5, 16384, 1, 5, 16384, // 1, 5 +1, 6, 16384, 1, 6, 16384, 1, 6, 16384, 1, 6, 16384, // 1, 6 +1, 7, 16384, 1, 7, 16384, 1, 7, 16384, 1, 7, 16384, // 1, 7 +1, 8, 16384, 1, 8, 16384, 1, 8, 16384, 1, 8, 16384, // 1, 8 +1, 9, 16384, 1, 9, 16384, 1, 9, 16384, 1, 9, 16384, // 1, 9 +1, 10, 16384, 1, 10, 16384, 1, 10, 16384, 1, 10, 16384, // 1,10 +1, 11, 16384, 1, 11, 16384, 1, 11, 16384, 1, 11, 16384, // 1,11 +1, 12, 16384, 1, 12, 16384, 1, 12, 16384, 1, 12, 16384, // 1,12 +1, 13, 16384, 1, 13, 16384, 1, 13, 16384, 1, 13, 16384, // 1,13 +1, 14, 16384, 1, 14, 16384, 1, 14, 16384, 1, 14, 16384, // 1,14 +1, 15, 16384, 1, 15, 16384, 1, 15, 16384, 1, 15, 16384, // 1,15 +2, 0, 16384, 2, 0, 16384, 2, 0, 16384, 2, 0, 16384, // 2, 0 +2, 1, 16384, 2, 1, 16384, 2, 1, 16384, 2, 1, 16384, // 2, 1 +2, 2, 16384, 2, 2, 16384, 2, 2, 16384, 2, 2, 16384, // 2, 2 +2, 3, 16384, 2, 3, 16384, 2, 3, 16384, 2, 3, 16384, // 2, 3 +2, 4, 16384, 2, 4, 16384, 2, 4, 16384, 2, 4, 16384, // 2, 4 +2, 5, 16384, 2, 5, 16384, 2, 5, 16384, 2, 5, 16384, // 2, 5 +2, 6, 16384, 2, 6, 16384, 2, 6, 16384, 2, 6, 16384, // 2, 6 +2, 7, 16384, 2, 7, 16384, 2, 7, 16384, 2, 7, 16384, // 2, 7 +2, 8, 16384, 2, 8, 16384, 2, 8, 16384, 2, 8, 16384, // 2, 8 +2, 9, 16384, 2, 9, 16384, 2, 9, 16384, 2, 9, 16384, // 2, 9 +2, 10, 16384, 2, 10, 16384, 2, 10, 16384, 2, 10, 16384, // 2,10 +2, 11, 16384, 2, 11, 16384, 2, 11, 16384, 2, 11, 16384, // 2,11 +2, 12, 16384, 2, 12, 16384, 2, 12, 16384, 2, 12, 16384, // 2,12 +2, 13, 16384, 2, 13, 16384, 2, 13, 16384, 2, 13, 16384, // 2,13 +2, 14, 16384, 2, 14, 16384, 2, 14, 16384, 2, 14, 16384, // 2,14 +2, 15, 16384, 2, 15, 16384, 2, 15, 16384, 2, 15, 16384, // 2,15 +3, 0, 16384, 3, 0, 16384, 3, 0, 16384, 3, 0, 16384, // 3, 0 +3, 1, 16384, 3, 1, 16384, 3, 1, 16384, 3, 1, 16384, // 3, 1 +3, 2, 16384, 3, 2, 16384, 3, 2, 16384, 3, 2, 16384, // 3, 2 +3, 3, 16384, 3, 3, 16384, 3, 3, 16384, 3, 3, 16384, // 3, 3 +3, 4, 16384, 3, 4, 16384, 3, 4, 16384, 3, 4, 16384, // 3, 4 +3, 5, 16384, 3, 5, 16384, 3, 5, 16384, 3, 5, 16384, // 3, 5 +3, 6, 16384, 3, 6, 16384, 3, 6, 16384, 3, 6, 16384, // 3, 6 +3, 7, 16384, 3, 7, 16384, 3, 7, 16384, 3, 7, 16384, // 3, 7 +3, 8, 16384, 3, 8, 16384, 3, 8, 16384, 3, 8, 16384, // 3, 8 +3, 9, 16384, 3, 9, 16384, 3, 9, 16384, 3, 9, 16384, // 3, 9 +3, 10, 16384, 3, 10, 16384, 3, 10, 16384, 3, 10, 16384, // 3,10 +3, 11, 16384, 3, 11, 16384, 3, 11, 16384, 3, 11, 16384, // 3,11 +3, 12, 16384, 3, 12, 16384, 3, 12, 16384, 3, 12, 16384, // 3,12 +3, 13, 16384, 3, 13, 16384, 3, 13, 16384, 3, 13, 16384, // 3,13 +3, 14, 16384, 3, 14, 16384, 3, 14, 16384, 3, 14, 16384, // 3,14 +3, 15, 16384, 3, 15, 16384, 3, 15, 16384, 3, 15, 16384, // 3,15 +4, 0, 16384, 4, 0, 16384, 4, 0, 16384, 4, 0, 16384, // 4, 0 +4, 1, 16384, 4, 1, 16384, 4, 1, 16384, 4, 1, 16384, // 4, 1 +4, 2, 16384, 4, 2, 16384, 4, 2, 16384, 4, 2, 16384, // 4, 2 +4, 3, 16384, 4, 3, 16384, 4, 3, 16384, 4, 3, 16384, // 4, 3 +4, 4, 16384, 4, 4, 16384, 4, 4, 16384, 4, 4, 16384, // 4, 4 +4, 5, 16384, 4, 5, 16384, 4, 5, 16384, 4, 5, 16384, // 4, 5 +4, 6, 16384, 4, 6, 16384, 4, 6, 16384, 4, 6, 16384, // 4, 6 +4, 7, 16384, 4, 7, 16384, 4, 7, 16384, 4, 7, 16384, // 4, 7 +4, 8, 16384, 4, 8, 16384, 4, 8, 16384, 4, 8, 16384, // 4, 8 +4, 9, 16384, 4, 9, 16384, 4, 9, 16384, 4, 9, 16384, // 4, 9 +4, 10, 16384, 4, 10, 16384, 4, 10, 16384, 4, 10, 16384, // 4,10 +4, 11, 16384, 4, 11, 16384, 4, 11, 16384, 4, 11, 16384, // 4,11 +4, 12, 16384, 4, 12, 16384, 4, 12, 16384, 4, 12, 16384, // 4,12 +4, 13, 16384, 4, 13, 16384, 4, 13, 16384, 4, 13, 16384, // 4,13 +4, 14, 16384, 4, 14, 16384, 4, 14, 16384, 4, 14, 16384, // 4,14 +4, 15, 16384, 4, 15, 16384, 4, 15, 16384, 4, 15, 16384, // 4,15 +5, 0, 16384, 5, 0, 16384, 5, 0, 16384, 5, 0, 16384, // 5, 0 +5, 1, 16384, 5, 1, 16384, 5, 1, 16384, 5, 1, 16384, // 5, 1 +5, 2, 16384, 5, 2, 16384, 5, 2, 16384, 5, 2, 16384, // 5, 2 +5, 3, 16384, 5, 3, 16384, 5, 3, 16384, 5, 3, 16384, // 5, 3 +5, 4, 16384, 5, 4, 16384, 5, 4, 16384, 5, 4, 16384, // 5, 4 +5, 5, 16384, 5, 5, 16384, 5, 5, 16384, 5, 5, 16384, // 5, 5 +5, 6, 16384, 5, 6, 16384, 5, 6, 16384, 5, 6, 16384, // 5, 6 +5, 7, 16384, 5, 7, 16384, 5, 7, 16384, 5, 7, 16384, // 5, 7 +5, 8, 16384, 5, 8, 16384, 5, 8, 16384, 5, 8, 16384, // 5, 8 +5, 9, 16384, 5, 9, 16384, 5, 9, 16384, 5, 9, 16384, // 5, 9 +5, 10, 16384, 5, 10, 16384, 5, 10, 16384, 5, 10, 16384, // 5,10 +5, 11, 16384, 5, 11, 16384, 5, 11, 16384, 5, 11, 16384, // 5,11 +5, 12, 16384, 5, 12, 16384, 5, 12, 16384, 5, 12, 16384, // 5,12 +5, 13, 16384, 5, 13, 16384, 5, 13, 16384, 5, 13, 16384, // 5,13 +5, 14, 16384, 5, 14, 16384, 5, 14, 16384, 5, 14, 16384, // 5,14 +5, 15, 16384, 5, 15, 16384, 5, 15, 16384, 5, 15, 16384, // 5,15 +6, 0, 16384, 6, 0, 16384, 6, 0, 16384, 6, 0, 16384, // 6, 0 +6, 1, 16384, 6, 1, 16384, 6, 1, 16384, 6, 1, 16384, // 6, 1 +6, 2, 16384, 6, 2, 16384, 6, 2, 16384, 6, 2, 16384, // 6, 2 +6, 3, 16384, 6, 3, 16384, 6, 3, 16384, 6, 3, 16384, // 6, 3 +6, 4, 16384, 6, 4, 16384, 6, 4, 16384, 6, 4, 16384, // 6, 4 +6, 5, 16384, 6, 5, 16384, 6, 5, 16384, 6, 5, 16384, // 6, 5 +6, 6, 16384, 6, 6, 16384, 6, 6, 16384, 6, 6, 16384, // 6, 6 +6, 7, 16384, 6, 7, 16384, 6, 7, 16384, 6, 7, 16384, // 6, 7 +6, 8, 16384, 6, 8, 16384, 6, 8, 16384, 6, 8, 16384, // 6, 8 +6, 9, 16384, 6, 9, 16384, 6, 9, 16384, 6, 9, 16384, // 6, 9 +6, 10, 16384, 6, 10, 16384, 6, 10, 16384, 6, 10, 16384, // 6,10 +6, 11, 16384, 6, 11, 16384, 6, 11, 16384, 6, 11, 16384, // 6,11 +6, 12, 16384, 6, 12, 16384, 6, 12, 16384, 6, 12, 16384, // 6,12 +6, 13, 16384, 6, 13, 16384, 6, 13, 16384, 6, 13, 16384, // 6,13 +6, 14, 16384, 6, 14, 16384, 6, 14, 16384, 6, 14, 16384, // 6,14 +6, 15, 16384, 6, 15, 16384, 6, 15, 16384, 6, 15, 16384, // 6,15 +7, 0, 16384, 7, 0, 16384, 7, 0, 16384, 7, 0, 16384, // 7, 0 +7, 1, 16384, 7, 1, 16384, 7, 1, 16384, 7, 1, 16384, // 7, 1 +7, 2, 16384, 7, 2, 16384, 7, 2, 16384, 7, 2, 16384, // 7, 2 +7, 3, 16384, 7, 3, 16384, 7, 3, 16384, 7, 3, 16384, // 7, 3 +7, 4, 16384, 7, 4, 16384, 7, 4, 16384, 7, 4, 16384, // 7, 4 +7, 5, 16384, 7, 5, 16384, 7, 5, 16384, 7, 5, 16384, // 7, 5 +7, 6, 16384, 7, 6, 16384, 7, 6, 16384, 7, 6, 16384, // 7, 6 +7, 7, 16384, 7, 7, 16384, 7, 7, 16384, 7, 7, 16384, // 7, 7 +7, 8, 16384, 7, 8, 16384, 7, 8, 16384, 7, 8, 16384, // 7, 8 +7, 9, 16384, 7, 9, 16384, 7, 9, 16384, 7, 9, 16384, // 7, 9 +7, 10, 16384, 7, 10, 16384, 7, 10, 16384, 7, 10, 16384, // 7,10 +7, 11, 16384, 7, 11, 16384, 7, 11, 16384, 7, 11, 16384, // 7,11 +7, 12, 16384, 7, 12, 16384, 7, 12, 16384, 7, 12, 16384, // 7,12 +7, 13, 16384, 7, 13, 16384, 7, 13, 16384, 7, 13, 16384, // 7,13 +7, 14, 16384, 7, 14, 16384, 7, 14, 16384, 7, 14, 16384, // 7,14 +7, 15, 16384, 7, 15, 16384, 7, 15, 16384, 7, 15, 16384, // 7,15 +8, 0, 16384, 8, 0, 16384, 8, 0, 16384, 8, 0, 16384, // 8, 0 +8, 1, 16384, 8, 1, 16384, 8, 1, 16384, 8, 1, 16384, // 8, 1 +8, 2, 16384, 8, 2, 16384, 8, 2, 16384, 8, 2, 16384, // 8, 2 +8, 3, 16384, 8, 3, 16384, 8, 3, 16384, 8, 3, 16384, // 8, 3 +8, 4, 16384, 8, 4, 16384, 8, 4, 16384, 8, 4, 16384, // 8, 4 +8, 5, 16384, 8, 5, 16384, 8, 5, 16384, 8, 5, 16384, // 8, 5 +8, 6, 16384, 8, 6, 16384, 8, 6, 16384, 8, 6, 16384, // 8, 6 +8, 7, 16384, 8, 7, 16384, 8, 7, 16384, 8, 7, 16384, // 8, 7 +8, 8, 16384, 8, 8, 16384, 8, 8, 16384, 8, 8, 16384, // 8, 8 +8, 9, 16384, 8, 9, 16384, 8, 9, 16384, 8, 9, 16384, // 8, 9 +8, 10, 16384, 8, 10, 16384, 8, 10, 16384, 8, 10, 16384, // 8,10 +8, 11, 16384, 8, 11, 16384, 8, 11, 16384, 8, 11, 16384, // 8,11 +8, 12, 16384, 8, 12, 16384, 8, 12, 16384, 8, 12, 16384, // 8,12 +8, 13, 16384, 8, 13, 16384, 8, 13, 16384, 8, 13, 16384, // 8,13 +8, 14, 16384, 8, 14, 16384, 8, 14, 16384, 8, 14, 16384, // 8,14 +8, 15, 16384, 8, 15, 16384, 8, 15, 16384, 8, 15, 16384, // 8,15 +9, 0, 16384, 9, 0, 16384, 9, 0, 16384, 9, 0, 16384, // 9, 0 +9, 1, 16384, 9, 1, 16384, 9, 1, 16384, 9, 1, 16384, // 9, 1 +9, 2, 16384, 9, 2, 16384, 9, 2, 16384, 9, 2, 16384, // 9, 2 +9, 3, 16384, 9, 3, 16384, 9, 3, 16384, 9, 3, 16384, // 9, 3 +9, 4, 16384, 9, 4, 16384, 9, 4, 16384, 9, 4, 16384, // 9, 4 +9, 5, 16384, 9, 5, 16384, 9, 5, 16384, 9, 5, 16384, // 9, 5 +9, 6, 16384, 9, 6, 16384, 9, 6, 16384, 9, 6, 16384, // 9, 6 +9, 7, 16384, 9, 7, 16384, 9, 7, 16384, 9, 7, 16384, // 9, 7 +9, 8, 16384, 9, 8, 16384, 9, 8, 16384, 9, 8, 16384, // 9, 8 +9, 9, 16384, 9, 9, 16384, 9, 9, 16384, 9, 9, 16384, // 9, 9 +9, 10, 16384, 9, 10, 16384, 9, 10, 16384, 9, 10, 16384, // 9,10 +9, 11, 16384, 9, 11, 16384, 9, 11, 16384, 9, 11, 16384, // 9,11 +9, 12, 16384, 9, 12, 16384, 9, 12, 16384, 9, 12, 16384, // 9,12 +9, 13, 16384, 9, 13, 16384, 9, 13, 16384, 9, 13, 16384, // 9,13 +9, 14, 16384, 9, 14, 16384, 9, 14, 16384, 9, 14, 16384, // 9,14 +9, 15, 16384, 9, 15, 16384, 9, 15, 16384, 9, 15, 16384, // 9,15 +10, 0, 16384, 10, 0, 16384, 10, 0, 16384, 10, 0, 16384, // 10, 0 +10, 1, 16384, 10, 1, 16384, 10, 1, 16384, 10, 1, 16384, // 10, 1 +10, 2, 16384, 10, 2, 16384, 10, 2, 16384, 10, 2, 16384, // 10, 2 +10, 3, 16384, 10, 3, 16384, 10, 3, 16384, 10, 3, 16384, // 10, 3 +10, 4, 16384, 10, 4, 16384, 10, 4, 16384, 10, 4, 16384, // 10, 4 +10, 5, 16384, 10, 5, 16384, 10, 5, 16384, 10, 5, 16384, // 10, 5 +10, 6, 16384, 10, 6, 16384, 10, 6, 16384, 10, 6, 16384, // 10, 6 +10, 7, 16384, 10, 7, 16384, 10, 7, 16384, 10, 7, 16384, // 10, 7 +10, 8, 16384, 10, 8, 16384, 10, 8, 16384, 10, 8, 16384, // 10, 8 +10, 9, 16384, 10, 9, 16384, 10, 9, 16384, 10, 9, 16384, // 10, 9 +10, 10, 16384, 10, 10, 16384, 10, 10, 16384, 10, 10, 16384, // 10,10 +10, 11, 16384, 10, 11, 16384, 10, 11, 16384, 10, 11, 16384, // 10,11 +10, 12, 16384, 10, 12, 16384, 10, 12, 16384, 10, 12, 16384, // 10,12 +10, 13, 16384, 10, 13, 16384, 10, 13, 16384, 10, 13, 16384, // 10,13 +10, 14, 16384, 10, 14, 16384, 10, 14, 16384, 10, 14, 16384, // 10,14 +10, 15, 16384, 10, 15, 16384, 10, 15, 16384, 10, 15, 16384, // 10,15 +11, 0, 16384, 11, 0, 16384, 11, 0, 16384, 11, 0, 16384, // 11, 0 +11, 1, 16384, 11, 1, 16384, 11, 1, 16384, 11, 1, 16384, // 11, 1 +11, 2, 16384, 11, 2, 16384, 11, 2, 16384, 11, 2, 16384, // 11, 2 +11, 3, 16384, 11, 3, 16384, 11, 3, 16384, 11, 3, 16384, // 11, 3 +11, 4, 16384, 11, 4, 16384, 11, 4, 16384, 11, 4, 16384, // 11, 4 +11, 5, 16384, 11, 5, 16384, 11, 5, 16384, 11, 5, 16384, // 11, 5 +11, 6, 16384, 11, 6, 16384, 11, 6, 16384, 11, 6, 16384, // 11, 6 +11, 7, 16384, 11, 7, 16384, 11, 7, 16384, 11, 7, 16384, // 11, 7 +11, 8, 16384, 11, 8, 16384, 11, 8, 16384, 11, 8, 16384, // 11, 8 +11, 9, 16384, 11, 9, 16384, 11, 9, 16384, 11, 9, 16384, // 11, 9 +11, 10, 16384, 11, 10, 16384, 11, 10, 16384, 11, 10, 16384, // 11,10 +11, 11, 16384, 11, 11, 16384, 11, 11, 16384, 11, 11, 16384, // 11,11 +11, 12, 16384, 11, 12, 16384, 11, 12, 16384, 11, 12, 16384, // 11,12 +11, 13, 16384, 11, 13, 16384, 11, 13, 16384, 11, 13, 16384, // 11,13 +11, 14, 16384, 11, 14, 16384, 11, 14, 16384, 11, 14, 16384, // 11,14 +11, 15, 16384, 11, 15, 16384, 11, 15, 16384, 11, 15, 16384, // 11,15 +12, 0, 16384, 12, 0, 16384, 12, 0, 16384, 12, 0, 16384, // 12, 0 +12, 1, 16384, 12, 1, 16384, 12, 1, 16384, 12, 1, 16384, // 12, 1 +12, 2, 16384, 12, 2, 16384, 12, 2, 16384, 12, 2, 16384, // 12, 2 +12, 3, 16384, 12, 3, 16384, 12, 3, 16384, 12, 3, 16384, // 12, 3 +12, 4, 16384, 12, 4, 16384, 12, 4, 16384, 12, 4, 16384, // 12, 4 +12, 5, 16384, 12, 5, 16384, 12, 5, 16384, 12, 5, 16384, // 12, 5 +12, 6, 16384, 12, 6, 16384, 12, 6, 16384, 12, 6, 16384, // 12, 6 +12, 7, 16384, 12, 7, 16384, 12, 7, 16384, 12, 7, 16384, // 12, 7 +12, 8, 16384, 12, 8, 16384, 12, 8, 16384, 12, 8, 16384, // 12, 8 +12, 9, 16384, 12, 9, 16384, 12, 9, 16384, 12, 9, 16384, // 12, 9 +12, 10, 16384, 12, 10, 16384, 12, 10, 16384, 12, 10, 16384, // 12,10 +12, 11, 16384, 12, 11, 16384, 12, 11, 16384, 12, 11, 16384, // 12,11 +12, 12, 16384, 12, 12, 16384, 12, 12, 16384, 12, 12, 16384, // 12,12 +12, 13, 16384, 12, 13, 16384, 12, 13, 16384, 12, 13, 16384, // 12,13 +12, 14, 16384, 12, 14, 16384, 12, 14, 16384, 12, 14, 16384, // 12,14 +12, 15, 16384, 12, 15, 16384, 12, 15, 16384, 12, 15, 16384, // 12,15 +13, 0, 16384, 13, 0, 16384, 13, 0, 16384, 13, 0, 16384, // 13, 0 +13, 1, 16384, 13, 1, 16384, 13, 1, 16384, 13, 1, 16384, // 13, 1 +13, 2, 16384, 13, 2, 16384, 13, 2, 16384, 13, 2, 16384, // 13, 2 +13, 3, 16384, 13, 3, 16384, 13, 3, 16384, 13, 3, 16384, // 13, 3 +13, 4, 16384, 13, 4, 16384, 13, 4, 16384, 13, 4, 16384, // 13, 4 +13, 5, 16384, 13, 5, 16384, 13, 5, 16384, 13, 5, 16384, // 13, 5 +13, 6, 16384, 13, 6, 16384, 13, 6, 16384, 13, 6, 16384, // 13, 6 +13, 7, 16384, 13, 7, 16384, 13, 7, 16384, 13, 7, 16384, // 13, 7 +13, 8, 16384, 13, 8, 16384, 13, 8, 16384, 13, 8, 16384, // 13, 8 +13, 9, 16384, 13, 9, 16384, 13, 9, 16384, 13, 9, 16384, // 13, 9 +13, 10, 16384, 13, 10, 16384, 13, 10, 16384, 13, 10, 16384, // 13,10 +13, 11, 16384, 13, 11, 16384, 13, 11, 16384, 13, 11, 16384, // 13,11 +13, 12, 16384, 13, 12, 16384, 13, 12, 16384, 13, 12, 16384, // 13,12 +13, 13, 16384, 13, 13, 16384, 13, 13, 16384, 13, 13, 16384, // 13,13 +13, 14, 16384, 13, 14, 16384, 13, 14, 16384, 13, 14, 16384, // 13,14 +13, 15, 16384, 13, 15, 16384, 13, 15, 16384, 13, 15, 16384, // 13,15 +14, 0, 16384, 14, 0, 16384, 14, 0, 16384, 14, 0, 16384, // 14, 0 +14, 1, 16384, 14, 1, 16384, 14, 1, 16384, 14, 1, 16384, // 14, 1 +14, 2, 16384, 14, 2, 16384, 14, 2, 16384, 14, 2, 16384, // 14, 2 +14, 3, 16384, 14, 3, 16384, 14, 3, 16384, 14, 3, 16384, // 14, 3 +14, 4, 16384, 14, 4, 16384, 14, 4, 16384, 14, 4, 16384, // 14, 4 +14, 5, 16384, 14, 5, 16384, 14, 5, 16384, 14, 5, 16384, // 14, 5 +14, 6, 16384, 14, 6, 16384, 14, 6, 16384, 14, 6, 16384, // 14, 6 +14, 7, 16384, 14, 7, 16384, 14, 7, 16384, 14, 7, 16384, // 14, 7 +14, 8, 16384, 14, 8, 16384, 14, 8, 16384, 14, 8, 16384, // 14, 8 +14, 9, 16384, 14, 9, 16384, 14, 9, 16384, 14, 9, 16384, // 14, 9 +14, 10, 16384, 14, 10, 16384, 14, 10, 16384, 14, 10, 16384, // 14,10 +14, 11, 16384, 14, 11, 16384, 14, 11, 16384, 14, 11, 16384, // 14,11 +14, 12, 16384, 14, 12, 16384, 14, 12, 16384, 14, 12, 16384, // 14,12 +14, 13, 16384, 14, 13, 16384, 14, 13, 16384, 14, 13, 16384, // 14,13 +14, 14, 16384, 14, 14, 16384, 14, 14, 16384, 14, 14, 16384, // 14,14 +14, 15, 16384, 14, 15, 16384, 14, 15, 16384, 14, 15, 16384, // 14,15 +15, 0, 16384, 15, 0, 16384, 15, 0, 16384, 15, 0, 16384, // 15, 0 +15, 1, 16384, 15, 1, 16384, 15, 1, 16384, 15, 1, 16384, // 15, 1 +15, 2, 16384, 15, 2, 16384, 15, 2, 16384, 15, 2, 16384, // 15, 2 +15, 3, 16384, 15, 3, 16384, 15, 3, 16384, 15, 3, 16384, // 15, 3 +15, 4, 16384, 15, 4, 16384, 15, 4, 16384, 15, 4, 16384, // 15, 4 +15, 5, 16384, 15, 5, 16384, 15, 5, 16384, 15, 5, 16384, // 15, 5 +15, 6, 16384, 15, 6, 16384, 15, 6, 16384, 15, 6, 16384, // 15, 6 +15, 7, 16384, 15, 7, 16384, 15, 7, 16384, 15, 7, 16384, // 15, 7 +15, 8, 16384, 15, 8, 16384, 15, 8, 16384, 15, 8, 16384, // 15, 8 +15, 9, 16384, 15, 9, 16384, 15, 9, 16384, 15, 9, 16384, // 15, 9 +15, 10, 16384, 15, 10, 16384, 15, 10, 16384, 15, 10, 16384, // 15,10 +15, 11, 16384, 15, 11, 16384, 15, 11, 16384, 15, 11, 16384, // 15,11 +15, 12, 16384, 15, 12, 16384, 15, 12, 16384, 15, 12, 16384, // 15,12 +15, 13, 16384, 15, 13, 16384, 15, 13, 16384, 15, 13, 16384, // 15,13 +15, 14, 16384, 15, 14, 16384, 15, 14, 16384, 15, 14, 16384, // 15,14 +15, 15, 16384, 15, 15, 16384, 15, 15, 16384, 15, 15, 16384, // 15,15 +// angle of 0.5 degrees +0, -1, 5106, 0, 0, 51699, 1, -1, 3621, 1, 0, 5110, // 0, 0 +0, 0, 4851, 0, 1, 52457, 1, 0, 3422, 1, 1, 4806, // 0, 1 +0, 1, 4610, 0, 2, 53168, 1, 1, 3235, 1, 2, 4523, // 0, 2 +0, 2, 4390, 0, 3, 53814, 1, 2, 3065, 1, 3, 4267, // 0, 3 +0, 3, 4200, 0, 4, 54376, 1, 3, 2917, 1, 4, 4043, // 0, 4 +0, 4, 4046, 0, 5, 54833, 1, 4, 2797, 1, 5, 3860, // 0, 5 +0, 5, 3939, 0, 6, 55164, 1, 5, 2709, 1, 6, 3724, // 0, 6 +0, 6, 3885, 0, 7, 55352, 1, 6, 2659, 1, 7, 3640, // 0, 7 +-1, 7, 2659, -1, 8, 3638, 0, 7, 3885, 0, 8, 55354, // 0, 8 +-1, 8, 2709, -1, 9, 3722, 0, 8, 3940, 0, 9, 55165, // 0, 9 +-1, 9, 2796, -1, 10, 3858, 0, 9, 4047, 0, 10, 54835, // 0,10 +-1, 10, 2916, -1, 11, 4041, 0, 10, 4201, 0, 11, 54378, // 0,11 +-1, 11, 3064, -1, 12, 4264, 0, 11, 4392, 0, 12, 53816, // 0,12 +-1, 12, 3235, -1, 13, 4521, 0, 12, 4612, 0, 13, 53168, // 0,13 +-1, 13, 3421, -1, 14, 4803, 0, 13, 4854, 0, 14, 52458, // 0,14 +-1, 14, 3621, -1, 15, 5106, 0, 14, 5110, 0, 15, 51699, // 0,15 +1, -1, 4803, 1, 0, 52457, 2, -1, 3421, 2, 0, 4855, // 1, 0 +1, 0, 4522, 1, 1, 53285, 2, 0, 3204, 2, 1, 4525, // 1, 1 +1, 1, 4253, 1, 2, 54071, 2, 1, 2998, 2, 2, 4214, // 1, 2 +1, 2, 4003, 1, 3, 54796, 2, 2, 2808, 2, 3, 3929, // 1, 3 +1, 3, 3783, 1, 4, 55434, 2, 3, 2640, 2, 4, 3679, // 1, 4 +1, 4, 3604, 1, 5, 55958, 2, 4, 2503, 2, 5, 3471, // 1, 5 +1, 5, 3476, 1, 6, 56339, 2, 5, 2403, 2, 6, 3318, // 1, 6 +1, 6, 3411, 1, 7, 56552, 2, 6, 2346, 2, 7, 3227, // 1, 7 +0, 7, 2346, 0, 8, 3225, 1, 7, 3411, 1, 8, 56554, // 1, 8 +0, 8, 2402, 0, 9, 3317, 1, 8, 3477, 1, 9, 56340, // 1, 9 +0, 9, 2502, 0, 10, 3470, 1, 9, 3605, 1, 10, 55959, // 1,10 +0, 10, 2640, 0, 11, 3677, 1, 10, 3785, 1, 11, 55434, // 1,11 +0, 11, 2808, 0, 12, 3927, 1, 11, 4005, 1, 12, 54796, // 1,12 +0, 12, 2998, 0, 13, 4212, 1, 12, 4255, 1, 13, 54071, // 1,13 +0, 13, 3204, 0, 14, 4522, 1, 13, 4525, 1, 14, 53285, // 1,14 +0, 14, 3422, 0, 15, 4851, 1, 14, 4806, 1, 15, 52457, // 1,15 +2, -1, 4521, 2, 0, 53168, 3, -1, 3235, 3, 0, 4612, // 2, 0 +2, 0, 4212, 2, 1, 54072, 3, 0, 2998, 3, 1, 4254, // 2, 1 +2, 1, 3911, 2, 2, 54941, 3, 1, 2770, 3, 2, 3914, // 2, 2 +2, 2, 3628, 2, 3, 55756, 3, 2, 2557, 3, 3, 3595, // 2, 3 +2, 3, 3373, 2, 4, 56486, 3, 3, 2365, 3, 4, 3312, // 2, 4 +2, 4, 3161, 2, 5, 57095, 3, 4, 2205, 3, 5, 3075, // 2, 5 +2, 5, 3007, 2, 6, 57544, 3, 5, 2088, 3, 6, 2897, // 2, 6 +2, 6, 2926, 2, 7, 57793, 3, 6, 2022, 3, 7, 2795, // 2, 7 +1, 7, 2022, 1, 8, 2794, 2, 7, 2926, 2, 8, 57794, // 2, 8 +1, 8, 2088, 1, 9, 2897, 2, 8, 3007, 2, 9, 57544, // 2, 9 +1, 9, 2205, 1, 10, 3073, 2, 9, 3161, 2, 10, 57097, // 2,10 +1, 10, 2365, 1, 11, 3310, 2, 10, 3374, 2, 11, 56487, // 2,11 +1, 11, 2556, 1, 12, 3594, 2, 11, 3630, 2, 12, 55756, // 2,12 +1, 12, 2770, 1, 13, 3911, 2, 12, 3913, 2, 13, 54942, // 2,13 +1, 13, 2998, 1, 14, 4253, 2, 13, 4214, 2, 14, 54071, // 2,14 +1, 14, 3235, 1, 15, 4610, 2, 14, 4523, 2, 15, 53168, // 2,15 +3, -1, 4264, 3, 0, 53815, 4, -1, 3064, 4, 0, 4393, // 3, 0 +3, 0, 3927, 3, 1, 54796, 4, 0, 2808, 4, 1, 4005, // 3, 1 +3, 1, 3594, 3, 2, 55756, 4, 1, 2556, 4, 2, 3630, // 3, 2 +3, 2, 3273, 3, 3, 56673, 4, 2, 2317, 4, 3, 3273, // 3, 3 +3, 3, 2976, 3, 4, 57514, 4, 3, 2096, 4, 4, 2950, // 3, 4 +3, 4, 2722, 3, 5, 58233, 4, 4, 1908, 4, 5, 2673, // 3, 5 +3, 5, 2532, 3, 6, 58774, 4, 5, 1767, 4, 6, 2463, // 3, 6 +3, 6, 2430, 3, 7, 59076, 4, 6, 1687, 4, 7, 2343, // 3, 7 +2, 7, 1687, 2, 8, 2342, 3, 7, 2430, 3, 8, 59077, // 3, 8 +2, 8, 1766, 2, 9, 2463, 3, 8, 2532, 3, 9, 58775, // 3, 9 +2, 9, 1908, 2, 10, 2672, 3, 9, 2723, 3, 10, 58233, // 3,10 +2, 10, 2096, 2, 11, 2948, 3, 10, 2977, 3, 11, 57515, // 3,11 +2, 11, 2317, 2, 12, 3273, 3, 11, 3274, 3, 12, 56672, // 3,12 +2, 12, 2557, 2, 13, 3628, 3, 12, 3595, 3, 13, 55756, // 3,13 +2, 13, 2808, 2, 14, 4003, 3, 13, 3929, 3, 14, 54796, // 3,14 +2, 14, 3065, 2, 15, 4390, 3, 14, 4267, 3, 15, 53814, // 3,15 +4, -1, 4041, 4, 0, 54378, 5, -1, 2916, 5, 0, 4201, // 4, 0 +4, 0, 3677, 4, 1, 55435, 5, 0, 2640, 5, 1, 3784, // 4, 1 +4, 1, 3310, 4, 2, 56487, 5, 1, 2365, 5, 2, 3374, // 4, 2 +4, 2, 2948, 4, 3, 57514, 5, 2, 2096, 5, 3, 2978, // 4, 3 +4, 3, 2604, 4, 4, 58484, 5, 3, 1843, 5, 4, 2605, // 4, 4 +4, 4, 2297, 4, 5, 59345, 5, 4, 1617, 5, 5, 2277, // 4, 5 +4, 5, 2057, 4, 6, 60017, 5, 5, 1442, 5, 6, 2020, // 4, 6 +4, 6, 1922, 4, 7, 60402, 5, 6, 1341, 5, 7, 1871, // 4, 7 +3, 7, 1341, 3, 8, 1871, 4, 7, 1922, 4, 8, 60402, // 4, 8 +3, 8, 1442, 3, 9, 2020, 4, 8, 2057, 4, 9, 60017, // 4, 9 +3, 9, 1617, 3, 10, 2276, 4, 9, 2297, 4, 10, 59346, // 4,10 +3, 10, 1843, 3, 11, 2604, 4, 10, 2605, 4, 11, 58484, // 4,11 +3, 11, 2096, 3, 12, 2976, 4, 11, 2950, 4, 12, 57514, // 4,12 +3, 12, 2365, 3, 13, 3373, 4, 12, 3311, 4, 13, 56487, // 4,13 +3, 13, 2640, 3, 14, 3783, 4, 13, 3678, 4, 14, 55435, // 4,14 +3, 14, 2917, 3, 15, 4200, 4, 14, 4043, 4, 15, 54376, // 4,15 +5, -1, 3858, 5, 0, 54835, 6, -1, 2796, 6, 0, 4047, // 5, 0 +5, 0, 3470, 5, 1, 55959, 6, 0, 2502, 6, 1, 3605, // 5, 1 +5, 1, 3073, 5, 2, 57096, 6, 1, 2205, 6, 2, 3162, // 5, 2 +5, 2, 2672, 5, 3, 58234, 6, 2, 1908, 6, 3, 2722, // 5, 3 +5, 3, 2276, 5, 4, 59346, 6, 3, 1617, 6, 4, 2297, // 5, 4 +5, 4, 1904, 5, 5, 60381, 6, 4, 1347, 6, 5, 1904, // 5, 5 +5, 5, 1593, 5, 6, 61243, 6, 5, 1121, 6, 6, 1579, // 5, 6 +5, 6, 1405, 5, 7, 61767, 6, 6, 985, 6, 7, 1379, // 5, 7 +4, 7, 985, 4, 8, 1380, 5, 7, 1405, 5, 8, 61766, // 5, 8 +4, 8, 1121, 4, 9, 1578, 5, 8, 1593, 5, 9, 61244, // 5, 9 +4, 9, 1347, 4, 10, 1904, 5, 9, 1904, 5, 10, 60381, // 5,10 +4, 10, 1617, 4, 11, 2297, 5, 10, 2276, 5, 11, 59346, // 5,11 +4, 11, 1908, 4, 12, 2722, 5, 11, 2673, 5, 12, 58233, // 5,12 +4, 12, 2205, 4, 13, 3161, 5, 12, 3074, 5, 13, 57096, // 5,13 +4, 13, 2503, 4, 14, 3604, 5, 13, 3472, 5, 14, 55957, // 5,14 +4, 14, 2797, 4, 15, 4046, 5, 14, 3860, 5, 15, 54833, // 5,15 +6, -1, 3722, 6, 0, 55166, 7, -1, 2709, 7, 0, 3939, // 6, 0 +6, 0, 3317, 6, 1, 56340, 7, 0, 2402, 7, 1, 3477, // 6, 1 +6, 1, 2897, 6, 2, 57545, 7, 1, 2088, 7, 2, 3006, // 6, 2 +6, 2, 2463, 6, 3, 58775, 7, 2, 1766, 7, 3, 2532, // 6, 3 +6, 3, 2020, 6, 4, 60018, 7, 3, 1442, 7, 4, 2056, // 6, 4 +6, 4, 1578, 6, 5, 61243, 7, 4, 1121, 7, 5, 1594, // 6, 5 +6, 5, 1170, 6, 6, 62369, 7, 5, 827, 7, 6, 1170, // 6, 6 +6, 6, 883, 6, 7, 63156, 7, 6, 622, 7, 7, 875, // 6, 7 +5, 7, 622, 5, 8, 875, 6, 7, 883, 6, 8, 63156, // 6, 8 +5, 8, 827, 5, 9, 1170, 6, 8, 1170, 6, 9, 62369, // 6, 9 +5, 9, 1121, 5, 10, 1593, 6, 9, 1579, 6, 10, 61243, // 6,10 +5, 10, 1442, 5, 11, 2057, 6, 10, 2020, 6, 11, 60017, // 6,11 +5, 11, 1767, 5, 12, 2532, 6, 11, 2464, 6, 12, 58773, // 6,12 +5, 12, 2088, 5, 13, 3007, 6, 12, 2898, 6, 13, 57543, // 6,13 +5, 13, 2403, 5, 14, 3476, 6, 13, 3319, 6, 14, 56338, // 6,14 +5, 14, 2709, 5, 15, 3939, 6, 14, 3724, 6, 15, 55164, // 6,15 +7, -1, 3638, 7, 0, 55354, 8, -1, 2659, 8, 0, 3885, // 7, 0 +7, 0, 3225, 7, 1, 56554, 8, 0, 2346, 8, 1, 3411, // 7, 1 +7, 1, 2794, 7, 2, 57795, 8, 1, 2022, 8, 2, 2925, // 7, 2 +7, 2, 2342, 7, 3, 59077, 8, 2, 1687, 8, 3, 2430, // 7, 3 +7, 3, 1871, 7, 4, 60402, 8, 3, 1341, 8, 4, 1922, // 7, 4 +7, 4, 1380, 7, 5, 61767, 8, 4, 985, 8, 5, 1404, // 7, 5 +7, 5, 875, 7, 6, 63156, 8, 5, 622, 8, 6, 883, // 7, 6 +7, 6, 399, 7, 7, 64455, 8, 6, 282, 8, 7, 400, // 7, 7 +6, 7, 282, 6, 8, 399, 7, 7, 399, 7, 8, 64456, // 7, 8 +6, 8, 622, 6, 9, 883, 7, 8, 875, 7, 9, 63156, // 7, 9 +6, 9, 985, 6, 10, 1405, 7, 9, 1380, 7, 10, 61766, // 7,10 +6, 10, 1341, 6, 11, 1922, 7, 10, 1871, 7, 11, 60402, // 7,11 +6, 11, 1687, 6, 12, 2430, 7, 11, 2343, 7, 12, 59076, // 7,12 +6, 12, 2022, 6, 13, 2926, 7, 12, 2795, 7, 13, 57793, // 7,13 +6, 13, 2346, 6, 14, 3411, 7, 13, 3227, 7, 14, 56552, // 7,14 +6, 14, 2659, 6, 15, 3885, 7, 14, 3640, 7, 15, 55352, // 7,15 +8, 0, 55352, 8, 1, 3640, 9, 0, 3885, 9, 1, 2659, // 8, 0 +8, 1, 56552, 8, 2, 3227, 9, 1, 3411, 9, 2, 2346, // 8, 1 +8, 2, 57793, 8, 3, 2795, 9, 2, 2926, 9, 3, 2022, // 8, 2 +8, 3, 59076, 8, 4, 2343, 9, 3, 2430, 9, 4, 1687, // 8, 3 +8, 4, 60402, 8, 5, 1871, 9, 4, 1922, 9, 5, 1341, // 8, 4 +8, 5, 61767, 8, 6, 1380, 9, 5, 1405, 9, 6, 984, // 8, 5 +8, 6, 63156, 8, 7, 875, 9, 6, 883, 9, 7, 622, // 8, 6 +8, 7, 64455, 8, 8, 399, 9, 7, 399, 9, 8, 283, // 8, 7 +7, 8, 399, 7, 9, 282, 8, 8, 64455, 8, 9, 400, // 8, 8 +7, 9, 883, 7, 10, 622, 8, 9, 63156, 8, 10, 875, // 8, 9 +7, 10, 1405, 7, 11, 985, 8, 10, 61767, 8, 11, 1379, // 8,10 +7, 11, 1922, 7, 12, 1341, 8, 11, 60402, 8, 12, 1871, // 8,11 +7, 12, 2430, 7, 13, 1687, 8, 12, 59077, 8, 13, 2342, // 8,12 +7, 13, 2926, 7, 14, 2022, 8, 13, 57795, 8, 14, 2793, // 8,13 +7, 14, 3411, 7, 15, 2346, 8, 14, 56554, 8, 15, 3225, // 8,14 +7, 15, 3885, 7, 16, 2659, 8, 15, 55354, 8, 16, 3638, // 8,15 +9, 0, 55164, 9, 1, 3724, 10, 0, 3939, 10, 1, 2709, // 9, 0 +9, 1, 56339, 9, 2, 3319, 10, 1, 3476, 10, 2, 2402, // 9, 1 +9, 2, 57544, 9, 3, 2898, 10, 2, 3007, 10, 3, 2087, // 9, 2 +9, 3, 58774, 9, 4, 2464, 10, 3, 2532, 10, 4, 1766, // 9, 3 +9, 4, 60017, 9, 5, 2020, 10, 4, 2057, 10, 5, 1442, // 9, 4 +9, 5, 61243, 9, 6, 1579, 10, 5, 1593, 10, 6, 1121, // 9, 5 +9, 6, 62369, 9, 7, 1170, 10, 6, 1170, 10, 7, 827, // 9, 6 +9, 7, 63156, 9, 8, 883, 10, 7, 875, 10, 8, 622, // 9, 7 +8, 8, 875, 8, 9, 622, 9, 8, 63156, 9, 9, 883, // 9, 8 +8, 9, 1170, 8, 10, 827, 9, 9, 62369, 9, 10, 1170, // 9, 9 +8, 10, 1593, 8, 11, 1121, 9, 10, 61243, 9, 11, 1579, // 9,10 +8, 11, 2057, 8, 12, 1442, 9, 11, 60018, 9, 12, 2019, // 9,11 +8, 12, 2532, 8, 13, 1766, 9, 12, 58775, 9, 13, 2463, // 9,12 +8, 13, 3007, 8, 14, 2088, 9, 13, 57545, 9, 14, 2896, // 9,13 +8, 14, 3477, 8, 15, 2402, 9, 14, 56340, 9, 15, 3317, // 9,14 +8, 15, 3940, 8, 16, 2709, 9, 15, 55166, 9, 16, 3721, // 9,15 +10, 0, 54833, 10, 1, 3860, 11, 0, 4046, 11, 1, 2797, // 10, 0 +10, 1, 55958, 10, 2, 3472, 11, 1, 3604, 11, 2, 2502, // 10, 1 +10, 2, 57095, 10, 3, 3074, 11, 2, 3161, 11, 3, 2206, // 10, 2 +10, 3, 58233, 10, 4, 2673, 11, 3, 2722, 11, 4, 1908, // 10, 3 +10, 4, 59345, 10, 5, 2276, 11, 4, 2297, 11, 5, 1618, // 10, 4 +10, 5, 60381, 10, 6, 1904, 11, 5, 1904, 11, 6, 1347, // 10, 5 +10, 6, 61243, 10, 7, 1593, 11, 6, 1578, 11, 7, 1122, // 10, 6 +10, 7, 61767, 10, 8, 1405, 11, 7, 1380, 11, 8, 984, // 10, 7 +9, 8, 1380, 9, 9, 985, 10, 8, 61767, 10, 9, 1404, // 10, 8 +9, 9, 1579, 9, 10, 1121, 10, 9, 61243, 10, 10, 1593, // 10, 9 +9, 10, 1904, 9, 11, 1347, 10, 10, 60381, 10, 11, 1904, // 10,10 +9, 11, 2297, 9, 12, 1617, 10, 11, 59346, 10, 12, 2276, // 10,11 +9, 12, 2723, 9, 13, 1908, 10, 12, 58234, 10, 13, 2671, // 10,12 +9, 13, 3161, 9, 14, 2205, 10, 13, 57096, 10, 14, 3074, // 10,13 +9, 14, 3605, 9, 15, 2502, 10, 14, 55959, 10, 15, 3470, // 10,14 +9, 15, 4047, 9, 16, 2796, 10, 15, 54835, 10, 16, 3858, // 10,15 +11, 0, 54376, 11, 1, 4043, 12, 0, 4200, 12, 1, 2917, // 11, 0 +11, 1, 55434, 11, 2, 3678, 12, 1, 3783, 12, 2, 2641, // 11, 1 +11, 2, 56486, 11, 3, 3311, 12, 2, 3373, 12, 3, 2366, // 11, 2 +11, 3, 57514, 11, 4, 2950, 12, 3, 2976, 12, 4, 2096, // 11, 3 +11, 4, 58484, 11, 5, 2605, 12, 4, 2604, 12, 5, 1843, // 11, 4 +11, 5, 59346, 11, 6, 2297, 12, 5, 2276, 12, 6, 1617, // 11, 5 +11, 6, 60018, 11, 7, 2057, 12, 6, 2020, 12, 7, 1441, // 11, 6 +11, 7, 60402, 11, 8, 1922, 12, 7, 1871, 12, 8, 1341, // 11, 7 +10, 8, 1871, 10, 9, 1341, 11, 8, 60402, 11, 9, 1922, // 11, 8 +10, 9, 2020, 10, 10, 1442, 11, 9, 60017, 11, 10, 2057, // 11, 9 +10, 10, 2276, 10, 11, 1617, 11, 10, 59345, 11, 11, 2298, // 11,10 +10, 11, 2605, 10, 12, 1843, 11, 11, 58484, 11, 12, 2604, // 11,11 +10, 12, 2977, 10, 13, 2096, 11, 12, 57514, 11, 13, 2949, // 11,12 +10, 13, 3374, 10, 14, 2365, 11, 13, 56487, 11, 14, 3310, // 11,13 +10, 14, 3785, 10, 15, 2640, 11, 14, 55435, 11, 15, 3676, // 11,14 +10, 15, 4201, 10, 16, 2916, 11, 15, 54378, 11, 16, 4041, // 11,15 +12, 0, 53814, 12, 1, 4267, 13, 0, 4390, 13, 1, 3065, // 12, 0 +12, 1, 54796, 12, 2, 3929, 13, 1, 4003, 13, 2, 2808, // 12, 1 +12, 2, 55756, 12, 3, 3595, 13, 2, 3628, 13, 3, 2557, // 12, 2 +12, 3, 56673, 12, 4, 3274, 13, 3, 3273, 13, 4, 2316, // 12, 3 +12, 4, 57514, 12, 5, 2977, 13, 4, 2948, 13, 5, 2097, // 12, 4 +12, 5, 58234, 12, 6, 2723, 13, 5, 2672, 13, 6, 1907, // 12, 5 +12, 6, 58775, 12, 7, 2532, 13, 6, 2463, 13, 7, 1766, // 12, 6 +12, 7, 59077, 12, 8, 2430, 13, 7, 2342, 13, 8, 1687, // 12, 7 +11, 8, 2343, 11, 9, 1687, 12, 8, 59076, 12, 9, 2430, // 12, 8 +11, 9, 2464, 11, 10, 1767, 12, 9, 58774, 12, 10, 2531, // 12, 9 +11, 10, 2673, 11, 11, 1908, 12, 10, 58233, 12, 11, 2722, // 12,10 +11, 11, 2950, 11, 12, 2096, 12, 11, 57514, 12, 12, 2976, // 12,11 +11, 12, 3274, 11, 13, 2317, 12, 12, 56673, 12, 13, 3272, // 12,12 +11, 13, 3630, 11, 14, 2556, 12, 13, 55756, 12, 14, 3594, // 12,13 +11, 14, 4005, 11, 15, 2808, 12, 14, 54796, 12, 15, 3927, // 12,14 +11, 15, 4392, 11, 16, 3064, 12, 15, 53815, 12, 16, 4265, // 12,15 +13, 0, 53168, 13, 1, 4523, 14, 0, 4610, 14, 1, 3235, // 13, 0 +13, 1, 54071, 13, 2, 4214, 14, 1, 4253, 14, 2, 2998, // 13, 1 +13, 2, 54941, 13, 3, 3913, 14, 2, 3911, 14, 3, 2771, // 13, 2 +13, 3, 55756, 13, 4, 3630, 14, 3, 3594, 14, 4, 2556, // 13, 3 +13, 4, 56487, 13, 5, 3374, 14, 4, 3310, 14, 5, 2365, // 13, 4 +13, 5, 57096, 13, 6, 3161, 14, 5, 3073, 14, 6, 2206, // 13, 5 +13, 6, 57545, 13, 7, 3007, 14, 6, 2897, 14, 7, 2087, // 13, 6 +13, 7, 57795, 13, 8, 2926, 14, 7, 2794, 14, 8, 2021, // 13, 7 +12, 8, 2795, 12, 9, 2022, 13, 8, 57793, 13, 9, 2926, // 13, 8 +12, 9, 2898, 12, 10, 2088, 13, 9, 57544, 13, 10, 3006, // 13, 9 +12, 10, 3074, 12, 11, 2205, 13, 10, 57095, 13, 11, 3162, // 13,10 +12, 11, 3311, 12, 12, 2365, 13, 11, 56486, 13, 12, 3374, // 13,11 +12, 12, 3595, 12, 13, 2557, 13, 12, 55756, 13, 13, 3628, // 13,12 +12, 13, 3913, 12, 14, 2770, 13, 13, 54941, 13, 14, 3912, // 13,13 +12, 14, 4255, 12, 15, 2998, 13, 14, 54072, 13, 15, 4211, // 13,14 +12, 15, 4612, 12, 16, 3235, 13, 15, 53168, 13, 16, 4521, // 13,15 +14, 0, 52457, 14, 1, 4806, 15, 0, 4851, 15, 1, 3422, // 14, 0 +14, 1, 53285, 14, 2, 4525, 15, 1, 4522, 15, 2, 3204, // 14, 1 +14, 2, 54072, 14, 3, 4255, 15, 2, 4212, 15, 3, 2997, // 14, 2 +14, 3, 54796, 14, 4, 4005, 15, 3, 3927, 15, 4, 2808, // 14, 3 +14, 4, 55435, 14, 5, 3785, 15, 4, 3677, 15, 5, 2639, // 14, 4 +14, 5, 55959, 14, 6, 3605, 15, 5, 3470, 15, 6, 2502, // 14, 5 +14, 6, 56340, 14, 7, 3477, 15, 6, 3317, 15, 7, 2402, // 14, 6 +14, 7, 56554, 14, 8, 3411, 15, 7, 3225, 15, 8, 2346, // 14, 7 +13, 8, 3227, 13, 9, 2346, 14, 8, 56552, 14, 9, 3411, // 14, 8 +13, 9, 3319, 13, 10, 2403, 14, 9, 56339, 14, 10, 3475, // 14, 9 +13, 10, 3472, 13, 11, 2503, 14, 10, 55958, 14, 11, 3603, // 14,10 +13, 11, 3678, 13, 12, 2640, 14, 11, 55434, 14, 12, 3784, // 14,11 +13, 12, 3929, 13, 13, 2808, 14, 12, 54796, 14, 13, 4003, // 14,12 +13, 13, 4214, 13, 14, 2998, 14, 13, 54071, 14, 14, 4253, // 14,13 +13, 14, 4525, 13, 15, 3204, 14, 14, 53285, 14, 15, 4522, // 14,14 +13, 15, 4854, 13, 16, 3421, 14, 15, 52457, 14, 16, 4804, // 14,15 +15, 0, 51699, 15, 1, 5110, 16, 0, 5106, 16, 1, 3621, // 15, 0 +15, 1, 52457, 15, 2, 4854, 16, 1, 4803, 16, 2, 3422, // 15, 1 +15, 2, 53168, 15, 3, 4612, 16, 2, 4521, 16, 3, 3235, // 15, 2 +15, 3, 53815, 15, 4, 4392, 16, 3, 4264, 16, 4, 3065, // 15, 3 +15, 4, 54378, 15, 5, 4201, 16, 4, 4041, 16, 5, 2916, // 15, 4 +15, 5, 54835, 15, 6, 4047, 16, 5, 3858, 16, 6, 2796, // 15, 5 +15, 6, 55166, 15, 7, 3940, 16, 6, 3722, 16, 7, 2708, // 15, 6 +15, 7, 55354, 15, 8, 3885, 16, 7, 3638, 16, 8, 2659, // 15, 7 +14, 8, 3640, 14, 9, 2659, 15, 8, 55352, 15, 9, 3885, // 15, 8 +14, 9, 3724, 14, 10, 2709, 15, 9, 55164, 15, 10, 3939, // 15, 9 +14, 10, 3860, 14, 11, 2797, 15, 10, 54833, 15, 11, 4046, // 15,10 +14, 11, 4043, 14, 12, 2917, 15, 11, 54376, 15, 12, 4200, // 15,11 +14, 12, 4267, 14, 13, 3065, 15, 12, 53814, 15, 13, 4390, // 15,12 +14, 13, 4523, 14, 14, 3235, 15, 13, 53168, 15, 14, 4610, // 15,13 +14, 14, 4806, 14, 15, 3422, 15, 14, 52457, 15, 15, 4851, // 15,14 +14, 15, 5110, 14, 16, 3621, 15, 15, 51699, 15, 16, 5106, // 15,15 +// angle of 1.0 degrees +0, -1, 8769, 0, 0, 41693, 1, -1, 6280, 1, 0, 8794, // 0, 0 +0, 0, 8452, 0, 1, 42821, 1, 0, 5975, 1, 1, 8288, // 0, 1 +0, 1, 8141, 0, 2, 43900, 1, 1, 5684, 1, 2, 7811, // 0, 2 +0, 2, 7848, 0, 3, 44901, 1, 2, 5413, 1, 3, 7374, // 0, 3 +0, 3, 7587, 0, 4, 45791, 1, 3, 5172, 1, 4, 6986, // 0, 4 +0, 4, 7374, 0, 5, 46532, 1, 4, 4971, 1, 5, 6659, // 0, 5 +0, 5, 7227, 0, 6, 47086, 1, 5, 4818, 1, 6, 6405, // 0, 6 +0, 6, 7158, 0, 7, 47426, 1, 6, 4722, 1, 7, 6230, // 0, 7 +-1, 7, 4718, -1, 8, 6217, 0, 7, 7161, 0, 8, 47440, // 0, 8 +-1, 8, 4814, -1, 9, 6391, 0, 8, 7233, 0, 9, 47098, // 0, 9 +-1, 9, 4967, -1, 10, 6644, 0, 9, 7383, 0, 10, 46542, // 0,10 +-1, 10, 5169, -1, 11, 6970, 0, 10, 7599, 0, 11, 45798, // 0,11 +-1, 11, 5410, -1, 12, 7356, 0, 11, 7863, 0, 12, 44907, // 0,12 +-1, 12, 5682, -1, 13, 7791, 0, 12, 8159, 0, 13, 43904, // 0,13 +-1, 13, 5974, -1, 14, 8265, 0, 13, 8474, 0, 14, 42823, // 0,14 +-1, 14, 6280, -1, 15, 8769, 0, 14, 8795, 0, 15, 41692, // 0,15 +1, -1, 8265, 1, 0, 42823, 2, -1, 5974, 2, 0, 8474, // 1, 0 +1, 0, 7901, 1, 1, 44074, 2, 0, 5640, 2, 1, 7921, // 1, 1 +1, 1, 7539, 1, 2, 45286, 2, 1, 5316, 2, 2, 7395, // 1, 2 +1, 2, 7191, 1, 3, 46427, 2, 2, 5011, 2, 3, 6907, // 1, 3 +1, 3, 6875, 1, 4, 47453, 2, 3, 4736, 2, 4, 6472, // 1, 4 +1, 4, 6613, 1, 5, 48314, 2, 4, 4505, 2, 5, 6104, // 1, 5 +1, 5, 6425, 1, 6, 48960, 2, 5, 4330, 2, 6, 5821, // 1, 6 +1, 6, 6332, 1, 7, 49347, 2, 6, 4224, 2, 7, 5633, // 1, 7 +0, 7, 4221, 0, 8, 5623, 1, 7, 6335, 1, 8, 49357, // 1, 8 +0, 8, 4327, 0, 9, 5809, 1, 8, 6430, 1, 9, 48970, // 1, 9 +0, 9, 4502, 0, 10, 6092, 1, 9, 6620, 1, 10, 48322, // 1,10 +0, 10, 4734, 0, 11, 6458, 1, 10, 6886, 1, 11, 47458, // 1,11 +0, 11, 5009, 0, 12, 6892, 1, 11, 7204, 1, 12, 46431, // 1,12 +0, 12, 5315, 0, 13, 7378, 1, 12, 7555, 1, 13, 45288, // 1,13 +0, 13, 5640, 0, 14, 7901, 1, 13, 7921, 1, 14, 44074, // 1,14 +0, 14, 5975, 0, 15, 8452, 1, 14, 8288, 1, 15, 42821, // 1,15 +2, -1, 7791, 2, 0, 43904, 3, -1, 5682, 3, 0, 8159, // 2, 0 +2, 0, 7378, 2, 1, 45288, 3, 0, 5315, 3, 1, 7555, // 2, 1 +2, 1, 6959, 2, 2, 46650, 3, 1, 4954, 3, 2, 6973, // 2, 2 +2, 2, 6549, 2, 3, 47953, 3, 2, 4608, 3, 3, 6426, // 2, 3 +2, 3, 6168, 2, 4, 49147, 3, 3, 4291, 3, 4, 5930, // 2, 4 +2, 4, 5842, 2, 5, 50165, 3, 4, 4020, 3, 5, 5509, // 2, 5 +2, 5, 5602, 2, 6, 50935, 3, 5, 3815, 3, 6, 5184, // 2, 6 +2, 6, 5478, 2, 7, 51387, 3, 6, 3693, 3, 7, 4978, // 2, 7 +1, 7, 3691, 1, 8, 4970, 2, 7, 5480, 2, 8, 51395, // 2, 8 +1, 8, 3813, 1, 9, 5175, 2, 8, 5606, 2, 9, 50942, // 2, 9 +1, 9, 4019, 1, 10, 5499, 2, 9, 5848, 2, 10, 50170, // 2,10 +1, 10, 4290, 1, 11, 5920, 2, 10, 6176, 2, 11, 49150, // 2,11 +1, 11, 4607, 1, 12, 6414, 2, 11, 6560, 2, 12, 47955, // 2,12 +1, 12, 4954, 1, 13, 6959, 2, 12, 6973, 2, 13, 46650, // 2,13 +1, 13, 5316, 1, 14, 7539, 2, 13, 7395, 2, 14, 45286, // 2,14 +1, 14, 5684, 1, 15, 8141, 2, 14, 7812, 2, 15, 43899, // 2,15 +3, -1, 7356, 3, 0, 44907, 4, -1, 5410, 4, 0, 7863, // 3, 0 +3, 0, 6892, 3, 1, 46430, 4, 0, 5009, 4, 1, 7205, // 3, 1 +3, 1, 6414, 3, 2, 47955, 4, 1, 4607, 4, 2, 6560, // 3, 2 +3, 2, 5934, 3, 3, 49445, 4, 2, 4214, 4, 3, 5943, // 3, 3 +3, 3, 5474, 3, 4, 50843, 4, 3, 3846, 4, 4, 5373, // 3, 4 +3, 4, 5069, 3, 5, 52066, 4, 4, 3523, 4, 5, 4878, // 3, 5 +3, 5, 4759, 3, 6, 53008, 4, 5, 3274, 4, 6, 4495, // 3, 6 +3, 6, 4592, 3, 7, 53557, 4, 6, 3128, 4, 7, 4259, // 3, 7 +2, 7, 3126, 2, 8, 4254, 3, 7, 4594, 3, 8, 53562, // 3, 8 +2, 8, 3273, 2, 9, 4489, 3, 8, 4762, 3, 9, 53012, // 3, 9 +2, 9, 3522, 2, 10, 4872, 3, 9, 5073, 3, 10, 52069, // 3,10 +2, 10, 3845, 2, 11, 5365, 3, 10, 5481, 3, 11, 50845, // 3,11 +2, 11, 4214, 2, 12, 5934, 3, 11, 5943, 3, 12, 49445, // 3,12 +2, 12, 4608, 2, 13, 6549, 3, 12, 6426, 3, 13, 47953, // 3,13 +2, 13, 5011, 2, 14, 7191, 3, 13, 6908, 3, 14, 46426, // 3,14 +2, 14, 5413, 2, 15, 7848, 3, 14, 7374, 3, 15, 44901, // 3,15 +4, -1, 6970, 4, 0, 45799, 5, -1, 5169, 5, 0, 7598, // 4, 0 +4, 0, 6458, 4, 1, 47458, 5, 0, 4734, 5, 1, 6886, // 4, 1 +4, 1, 5920, 4, 2, 49150, 5, 1, 4290, 5, 2, 6176, // 4, 2 +4, 2, 5365, 4, 3, 50844, 5, 2, 3845, 5, 3, 5482, // 4, 3 +4, 3, 4816, 4, 4, 52484, 5, 3, 3415, 5, 4, 4821, // 4, 4 +4, 4, 4309, 4, 5, 53973, 5, 4, 3023, 5, 5, 4231, // 4, 5 +4, 5, 3902, 4, 6, 55164, 5, 5, 2711, 5, 6, 3759, // 4, 6 +4, 6, 3671, 4, 7, 55867, 5, 6, 2525, 5, 7, 3473, // 4, 7 +3, 7, 2524, 3, 8, 3469, 4, 7, 3672, 4, 8, 55871, // 4, 8 +3, 8, 2710, 3, 9, 3755, 4, 8, 3904, 4, 9, 55167, // 4, 9 +3, 9, 3023, 3, 10, 4226, 4, 9, 4313, 4, 10, 53974, // 4,10 +3, 10, 3415, 3, 11, 4816, 4, 10, 4822, 4, 11, 52483, // 4,11 +3, 11, 3846, 3, 12, 5474, 4, 11, 5373, 4, 12, 50843, // 4,12 +3, 12, 4291, 3, 13, 6168, 4, 12, 5930, 4, 13, 49147, // 4,13 +3, 13, 4736, 3, 14, 6875, 4, 13, 6472, 4, 14, 47453, // 4,14 +3, 14, 5172, 3, 15, 7587, 4, 14, 6986, 4, 15, 45791, // 4,15 +5, -1, 6644, 5, 0, 46541, 6, -1, 4967, 6, 0, 7384, // 5, 0 +5, 0, 6092, 5, 1, 48322, 6, 0, 4502, 6, 1, 6620, // 5, 1 +5, 1, 5499, 5, 2, 50171, 6, 1, 4019, 6, 2, 5847, // 5, 2 +5, 2, 4872, 5, 3, 52069, 6, 2, 3522, 6, 3, 5073, // 5, 3 +5, 3, 4226, 5, 4, 53975, 6, 3, 3023, 6, 4, 4312, // 5, 4 +5, 4, 3595, 5, 5, 55798, 6, 4, 2546, 6, 5, 3597, // 5, 5 +5, 5, 3050, 5, 6, 57353, 6, 5, 2138, 6, 6, 2995, // 5, 6 +5, 6, 2713, 5, 7, 58322, 6, 6, 1884, 6, 7, 2617, // 5, 7 +4, 7, 1884, 4, 8, 2615, 5, 7, 2714, 5, 8, 58323, // 5, 8 +4, 8, 2138, 4, 9, 2993, 5, 8, 3051, 5, 9, 57354, // 5, 9 +4, 9, 2546, 4, 10, 3595, 5, 9, 3598, 5, 10, 55797, // 5,10 +4, 10, 3023, 4, 11, 4309, 5, 10, 4230, 5, 11, 53974, // 5,11 +4, 11, 3523, 4, 12, 5069, 5, 11, 4879, 5, 12, 52065, // 5,12 +4, 12, 4020, 4, 13, 5842, 5, 12, 5508, 5, 13, 50166, // 5,13 +4, 13, 4505, 4, 14, 6613, 5, 13, 6104, 5, 14, 48314, // 5,14 +4, 14, 4971, 4, 15, 7374, 5, 14, 6659, 5, 15, 46532, // 5,15 +6, -1, 6391, 6, 0, 47098, 7, -1, 4814, 7, 0, 7233, // 6, 0 +6, 0, 5809, 6, 1, 48969, 7, 0, 4327, 7, 1, 6431, // 6, 1 +6, 1, 5175, 6, 2, 50942, 7, 1, 3813, 7, 2, 5606, // 6, 2 +6, 2, 4489, 6, 3, 53012, 7, 2, 3273, 7, 3, 4762, // 6, 3 +6, 3, 3755, 6, 4, 55166, 7, 3, 2710, 7, 4, 3905, // 6, 4 +6, 4, 2993, 6, 5, 57354, 7, 4, 2138, 7, 5, 3051, // 6, 5 +6, 5, 2258, 6, 6, 59422, 7, 5, 1597, 7, 6, 2259, // 6, 6 +6, 6, 1726, 6, 7, 60905, 7, 6, 1210, 7, 7, 1695, // 6, 7 +5, 7, 1209, 5, 8, 1695, 6, 7, 1726, 6, 8, 60906, // 6, 8 +5, 8, 1597, 5, 9, 2258, 6, 8, 2259, 6, 9, 59422, // 6, 9 +5, 9, 2138, 5, 10, 3050, 6, 9, 2995, 6, 10, 57353, // 6,10 +5, 10, 2711, 5, 11, 3902, 6, 10, 3759, 6, 11, 55164, // 6,11 +5, 11, 3274, 5, 12, 4759, 6, 11, 4495, 6, 12, 53008, // 6,12 +5, 12, 3815, 5, 13, 5602, 6, 12, 5184, 6, 13, 50935, // 6,13 +5, 13, 4330, 5, 14, 6425, 6, 13, 5820, 6, 14, 48961, // 6,14 +5, 14, 4818, 5, 15, 7227, 6, 14, 6405, 6, 15, 47086, // 6,15 +7, -1, 6217, 7, 0, 47440, 8, -1, 4718, 8, 0, 7161, // 7, 0 +7, 0, 5623, 7, 1, 49358, 8, 0, 4221, 8, 1, 6334, // 7, 1 +7, 1, 4970, 7, 2, 51395, 8, 1, 3691, 8, 2, 5480, // 7, 2 +7, 2, 4254, 7, 3, 53562, 8, 2, 3126, 8, 3, 4594, // 7, 3 +7, 3, 3469, 7, 4, 55870, 8, 3, 2524, 8, 4, 3673, // 7, 4 +7, 4, 2615, 7, 5, 58324, 8, 4, 1884, 8, 5, 2713, // 7, 5 +7, 5, 1695, 7, 6, 60906, 8, 5, 1209, 8, 6, 1726, // 7, 6 +7, 6, 789, 7, 7, 63399, 8, 6, 558, 8, 7, 790, // 7, 7 +6, 7, 558, 6, 8, 789, 7, 7, 789, 7, 8, 63400, // 7, 8 +6, 8, 1210, 6, 9, 1726, 7, 8, 1695, 7, 9, 60905, // 7, 9 +6, 9, 1884, 6, 10, 2713, 7, 9, 2616, 7, 10, 58323, // 7,10 +6, 10, 2525, 6, 11, 3671, 7, 10, 3473, 7, 11, 55867, // 7,11 +6, 11, 3128, 6, 12, 4592, 7, 11, 4259, 7, 12, 53557, // 7,12 +6, 12, 3693, 6, 13, 5478, 7, 12, 4978, 7, 13, 51387, // 7,13 +6, 13, 4224, 6, 14, 6332, 7, 13, 5633, 7, 14, 49347, // 7,14 +6, 14, 4722, 6, 15, 7158, 7, 14, 6230, 7, 15, 47426, // 7,15 +8, 0, 47426, 8, 1, 6230, 9, 0, 7158, 9, 1, 4722, // 8, 0 +8, 1, 49347, 8, 2, 5633, 9, 1, 6332, 9, 2, 4224, // 8, 1 +8, 2, 51387, 8, 3, 4978, 9, 2, 5478, 9, 3, 3693, // 8, 2 +8, 3, 53557, 8, 4, 4259, 9, 3, 4592, 9, 4, 3128, // 8, 3 +8, 4, 55867, 8, 5, 3473, 9, 4, 3671, 9, 5, 2525, // 8, 4 +8, 5, 58322, 8, 6, 2616, 9, 5, 2713, 9, 6, 1885, // 8, 5 +8, 6, 60905, 8, 7, 1695, 9, 6, 1726, 9, 7, 1210, // 8, 6 +8, 7, 63399, 8, 8, 789, 9, 7, 789, 9, 8, 559, // 8, 7 +7, 8, 789, 7, 9, 558, 8, 8, 63399, 8, 9, 790, // 8, 8 +7, 9, 1726, 7, 10, 1209, 8, 9, 60906, 8, 10, 1695, // 8, 9 +7, 10, 2714, 7, 11, 1884, 8, 10, 58324, 8, 11, 2614, // 8,10 +7, 11, 3672, 7, 12, 2524, 8, 11, 55870, 8, 12, 3470, // 8,11 +7, 12, 4594, 7, 13, 3126, 8, 12, 53562, 8, 13, 4254, // 8,12 +7, 13, 5480, 7, 14, 3691, 8, 13, 51395, 8, 14, 4970, // 8,13 +7, 14, 6335, 7, 15, 4221, 8, 14, 49358, 8, 15, 5622, // 8,14 +7, 15, 7161, 7, 16, 4718, 8, 15, 47440, 8, 16, 6217, // 8,15 +9, 0, 47086, 9, 1, 6405, 10, 0, 7227, 10, 1, 4818, // 9, 0 +9, 1, 48960, 9, 2, 5820, 10, 1, 6425, 10, 2, 4331, // 9, 1 +9, 2, 50935, 9, 3, 5184, 10, 2, 5602, 10, 3, 3815, // 9, 2 +9, 3, 53008, 9, 4, 4495, 10, 3, 4759, 10, 4, 3274, // 9, 3 +9, 4, 55164, 9, 5, 3759, 10, 4, 3902, 10, 5, 2711, // 9, 4 +9, 5, 57353, 9, 6, 2995, 10, 5, 3050, 10, 6, 2138, // 9, 5 +9, 6, 59422, 9, 7, 2259, 10, 6, 2258, 10, 7, 1597, // 9, 6 +9, 7, 60906, 9, 8, 1726, 10, 7, 1695, 10, 8, 1209, // 9, 7 +8, 8, 1695, 8, 9, 1210, 9, 8, 60905, 9, 9, 1726, // 9, 8 +8, 9, 2259, 8, 10, 1597, 9, 9, 59422, 9, 10, 2258, // 9, 9 +8, 10, 3051, 8, 11, 2138, 9, 10, 57354, 9, 11, 2993, // 9,10 +8, 11, 3904, 8, 12, 2710, 9, 11, 55166, 9, 12, 3756, // 9,11 +8, 12, 4762, 8, 13, 3273, 9, 12, 53012, 9, 13, 4489, // 9,12 +8, 13, 5606, 8, 14, 3813, 9, 13, 50942, 9, 14, 5175, // 9,13 +8, 14, 6430, 8, 15, 4327, 9, 14, 48969, 9, 15, 5810, // 9,14 +8, 15, 7233, 8, 16, 4814, 9, 15, 47098, 9, 16, 6391, // 9,15 +10, 0, 46532, 10, 1, 6659, 11, 0, 7374, 11, 1, 4971, // 10, 0 +10, 1, 48314, 10, 2, 6104, 11, 1, 6613, 11, 2, 4505, // 10, 1 +10, 2, 50165, 10, 3, 5508, 11, 2, 5842, 11, 3, 4021, // 10, 2 +10, 3, 52066, 10, 4, 4879, 11, 3, 5069, 11, 4, 3522, // 10, 3 +10, 4, 53973, 10, 5, 4230, 11, 4, 4309, 11, 5, 3024, // 10, 4 +10, 5, 55798, 10, 6, 3598, 11, 5, 3595, 11, 6, 2545, // 10, 5 +10, 6, 57354, 10, 7, 3051, 11, 6, 2993, 11, 7, 2138, // 10, 6 +10, 7, 58324, 10, 8, 2714, 11, 7, 2615, 11, 8, 1883, // 10, 7 +9, 8, 2616, 9, 9, 1884, 10, 8, 58322, 10, 9, 2714, // 10, 8 +9, 9, 2995, 9, 10, 2138, 10, 9, 57353, 10, 10, 3050, // 10, 9 +9, 10, 3598, 9, 11, 2546, 10, 10, 55798, 10, 11, 3594, // 10,10 +9, 11, 4313, 9, 12, 3023, 10, 11, 53975, 10, 12, 4225, // 10,11 +9, 12, 5073, 9, 13, 3522, 10, 12, 52069, 10, 13, 4872, // 10,12 +9, 13, 5848, 9, 14, 4019, 10, 13, 50171, 10, 14, 5498, // 10,13 +9, 14, 6620, 9, 15, 4502, 10, 14, 48322, 10, 15, 6092, // 10,14 +9, 15, 7383, 9, 16, 4967, 10, 15, 46541, 10, 16, 6645, // 10,15 +11, 0, 45791, 11, 1, 6986, 12, 0, 7587, 12, 1, 5172, // 11, 0 +11, 1, 47453, 11, 2, 6472, 12, 1, 6875, 12, 2, 4736, // 11, 1 +11, 2, 49147, 11, 3, 5930, 12, 2, 6168, 12, 3, 4291, // 11, 2 +11, 3, 50843, 11, 4, 5373, 12, 3, 5474, 12, 4, 3846, // 11, 3 +11, 4, 52484, 11, 5, 4822, 12, 4, 4816, 12, 5, 3414, // 11, 4 +11, 5, 53975, 11, 6, 4313, 12, 5, 4226, 12, 6, 3022, // 11, 5 +11, 6, 55166, 11, 7, 3904, 12, 6, 3755, 12, 7, 2711, // 11, 6 +11, 7, 55870, 11, 8, 3672, 12, 7, 3469, 12, 8, 2525, // 11, 7 +10, 8, 3473, 10, 9, 2525, 11, 8, 55867, 11, 9, 3671, // 11, 8 +10, 9, 3759, 10, 10, 2711, 11, 9, 55164, 11, 10, 3902, // 11, 9 +10, 10, 4230, 10, 11, 3023, 11, 10, 53973, 11, 11, 4310, // 11,10 +10, 11, 4822, 10, 12, 3415, 11, 11, 52484, 11, 12, 4815, // 11,11 +10, 12, 5481, 10, 13, 3845, 11, 12, 50844, 11, 13, 5366, // 11,12 +10, 13, 6176, 10, 14, 4290, 11, 13, 49150, 11, 14, 5920, // 11,13 +10, 14, 6886, 10, 15, 4734, 11, 14, 47458, 11, 15, 6458, // 11,14 +10, 15, 7599, 10, 16, 5169, 11, 15, 45799, 11, 16, 6969, // 11,15 +12, 0, 44901, 12, 1, 7374, 13, 0, 7848, 13, 1, 5413, // 12, 0 +12, 1, 46427, 12, 2, 6908, 13, 1, 7191, 13, 2, 5010, // 12, 1 +12, 2, 47953, 12, 3, 6426, 13, 2, 6549, 13, 3, 4608, // 12, 2 +12, 3, 49445, 12, 4, 5943, 13, 3, 5934, 13, 4, 4214, // 12, 3 +12, 4, 50844, 12, 5, 5481, 13, 4, 5365, 13, 5, 3846, // 12, 4 +12, 5, 52069, 12, 6, 5073, 13, 5, 4872, 13, 6, 3522, // 12, 5 +12, 6, 53012, 12, 7, 4762, 13, 6, 4489, 13, 7, 3273, // 12, 6 +12, 7, 53562, 12, 8, 4594, 13, 7, 4254, 13, 8, 3126, // 12, 7 +11, 8, 4259, 11, 9, 3128, 12, 8, 53557, 12, 9, 4592, // 12, 8 +11, 9, 4495, 11, 10, 3274, 12, 9, 53008, 12, 10, 4759, // 12, 9 +11, 10, 4879, 11, 11, 3523, 12, 10, 52066, 12, 11, 5068, // 12,10 +11, 11, 5373, 11, 12, 3846, 12, 11, 50843, 12, 12, 5474, // 12,11 +11, 12, 5943, 11, 13, 4214, 12, 12, 49445, 12, 13, 5934, // 12,12 +11, 13, 6560, 11, 14, 4607, 12, 13, 47955, 12, 14, 6414, // 12,13 +11, 14, 7204, 11, 15, 5009, 12, 14, 46430, 12, 15, 6893, // 12,14 +11, 15, 7863, 11, 16, 5410, 12, 15, 44907, 12, 16, 7356, // 12,15 +13, 0, 43900, 13, 1, 7812, 14, 0, 8141, 14, 1, 5683, // 13, 0 +13, 1, 45286, 13, 2, 7395, 14, 1, 7539, 14, 2, 5316, // 13, 1 +13, 2, 46650, 13, 3, 6973, 14, 2, 6959, 14, 3, 4954, // 13, 2 +13, 3, 47955, 13, 4, 6560, 14, 3, 6414, 14, 4, 4607, // 13, 3 +13, 4, 49150, 13, 5, 6176, 14, 4, 5920, 14, 5, 4290, // 13, 4 +13, 5, 50171, 13, 6, 5848, 14, 5, 5499, 14, 6, 4018, // 13, 5 +13, 6, 50942, 13, 7, 5606, 14, 6, 5175, 14, 7, 3813, // 13, 6 +13, 7, 51395, 13, 8, 5480, 14, 7, 4970, 14, 8, 3691, // 13, 7 +12, 8, 4978, 12, 9, 3693, 13, 8, 51387, 13, 9, 5478, // 13, 8 +12, 9, 5184, 12, 10, 3815, 13, 9, 50935, 13, 10, 5602, // 13, 9 +12, 10, 5508, 12, 11, 4020, 13, 10, 50165, 13, 11, 5843, // 13,10 +12, 11, 5930, 12, 12, 4291, 13, 11, 49147, 13, 12, 6168, // 13,11 +12, 12, 6426, 12, 13, 4608, 13, 12, 47953, 13, 13, 6549, // 13,12 +12, 13, 6973, 12, 14, 4954, 13, 13, 46650, 13, 14, 6959, // 13,13 +12, 14, 7555, 12, 15, 5315, 13, 14, 45288, 13, 15, 7378, // 13,14 +12, 15, 8159, 12, 16, 5682, 13, 15, 43904, 13, 16, 7791, // 13,15 +14, 0, 42821, 14, 1, 8288, 15, 0, 8452, 15, 1, 5975, // 14, 0 +14, 1, 44074, 14, 2, 7921, 15, 1, 7901, 15, 2, 5640, // 14, 1 +14, 2, 45288, 14, 3, 7555, 15, 2, 7378, 15, 3, 5315, // 14, 2 +14, 3, 46430, 14, 4, 7204, 15, 3, 6892, 15, 4, 5010, // 14, 3 +14, 4, 47458, 14, 5, 6886, 15, 4, 6458, 15, 5, 4734, // 14, 4 +14, 5, 48322, 14, 6, 6620, 15, 5, 6092, 15, 6, 4502, // 14, 5 +14, 6, 48969, 14, 7, 6430, 15, 6, 5809, 15, 7, 4328, // 14, 6 +14, 7, 49358, 14, 8, 6335, 15, 7, 5623, 15, 8, 4220, // 14, 7 +13, 8, 5633, 13, 9, 4224, 14, 8, 49347, 14, 9, 6332, // 14, 8 +13, 9, 5820, 13, 10, 4330, 14, 9, 48960, 14, 10, 6426, // 14, 9 +13, 10, 6104, 13, 11, 4505, 14, 10, 48314, 14, 11, 6613, // 14,10 +13, 11, 6472, 13, 12, 4736, 14, 11, 47453, 14, 12, 6875, // 14,11 +13, 12, 6908, 13, 13, 5011, 14, 12, 46427, 14, 13, 7190, // 14,12 +13, 13, 7395, 13, 14, 5316, 14, 13, 45286, 14, 14, 7539, // 14,13 +13, 14, 7921, 13, 15, 5640, 14, 14, 44074, 14, 15, 7901, // 14,14 +13, 15, 8474, 13, 16, 5974, 14, 15, 42823, 14, 16, 8265, // 14,15 +15, 0, 41693, 15, 1, 8795, 16, 0, 8769, 16, 1, 6279, // 15, 0 +15, 1, 42823, 15, 2, 8474, 16, 1, 8265, 16, 2, 5974, // 15, 1 +15, 2, 43904, 15, 3, 8159, 16, 2, 7791, 16, 3, 5682, // 15, 2 +15, 3, 44907, 15, 4, 7863, 16, 3, 7356, 16, 4, 5410, // 15, 3 +15, 4, 45799, 15, 5, 7599, 16, 4, 6970, 16, 5, 5168, // 15, 4 +15, 5, 46541, 15, 6, 7383, 16, 5, 6644, 16, 6, 4968, // 15, 5 +15, 6, 47098, 15, 7, 7233, 16, 6, 6391, 16, 7, 4814, // 15, 6 +15, 7, 47440, 15, 8, 7161, 16, 7, 6217, 16, 8, 4718, // 15, 7 +14, 8, 6230, 14, 9, 4722, 15, 8, 47426, 15, 9, 7158, // 15, 8 +14, 9, 6405, 14, 10, 4818, 15, 9, 47086, 15, 10, 7227, // 15, 9 +14, 10, 6659, 14, 11, 4971, 15, 10, 46532, 15, 11, 7374, // 15,10 +14, 11, 6986, 14, 12, 5172, 15, 11, 45791, 15, 12, 7587, // 15,11 +14, 12, 7374, 14, 13, 5413, 15, 12, 44901, 15, 13, 7848, // 15,12 +14, 13, 7812, 14, 14, 5684, 15, 13, 43900, 15, 14, 8140, // 15,13 +14, 14, 8288, 14, 15, 5975, 15, 14, 42821, 15, 15, 8452, // 15,14 +14, 15, 8795, 14, 16, 6280, 15, 15, 41693, 15, 16, 8768, // 15,15 +// angle of 1.5 degrees +0, -1, 11440, 0, 0, 34212, 1, -1, 8358, 1, 0, 11526, // 0, 0 +0, 0, 11192, 0, 1, 35502, 1, 0, 7987, 1, 1, 10855, // 0, 1 +0, 1, 10930, 0, 2, 36756, 1, 1, 7626, 1, 2, 10224, // 0, 2 +0, 2, 10670, 0, 3, 37939, 1, 2, 7285, 1, 3, 9642, // 0, 3 +0, 3, 10430, 0, 4, 39009, 1, 3, 6975, 1, 4, 9122, // 0, 4 +0, 4, 10232, 0, 5, 39918, 1, 4, 6710, 1, 5, 8676, // 0, 5 +0, 5, 10100, 0, 6, 40618, 1, 5, 6502, 1, 6, 8316, // 0, 6 +0, 6, 10052, 0, 7, 41072, 1, 6, 6360, 1, 7, 8052, // 0, 7 +-1, 7, 6346, -1, 8, 8018, 0, 7, 10066, 0, 8, 41106, // 0, 8 +-1, 8, 6489, -1, 9, 8278, 0, 8, 10123, 0, 9, 40646, // 0, 9 +-1, 9, 6699, -1, 10, 8632, 0, 9, 10265, 0, 10, 39940, // 0,10 +-1, 10, 6965, -1, 11, 9072, 0, 10, 10473, 0, 11, 39026, // 0,11 +-1, 11, 7276, -1, 12, 9585, 0, 11, 10723, 0, 12, 37952, // 0,12 +-1, 12, 7620, -1, 13, 10158, 0, 12, 10994, 0, 13, 36764, // 0,13 +-1, 13, 7983, -1, 14, 10780, 0, 13, 11267, 0, 14, 35506, // 0,14 +-1, 14, 8358, -1, 15, 11440, 0, 14, 11526, 0, 15, 34212, // 0,15 +1, -1, 10780, 1, 0, 35506, 2, -1, 7983, 2, 0, 11267, // 1, 0 +1, 0, 10467, 1, 1, 36959, 2, 0, 7579, 2, 1, 10531, // 1, 1 +1, 1, 10133, 1, 2, 38390, 2, 1, 7179, 2, 2, 9834, // 1, 2 +1, 2, 9796, 1, 3, 39759, 2, 2, 6797, 2, 3, 9184, // 1, 3 +1, 3, 9478, 1, 4, 41013, 2, 3, 6447, 2, 4, 8598, // 1, 4 +1, 4, 9206, 1, 5, 42087, 2, 4, 6145, 2, 5, 8098, // 1, 5 +1, 5, 9014, 1, 6, 42913, 2, 5, 5910, 2, 6, 7699, // 1, 6 +1, 6, 8929, 1, 7, 43433, 2, 6, 5756, 2, 7, 7418, // 1, 7 +0, 7, 5745, 0, 8, 7390, 1, 7, 8939, 1, 8, 43462, // 1, 8 +0, 8, 5900, 0, 9, 7667, 1, 8, 9032, 1, 9, 42937, // 1, 9 +0, 9, 6137, 0, 10, 8061, 1, 9, 9233, 1, 10, 42105, // 1,10 +0, 10, 6440, 0, 11, 8557, 1, 10, 9513, 1, 11, 41026, // 1,11 +0, 11, 6792, 0, 12, 9135, 1, 11, 9841, 1, 12, 39768, // 1,12 +0, 12, 7177, 0, 13, 9777, 1, 12, 10188, 1, 13, 38394, // 1,13 +0, 13, 7579, 0, 14, 10467, 1, 13, 10532, 1, 14, 36958, // 1,14 +0, 14, 7987, 0, 15, 11192, 1, 14, 10855, 1, 15, 35502, // 1,15 +2, -1, 10158, 2, 0, 36764, 3, -1, 7620, 3, 0, 10994, // 2, 0 +2, 0, 9777, 2, 1, 38394, 3, 0, 7177, 3, 1, 10188, // 2, 1 +2, 1, 9366, 2, 2, 40025, 3, 1, 6732, 3, 2, 9413, // 2, 2 +2, 2, 8941, 2, 3, 41614, 3, 2, 6299, 3, 3, 8682, // 2, 3 +2, 3, 8530, 2, 4, 43096, 3, 3, 5895, 3, 4, 8015, // 2, 4 +2, 4, 8167, 2, 5, 44386, 3, 4, 5543, 3, 5, 7440, // 2, 5 +2, 5, 7899, 2, 6, 45383, 3, 5, 5268, 3, 6, 6986, // 2, 6 +2, 6, 7766, 2, 7, 45995, 3, 6, 5095, 3, 7, 6680, // 2, 7 +1, 7, 5087, 1, 8, 6658, 2, 7, 7773, 2, 8, 46018, // 2, 8 +1, 8, 5261, 1, 9, 6961, 2, 8, 7913, 2, 9, 45401, // 2, 9 +1, 9, 5537, 1, 10, 7411, 2, 9, 8189, 2, 10, 44399, // 2,10 +1, 10, 5891, 1, 11, 7981, 2, 10, 8559, 2, 11, 43105, // 2,11 +1, 11, 6297, 1, 12, 8641, 2, 11, 8979, 2, 12, 41619, // 2,12 +1, 12, 6732, 1, 13, 9366, 2, 12, 9413, 2, 13, 40025, // 2,13 +1, 13, 7179, 1, 14, 10133, 2, 13, 9834, 2, 14, 38390, // 2,14 +1, 14, 7626, 1, 15, 10930, 2, 14, 10224, 2, 15, 36756, // 2,15 +3, -1, 9585, 3, 0, 37951, 4, -1, 7276, 4, 0, 10724, // 3, 0 +3, 0, 9135, 3, 1, 39767, 4, 0, 6792, 4, 1, 9842, // 3, 1 +3, 1, 8641, 3, 2, 41618, 4, 1, 6297, 4, 2, 8980, // 3, 2 +3, 2, 8120, 3, 3, 43461, 4, 2, 5804, 4, 3, 8151, // 3, 3 +3, 3, 7598, 3, 4, 45224, 4, 3, 5331, 4, 4, 7383, // 3, 4 +3, 4, 7121, 3, 5, 46798, 4, 4, 4909, 4, 5, 6708, // 3, 5 +3, 5, 6750, 3, 6, 48037, 4, 5, 4576, 4, 6, 6173, // 3, 6 +3, 6, 6552, 3, 7, 48785, 4, 6, 4372, 4, 7, 5827, // 3, 7 +2, 7, 4366, 2, 8, 5811, 3, 7, 6558, 3, 8, 48801, // 3, 8 +2, 8, 4572, 2, 9, 6154, 3, 8, 6761, 3, 9, 48049, // 3, 9 +2, 9, 4906, 2, 10, 6685, 3, 9, 7138, 3, 10, 46807, // 3,10 +2, 10, 5330, 2, 11, 7356, 3, 10, 7622, 3, 11, 45228, // 3,11 +2, 11, 5804, 2, 12, 8120, 3, 11, 8151, 3, 12, 43461, // 3,12 +2, 12, 6299, 2, 13, 8941, 3, 12, 8681, 3, 13, 41615, // 3,13 +2, 13, 6797, 2, 14, 9796, 3, 13, 9184, 3, 14, 39759, // 3,14 +2, 14, 7285, 2, 15, 10670, 3, 14, 9642, 3, 15, 37939, // 3,15 +4, -1, 9072, 4, 0, 39026, 5, -1, 6965, 5, 0, 10473, // 4, 0 +4, 0, 8557, 4, 1, 41026, 5, 0, 6440, 5, 1, 9513, // 4, 1 +4, 1, 7981, 4, 2, 43105, 5, 1, 5891, 5, 2, 8559, // 4, 2 +4, 2, 7356, 4, 3, 45229, 5, 2, 5330, 5, 3, 7621, // 4, 3 +4, 3, 6708, 4, 4, 47328, 5, 3, 4774, 5, 4, 6726, // 4, 4 +4, 4, 6086, 4, 5, 49275, 5, 4, 4258, 5, 5, 5917, // 4, 5 +4, 5, 5573, 4, 6, 50865, 5, 5, 3837, 5, 6, 5261, // 4, 6 +4, 6, 5280, 4, 7, 51832, 5, 6, 3579, 5, 7, 4845, // 4, 7 +3, 7, 3575, 3, 8, 4835, 4, 7, 5283, 4, 8, 51843, // 4, 8 +3, 8, 3834, 3, 9, 5248, 4, 8, 5581, 4, 9, 50873, // 4, 9 +3, 9, 4257, 3, 10, 5901, 4, 9, 6099, 4, 10, 49279, // 4,10 +3, 10, 4774, 3, 11, 6708, 4, 10, 6727, 4, 11, 47327, // 4,11 +3, 11, 5331, 3, 12, 7598, 4, 11, 7382, 4, 12, 45225, // 4,12 +3, 12, 5895, 3, 13, 8530, 4, 12, 8015, 4, 13, 43096, // 4,13 +3, 13, 6447, 3, 14, 9478, 4, 13, 8599, 4, 14, 41012, // 4,14 +3, 14, 6975, 3, 15, 10430, 4, 14, 9122, 4, 15, 39009, // 4,15 +5, -1, 8632, 5, 0, 39940, 6, -1, 6699, 6, 0, 10265, // 5, 0 +5, 0, 8061, 5, 1, 42105, 6, 0, 6137, 6, 1, 9233, // 5, 1 +5, 1, 7411, 5, 2, 44399, 6, 1, 5537, 6, 2, 8189, // 5, 2 +5, 2, 6685, 5, 3, 46806, 6, 2, 4906, 6, 3, 7139, // 5, 3 +5, 3, 5901, 5, 4, 49279, 6, 3, 4257, 6, 4, 6099, // 5, 4 +5, 4, 5103, 5, 5, 51700, 6, 4, 3621, 6, 5, 5112, // 5, 5 +5, 5, 4388, 5, 6, 53813, 6, 5, 3065, 6, 6, 4270, // 5, 6 +5, 6, 3938, 5, 7, 55162, 6, 6, 2710, 6, 7, 3726, // 5, 7 +4, 7, 2708, 4, 8, 3720, 5, 7, 3940, 5, 8, 55168, // 5, 8 +4, 8, 3064, 4, 9, 4262, 5, 8, 4394, 5, 9, 53816, // 5, 9 +4, 9, 3621, 4, 10, 5103, 5, 9, 5113, 5, 10, 51699, // 5,10 +4, 10, 4258, 4, 11, 6086, 5, 10, 5917, 5, 11, 49275, // 5,11 +4, 11, 4909, 4, 12, 7121, 5, 11, 6707, 5, 12, 46799, // 5,12 +4, 12, 5543, 4, 13, 8167, 5, 12, 7440, 5, 13, 44386, // 5,13 +4, 13, 6145, 4, 14, 9206, 5, 13, 8098, 5, 14, 42087, // 5,14 +4, 14, 6710, 4, 15, 10232, 5, 14, 8676, 5, 15, 39918, // 5,15 +6, -1, 8278, 6, 0, 40646, 7, -1, 6489, 7, 0, 10123, // 6, 0 +6, 0, 7667, 6, 1, 42936, 7, 0, 5900, 7, 1, 9033, // 6, 1 +6, 1, 6961, 6, 2, 45401, 7, 1, 5261, 7, 2, 7913, // 6, 2 +6, 2, 6154, 6, 3, 48049, 7, 2, 4572, 7, 3, 6761, // 6, 3 +6, 3, 5248, 6, 4, 50873, 7, 3, 3834, 7, 4, 5581, // 6, 4 +6, 4, 4262, 6, 5, 53816, 7, 4, 3064, 7, 5, 4394, // 6, 5 +6, 5, 3271, 6, 6, 56673, 7, 5, 2316, 7, 6, 3276, // 6, 6 +6, 6, 2532, 6, 7, 58773, 7, 6, 1767, 7, 7, 2464, // 6, 7 +5, 7, 1766, 5, 8, 2462, 6, 7, 2533, 6, 8, 58775, // 6, 8 +5, 8, 2316, 5, 9, 3271, 6, 8, 3275, 6, 9, 56674, // 6, 9 +5, 9, 3065, 5, 10, 4388, 6, 9, 4269, 6, 10, 53814, // 6,10 +5, 10, 3837, 5, 11, 5573, 6, 10, 5261, 6, 11, 50865, // 6,11 +5, 11, 4576, 5, 12, 6750, 6, 11, 6173, 6, 12, 48037, // 6,12 +5, 12, 5268, 5, 13, 7899, 6, 12, 6986, 6, 13, 45383, // 6,13 +5, 13, 5910, 5, 14, 9014, 6, 13, 7699, 6, 14, 42913, // 6,14 +5, 14, 6502, 5, 15, 10100, 6, 14, 8316, 6, 15, 40618, // 6,15 +7, -1, 8018, 7, 0, 41106, 8, -1, 6346, 8, 0, 10066, // 7, 0 +7, 0, 7390, 7, 1, 43461, 8, 0, 5745, 8, 1, 8940, // 7, 1 +7, 1, 6658, 7, 2, 46017, 8, 1, 5087, 8, 2, 7774, // 7, 2 +7, 2, 5811, 7, 3, 48801, 8, 2, 4366, 8, 3, 6558, // 7, 3 +7, 3, 4835, 7, 4, 51842, 8, 3, 3575, 8, 4, 5284, // 7, 4 +7, 4, 3720, 7, 5, 55168, 8, 4, 2708, 8, 5, 3940, // 7, 5 +7, 5, 2462, 7, 6, 58775, 8, 5, 1766, 8, 6, 2533, // 7, 6 +7, 6, 1170, 7, 7, 62369, 8, 6, 827, 8, 7, 1170, // 7, 7 +6, 7, 827, 6, 8, 1170, 7, 7, 1170, 7, 8, 62369, // 7, 8 +6, 8, 1767, 6, 9, 2532, 7, 8, 2464, 7, 9, 58773, // 7, 9 +6, 9, 2710, 6, 10, 3938, 7, 9, 3726, 7, 10, 55162, // 7,10 +6, 10, 3579, 6, 11, 5280, 7, 10, 4846, 7, 11, 51831, // 7,11 +6, 11, 4372, 6, 12, 6552, 7, 11, 5827, 7, 12, 48785, // 7,12 +6, 12, 5095, 6, 13, 7766, 7, 12, 6680, 7, 13, 45995, // 7,13 +6, 13, 5756, 6, 14, 8929, 7, 13, 7418, 7, 14, 43433, // 7,14 +6, 14, 6360, 6, 15, 10052, 7, 14, 8052, 7, 15, 41072, // 7,15 +8, 0, 41072, 8, 1, 8052, 9, 0, 10052, 9, 1, 6360, // 8, 0 +8, 1, 43433, 8, 2, 7418, 9, 1, 8929, 9, 2, 5756, // 8, 1 +8, 2, 45995, 8, 3, 6680, 9, 2, 7766, 9, 3, 5095, // 8, 2 +8, 3, 48785, 8, 4, 5827, 9, 3, 6552, 9, 4, 4372, // 8, 3 +8, 4, 51832, 8, 5, 4846, 9, 4, 5280, 9, 5, 3578, // 8, 4 +8, 5, 55162, 8, 6, 3726, 9, 5, 3938, 9, 6, 2710, // 8, 5 +8, 6, 58773, 8, 7, 2464, 9, 6, 2532, 9, 7, 1767, // 8, 6 +8, 7, 62369, 8, 8, 1170, 9, 7, 1170, 9, 8, 827, // 8, 7 +7, 8, 1170, 7, 9, 827, 8, 8, 62369, 8, 9, 1170, // 8, 8 +7, 9, 2533, 7, 10, 1766, 8, 9, 58775, 8, 10, 2462, // 8, 9 +7, 10, 3940, 7, 11, 2708, 8, 10, 55168, 8, 11, 3720, // 8,10 +7, 11, 5283, 7, 12, 3575, 8, 11, 51842, 8, 12, 4836, // 8,11 +7, 12, 6558, 7, 13, 4366, 8, 12, 48801, 8, 13, 5811, // 8,12 +7, 13, 7773, 7, 14, 5087, 8, 13, 46017, 8, 14, 6659, // 8,13 +7, 14, 8939, 7, 15, 5745, 8, 14, 43461, 8, 15, 7391, // 8,14 +7, 15, 10066, 7, 16, 6346, 8, 15, 41106, 8, 16, 8018, // 8,15 +9, 0, 40618, 9, 1, 8316, 10, 0, 10100, 10, 1, 6502, // 9, 0 +9, 1, 42913, 9, 2, 7699, 10, 1, 9014, 10, 2, 5910, // 9, 1 +9, 2, 45383, 9, 3, 6986, 10, 2, 7899, 10, 3, 5268, // 9, 2 +9, 3, 48037, 9, 4, 6173, 10, 3, 6750, 10, 4, 4576, // 9, 3 +9, 4, 50865, 9, 5, 5261, 10, 4, 5573, 10, 5, 3837, // 9, 4 +9, 5, 53813, 9, 6, 4269, 10, 5, 4388, 10, 6, 3066, // 9, 5 +9, 6, 56673, 9, 7, 3275, 10, 6, 3271, 10, 7, 2317, // 9, 6 +9, 7, 58775, 9, 8, 2533, 10, 7, 2462, 10, 8, 1766, // 9, 7 +8, 8, 2464, 8, 9, 1767, 9, 8, 58773, 9, 9, 2532, // 9, 8 +8, 9, 3275, 8, 10, 2316, 9, 9, 56673, 9, 10, 3272, // 9, 9 +8, 10, 4394, 8, 11, 3064, 9, 10, 53816, 9, 11, 4262, // 9,10 +8, 11, 5581, 8, 12, 3834, 9, 11, 50873, 9, 12, 5248, // 9,11 +8, 12, 6761, 8, 13, 4572, 9, 12, 48049, 9, 13, 6154, // 9,12 +8, 13, 7913, 8, 14, 5261, 9, 13, 45401, 9, 14, 6961, // 9,13 +8, 14, 9032, 8, 15, 5900, 9, 14, 42936, 9, 15, 7668, // 9,14 +8, 15, 10123, 8, 16, 6489, 9, 15, 40646, 9, 16, 8278, // 9,15 +10, 0, 39918, 10, 1, 8676, 11, 0, 10232, 11, 1, 6710, // 10, 0 +10, 1, 42087, 10, 2, 8098, 11, 1, 9206, 11, 2, 6145, // 10, 1 +10, 2, 44386, 10, 3, 7440, 11, 2, 8167, 11, 3, 5543, // 10, 2 +10, 3, 46798, 10, 4, 6707, 11, 3, 7121, 11, 4, 4910, // 10, 3 +10, 4, 49275, 10, 5, 5917, 11, 4, 6086, 11, 5, 4258, // 10, 4 +10, 5, 51700, 10, 6, 5113, 11, 5, 5103, 11, 6, 3620, // 10, 5 +10, 6, 53816, 10, 7, 4394, 11, 6, 4262, 11, 7, 3064, // 10, 6 +10, 7, 55168, 10, 8, 3940, 11, 7, 3720, 11, 8, 2708, // 10, 7 +9, 8, 3726, 9, 9, 2710, 10, 8, 55162, 10, 9, 3938, // 10, 8 +9, 9, 4269, 9, 10, 3065, 10, 9, 53813, 10, 10, 4389, // 10, 9 +9, 10, 5113, 9, 11, 3621, 10, 10, 51700, 10, 11, 5102, // 10,10 +9, 11, 6099, 9, 12, 4257, 10, 11, 49279, 10, 12, 5901, // 10,11 +9, 12, 7138, 9, 13, 4906, 10, 12, 46806, 10, 13, 6686, // 10,12 +9, 13, 8189, 9, 14, 5537, 10, 13, 44399, 10, 14, 7411, // 10,13 +9, 14, 9233, 9, 15, 6137, 10, 14, 42105, 10, 15, 8061, // 10,14 +9, 15, 10265, 9, 16, 6699, 10, 15, 39940, 10, 16, 8632, // 10,15 +11, 0, 39009, 11, 1, 9122, 12, 0, 10430, 12, 1, 6975, // 11, 0 +11, 1, 41013, 11, 2, 8599, 12, 1, 9478, 12, 2, 6446, // 11, 1 +11, 2, 43096, 11, 3, 8015, 12, 2, 8530, 12, 3, 5895, // 11, 2 +11, 3, 45224, 11, 4, 7382, 12, 3, 7598, 12, 4, 5332, // 11, 3 +11, 4, 47328, 11, 5, 6727, 12, 4, 6708, 12, 5, 4773, // 11, 4 +11, 5, 49279, 11, 6, 6099, 12, 5, 5901, 12, 6, 4257, // 11, 5 +11, 6, 50873, 11, 7, 5581, 12, 6, 5248, 12, 7, 3834, // 11, 6 +11, 7, 51842, 11, 8, 5283, 12, 7, 4835, 12, 8, 3576, // 11, 7 +10, 8, 4846, 10, 9, 3579, 11, 8, 51832, 11, 9, 5279, // 11, 8 +10, 9, 5261, 10, 10, 3837, 11, 9, 50865, 11, 10, 5573, // 11, 9 +10, 10, 5917, 10, 11, 4258, 11, 10, 49275, 11, 11, 6086, // 11,10 +10, 11, 6727, 10, 12, 4774, 11, 11, 47328, 11, 12, 6707, // 11,11 +10, 12, 7622, 10, 13, 5330, 11, 12, 45229, 11, 13, 7355, // 11,12 +10, 13, 8559, 10, 14, 5891, 11, 13, 43105, 11, 14, 7981, // 11,13 +10, 14, 9513, 10, 15, 6440, 11, 14, 41026, 11, 15, 8557, // 11,14 +10, 15, 10473, 10, 16, 6965, 11, 15, 39026, 11, 16, 9072, // 11,15 +12, 0, 37939, 12, 1, 9642, 13, 0, 10670, 13, 1, 7285, // 12, 0 +12, 1, 39759, 12, 2, 9184, 13, 1, 9796, 13, 2, 6797, // 12, 1 +12, 2, 41614, 12, 3, 8681, 13, 2, 8941, 13, 3, 6300, // 12, 2 +12, 3, 43461, 12, 4, 8151, 13, 3, 8120, 13, 4, 5804, // 12, 3 +12, 4, 45229, 12, 5, 7622, 13, 4, 7356, 13, 5, 5329, // 12, 4 +12, 5, 46806, 12, 6, 7138, 13, 5, 6685, 13, 6, 4907, // 12, 5 +12, 6, 48049, 12, 7, 6761, 13, 6, 6154, 13, 7, 4572, // 12, 6 +12, 7, 48801, 12, 8, 6558, 13, 7, 5811, 13, 8, 4366, // 12, 7 +11, 8, 5827, 11, 9, 4372, 12, 8, 48785, 12, 9, 6552, // 12, 8 +11, 9, 6173, 11, 10, 4576, 12, 9, 48037, 12, 10, 6750, // 12, 9 +11, 10, 6707, 11, 11, 4909, 12, 10, 46798, 12, 11, 7122, // 12,10 +11, 11, 7382, 11, 12, 5331, 12, 11, 45224, 12, 12, 7599, // 12,11 +11, 12, 8151, 11, 13, 5804, 12, 12, 43461, 12, 13, 8120, // 12,12 +11, 13, 8979, 11, 14, 6297, 12, 13, 41618, 12, 14, 8642, // 12,13 +11, 14, 9841, 11, 15, 6792, 12, 14, 39767, 12, 15, 9136, // 12,14 +11, 15, 10723, 11, 16, 7276, 12, 15, 37951, 12, 16, 9586, // 12,15 +13, 0, 36756, 13, 1, 10224, 14, 0, 10930, 14, 1, 7626, // 13, 0 +13, 1, 38390, 13, 2, 9834, 14, 1, 10133, 14, 2, 7179, // 13, 1 +13, 2, 40025, 13, 3, 9413, 14, 2, 9366, 14, 3, 6732, // 13, 2 +13, 3, 41618, 13, 4, 8979, 14, 3, 8641, 14, 4, 6298, // 13, 3 +13, 4, 43105, 13, 5, 8559, 14, 4, 7981, 14, 5, 5891, // 13, 4 +13, 5, 44399, 13, 6, 8189, 14, 5, 7411, 14, 6, 5537, // 13, 5 +13, 6, 45401, 13, 7, 7913, 14, 6, 6961, 14, 7, 5261, // 13, 6 +13, 7, 46017, 13, 8, 7773, 14, 7, 6658, 14, 8, 5088, // 13, 7 +12, 8, 6680, 12, 9, 5095, 13, 8, 45995, 13, 9, 7766, // 13, 8 +12, 9, 6986, 12, 10, 5268, 13, 9, 45383, 13, 10, 7899, // 13, 9 +12, 10, 7440, 12, 11, 5543, 13, 10, 44386, 13, 11, 8167, // 13,10 +12, 11, 8015, 12, 12, 5895, 13, 11, 43096, 13, 12, 8530, // 13,11 +12, 12, 8681, 12, 13, 6299, 13, 12, 41614, 13, 13, 8942, // 13,12 +12, 13, 9413, 12, 14, 6732, 13, 13, 40025, 13, 14, 9366, // 13,13 +12, 14, 10188, 12, 15, 7177, 13, 14, 38394, 13, 15, 9777, // 13,14 +12, 15, 10994, 12, 16, 7620, 13, 15, 36764, 13, 16, 10158, // 13,15 +14, 0, 35502, 14, 1, 10855, 15, 0, 11192, 15, 1, 7987, // 14, 0 +14, 1, 36959, 14, 2, 10532, 15, 1, 10467, 15, 2, 7578, // 14, 1 +14, 2, 38394, 14, 3, 10188, 15, 2, 9777, 15, 3, 7177, // 14, 2 +14, 3, 39767, 14, 4, 9841, 15, 3, 9135, 15, 4, 6793, // 14, 3 +14, 4, 41026, 14, 5, 9513, 15, 4, 8557, 15, 5, 6440, // 14, 4 +14, 5, 42105, 14, 6, 9233, 15, 5, 8061, 15, 6, 6137, // 14, 5 +14, 6, 42936, 14, 7, 9032, 15, 6, 7667, 15, 7, 5901, // 14, 6 +14, 7, 43461, 14, 8, 8939, 15, 7, 7390, 15, 8, 5746, // 14, 7 +13, 8, 7418, 13, 9, 5756, 14, 8, 43433, 14, 9, 8929, // 14, 8 +13, 9, 7699, 13, 10, 5910, 14, 9, 42913, 14, 10, 9014, // 14, 9 +13, 10, 8098, 13, 11, 6145, 14, 10, 42087, 14, 11, 9206, // 14,10 +13, 11, 8599, 13, 12, 6447, 14, 11, 41013, 14, 12, 9477, // 14,11 +13, 12, 9184, 13, 13, 6797, 14, 12, 39759, 14, 13, 9796, // 14,12 +13, 13, 9834, 13, 14, 7179, 14, 13, 38390, 14, 14, 10133, // 14,13 +13, 14, 10532, 13, 15, 7579, 14, 14, 36959, 14, 15, 10466, // 14,14 +13, 15, 11267, 13, 16, 7983, 14, 15, 35506, 14, 16, 10780, // 14,15 +15, 0, 34212, 15, 1, 11526, 16, 0, 11440, 16, 1, 8358, // 15, 0 +15, 1, 35506, 15, 2, 11267, 16, 1, 10780, 16, 2, 7983, // 15, 1 +15, 2, 36764, 15, 3, 10994, 16, 2, 10158, 16, 3, 7620, // 15, 2 +15, 3, 37951, 15, 4, 10723, 16, 3, 9585, 16, 4, 7277, // 15, 3 +15, 4, 39026, 15, 5, 10473, 16, 4, 9072, 16, 5, 6965, // 15, 4 +15, 5, 39940, 15, 6, 10265, 16, 5, 8632, 16, 6, 6699, // 15, 5 +15, 6, 40646, 15, 7, 10123, 16, 6, 8278, 16, 7, 6489, // 15, 6 +15, 7, 41106, 15, 8, 10066, 16, 7, 8018, 16, 8, 6346, // 15, 7 +14, 8, 8052, 14, 9, 6360, 15, 8, 41072, 15, 9, 10052, // 15, 8 +14, 9, 8316, 14, 10, 6502, 15, 9, 40618, 15, 10, 10100, // 15, 9 +14, 10, 8676, 14, 11, 6710, 15, 10, 39918, 15, 11, 10232, // 15,10 +14, 11, 9122, 14, 12, 6975, 15, 11, 39009, 15, 12, 10430, // 15,11 +14, 12, 9642, 14, 13, 7285, 15, 12, 37939, 15, 13, 10670, // 15,12 +14, 13, 10224, 14, 14, 7626, 15, 13, 36756, 15, 14, 10930, // 15,13 +14, 14, 10855, 14, 15, 7987, 15, 14, 35502, 15, 15, 11192, // 15,14 +14, 15, 11526, 14, 16, 8358, 15, 15, 34212, 15, 16, 11440, // 15,15 +// angle of 2.0 degrees +0, -1, 13368, 0, 0, 28495, 1, -1, 10104, 1, 0, 13569, // 0, 0 +0, 0, 13291, 0, 1, 29828, 1, 0, 9671, 1, 1, 12746, // 0, 1 +0, 1, 13176, 0, 2, 31138, 1, 1, 9245, 1, 2, 11977, // 0, 2 +0, 2, 13038, 0, 3, 32391, 1, 2, 8838, 1, 3, 11269, // 0, 3 +0, 3, 12899, 0, 4, 33539, 1, 3, 8463, 1, 4, 10635, // 0, 4 +0, 4, 12783, 0, 5, 34532, 1, 4, 8135, 1, 5, 10086, // 0, 5 +0, 5, 12717, 0, 6, 35315, 1, 5, 7868, 1, 6, 9636, // 0, 6 +0, 6, 12728, 0, 7, 35844, 1, 6, 7674, 1, 7, 9290, // 0, 7 +-1, 7, 7643, -1, 8, 9224, 0, 7, 12764, 0, 8, 35905, // 0, 8 +-1, 8, 7839, -1, 9, 9558, 0, 8, 12777, 0, 9, 35362, // 0, 9 +-1, 9, 8107, -1, 10, 9995, 0, 9, 12867, 0, 10, 34567, // 0,10 +-1, 10, 8438, -1, 11, 10528, 0, 10, 13007, 0, 11, 33563, // 0,11 +-1, 11, 8816, -1, 12, 11143, 0, 11, 13171, 0, 12, 32406, // 0,12 +-1, 12, 9229, -1, 13, 11829, 0, 12, 13332, 0, 13, 31146, // 0,13 +-1, 13, 9662, -1, 14, 12574, 0, 13, 13470, 0, 14, 29830, // 0,14 +-1, 14, 10104, -1, 15, 13368, 0, 14, 13569, 0, 15, 28495, // 0,15 +1, -1, 12574, 1, 0, 29831, 2, -1, 9662, 2, 0, 13469, // 1, 0 +1, 0, 12412, 1, 1, 31358, 2, 0, 9202, 2, 1, 12564, // 1, 1 +1, 1, 12203, 1, 2, 32881, 2, 1, 8742, 2, 2, 11710, // 1, 2 +1, 2, 11964, 1, 3, 34358, 2, 2, 8296, 2, 3, 10918, // 1, 3 +1, 3, 11721, 1, 4, 35730, 2, 3, 7881, 2, 4, 10204, // 1, 4 +1, 4, 11507, 1, 5, 36926, 2, 4, 7517, 2, 5, 9586, // 1, 5 +1, 5, 11360, 1, 6, 37866, 2, 5, 7224, 2, 6, 9086, // 1, 6 +1, 6, 11317, 1, 7, 38481, 2, 6, 7020, 2, 7, 8718, // 1, 7 +0, 7, 6997, 0, 8, 8662, 1, 7, 11344, 1, 8, 38533, // 1, 8 +0, 8, 7202, 0, 9, 9020, 1, 8, 11407, 1, 9, 37907, // 1, 9 +0, 9, 7497, 0, 10, 9509, 1, 9, 11575, 1, 10, 36955, // 1,10 +0, 10, 7865, 0, 11, 10111, 1, 10, 11810, 1, 11, 35750, // 1,11 +0, 11, 8284, 0, 12, 10808, 1, 11, 12074, 1, 12, 34370, // 1,12 +0, 12, 8735, 0, 13, 11580, 1, 12, 12334, 1, 13, 32887, // 1,13 +0, 13, 9202, 0, 14, 12412, 1, 13, 12564, 1, 14, 31358, // 1,14 +0, 14, 9671, 0, 15, 13291, 1, 14, 12746, 1, 15, 29828, // 1,15 +2, -1, 11829, 2, 0, 31146, 3, -1, 9229, 3, 0, 13332, // 2, 0 +2, 0, 11580, 2, 1, 32886, 3, 0, 8735, 3, 1, 12335, // 2, 1 +2, 1, 11272, 2, 2, 34650, 3, 1, 8232, 3, 2, 11382, // 2, 2 +2, 2, 10922, 2, 3, 36392, 3, 2, 7734, 3, 3, 10488, // 2, 3 +2, 3, 10559, 2, 4, 38042, 3, 3, 7261, 3, 4, 9674, // 2, 4 +2, 4, 10226, 2, 5, 39503, 3, 4, 6842, 3, 5, 8965, // 2, 5 +2, 5, 9977, 2, 6, 40656, 3, 5, 6506, 3, 6, 8397, // 2, 6 +2, 6, 9867, 2, 7, 41389, 3, 6, 6284, 3, 7, 7996, // 2, 7 +1, 7, 6266, 1, 8, 7951, 2, 7, 9886, 2, 8, 41433, // 2, 8 +1, 8, 6491, 1, 9, 8344, 2, 8, 10013, 2, 9, 40688, // 2, 9 +1, 9, 6829, 1, 10, 8902, 2, 9, 10279, 2, 10, 39526, // 2,10 +1, 10, 7252, 1, 11, 9597, 2, 10, 10630, 2, 11, 38057, // 2,11 +1, 11, 7728, 1, 12, 10397, 2, 11, 11012, 2, 12, 36399, // 2,12 +1, 12, 8232, 1, 13, 11272, 2, 12, 11382, 2, 13, 34650, // 2,13 +1, 13, 8742, 1, 14, 12203, 2, 13, 11709, 2, 14, 32882, // 2,14 +1, 14, 9245, 1, 15, 13176, 2, 14, 11977, 2, 15, 31138, // 2,15 +3, -1, 11143, 3, 0, 32406, 4, -1, 8816, 4, 0, 13171, // 3, 0 +3, 0, 10808, 3, 1, 34369, 4, 0, 8284, 4, 1, 12075, // 3, 1 +3, 1, 10397, 3, 2, 36399, 4, 1, 7728, 4, 2, 11012, // 3, 2 +3, 2, 9924, 3, 3, 38450, 4, 2, 7164, 4, 3, 9998, // 3, 3 +3, 3, 9421, 3, 4, 40444, 4, 3, 6615, 4, 4, 9056, // 3, 4 +3, 4, 8940, 3, 5, 42256, 4, 4, 6116, 4, 5, 8224, // 3, 5 +3, 5, 8558, 3, 6, 43710, 4, 5, 5712, 4, 6, 7556, // 3, 6 +3, 6, 8359, 3, 7, 44616, 4, 6, 5454, 4, 7, 7107, // 3, 7 +2, 7, 5443, 2, 8, 7072, 3, 7, 8373, 3, 8, 44648, // 3, 8 +2, 8, 5703, 2, 9, 7516, 3, 8, 8584, 3, 9, 43733, // 3, 9 +2, 9, 6108, 2, 10, 8175, 3, 9, 8982, 3, 10, 42271, // 3,10 +2, 10, 6611, 2, 11, 8995, 3, 10, 9478, 3, 11, 40452, // 3,11 +2, 11, 7164, 2, 12, 9924, 3, 11, 9998, 3, 12, 38450, // 3,12 +2, 12, 7734, 2, 13, 10922, 3, 12, 10488, 3, 13, 36392, // 3,13 +2, 13, 8296, 2, 14, 11964, 3, 13, 10918, 3, 14, 34358, // 3,14 +2, 14, 8838, 2, 15, 13038, 3, 14, 11269, 3, 15, 32391, // 3,15 +4, -1, 10528, 4, 0, 33564, 5, -1, 8438, 5, 0, 13006, // 4, 0 +4, 0, 10111, 4, 1, 35750, 5, 0, 7865, 5, 1, 11810, // 4, 1 +4, 1, 9597, 4, 2, 38057, 5, 1, 7252, 5, 2, 10630, // 4, 2 +4, 2, 8995, 4, 3, 40452, 5, 2, 6611, 5, 3, 9478, // 4, 3 +4, 3, 8332, 4, 4, 42861, 5, 3, 5965, 5, 4, 8378, // 4, 4 +4, 4, 7667, 4, 5, 45139, 5, 4, 5353, 5, 5, 7377, // 4, 5 +4, 5, 7100, 4, 6, 47035, 5, 5, 4843, 5, 6, 6558, // 4, 6 +4, 6, 6774, 4, 7, 48218, 5, 6, 4521, 5, 7, 6023, // 4, 7 +3, 7, 4513, 3, 8, 6000, 4, 7, 6783, 4, 8, 48240, // 4, 8 +3, 8, 4838, 3, 9, 6530, 4, 8, 7119, 4, 9, 47049, // 4, 9 +3, 9, 5350, 3, 10, 7342, 4, 9, 7698, 4, 10, 45146, // 4,10 +3, 10, 5965, 3, 11, 8332, 4, 10, 8378, 4, 11, 42861, // 4,11 +3, 11, 6615, 3, 12, 9421, 4, 11, 9056, 4, 12, 40444, // 4,12 +3, 12, 7261, 3, 13, 10559, 4, 12, 9674, 4, 13, 38042, // 4,13 +3, 13, 7881, 3, 14, 11721, 4, 13, 10204, 4, 14, 35730, // 4,14 +3, 14, 8463, 3, 15, 12899, 4, 14, 10635, 4, 15, 33539, // 4,15 +5, -1, 9995, 5, 0, 34567, 6, -1, 8107, 6, 0, 12867, // 5, 0 +5, 0, 9509, 5, 1, 36955, 6, 0, 7497, 6, 1, 11575, // 5, 1 +5, 1, 8902, 5, 2, 39526, 6, 1, 6829, 6, 2, 10279, // 5, 2 +5, 2, 8175, 5, 3, 42271, 6, 2, 6108, 6, 3, 8982, // 5, 3 +5, 3, 7342, 5, 4, 45146, 6, 3, 5350, 6, 4, 7698, // 5, 4 +5, 4, 6451, 5, 5, 48019, 6, 4, 4591, 6, 5, 6475, // 5, 5 +5, 5, 5624, 5, 6, 50581, 6, 5, 3913, 6, 6, 5418, // 5, 6 +5, 6, 5092, 5, 7, 52253, 6, 6, 3470, 6, 7, 4721, // 5, 7 +4, 7, 3466, 4, 8, 4708, 5, 7, 5097, 5, 8, 52265, // 5, 8 +4, 8, 3911, 4, 9, 5400, 5, 8, 5637, 5, 9, 50588, // 5, 9 +4, 9, 4591, 4, 10, 6451, 5, 9, 6475, 5, 10, 48019, // 5,10 +4, 10, 5353, 4, 11, 7667, 5, 10, 7377, 5, 11, 45139, // 5,11 +4, 11, 6116, 4, 12, 8940, 5, 11, 8224, 5, 12, 42256, // 5,12 +4, 12, 6842, 4, 13, 10226, 5, 12, 8966, 5, 13, 39502, // 5,13 +4, 13, 7517, 4, 14, 11507, 5, 13, 9587, 5, 14, 36925, // 5,14 +4, 14, 8135, 4, 15, 12783, 5, 14, 10086, 5, 15, 34532, // 5,15 +6, -1, 9558, 6, 0, 35362, 7, -1, 7839, 7, 0, 12777, // 6, 0 +6, 0, 9020, 6, 1, 37906, 7, 0, 7202, 7, 1, 11408, // 6, 1 +6, 1, 8344, 6, 2, 40688, 7, 1, 6491, 7, 2, 10013, // 6, 2 +6, 2, 7516, 6, 3, 43733, 7, 2, 5703, 7, 3, 8584, // 6, 3 +6, 3, 6530, 6, 4, 47049, 7, 3, 4838, 7, 4, 7119, // 6, 4 +6, 4, 5400, 6, 5, 50587, 7, 4, 3911, 7, 5, 5638, // 6, 5 +6, 5, 4217, 6, 6, 54105, 7, 5, 2989, 7, 6, 4225, // 6, 6 +6, 6, 3303, 6, 7, 56751, 7, 6, 2295, 7, 7, 3187, // 6, 7 +5, 7, 2294, 5, 8, 3180, 6, 7, 3306, 6, 8, 56756, // 6, 8 +5, 8, 2989, 5, 9, 4217, 6, 8, 4225, 6, 9, 54105, // 6, 9 +5, 9, 3913, 5, 10, 5624, 6, 9, 5418, 6, 10, 50581, // 6,10 +5, 10, 4843, 5, 11, 7100, 6, 10, 6558, 6, 11, 47035, // 6,11 +5, 11, 5712, 5, 12, 8558, 6, 11, 7556, 6, 12, 43710, // 6,12 +5, 12, 6506, 5, 13, 9977, 6, 12, 8397, 6, 13, 40656, // 6,13 +5, 13, 7224, 5, 14, 11360, 6, 13, 9086, 6, 14, 37866, // 6,14 +5, 14, 7868, 5, 15, 12717, 6, 14, 9635, 6, 15, 35316, // 6,15 +7, -1, 9224, 7, 0, 35905, 8, -1, 7643, 8, 0, 12764, // 7, 0 +7, 0, 8662, 7, 1, 38534, 8, 0, 6997, 8, 1, 11343, // 7, 1 +7, 1, 7951, 7, 2, 41432, 8, 1, 6266, 8, 2, 9887, // 7, 2 +7, 2, 7072, 7, 3, 44649, 8, 2, 5443, 8, 3, 8372, // 7, 3 +7, 3, 6000, 7, 4, 48240, 8, 3, 4513, 8, 4, 6783, // 7, 4 +7, 4, 4708, 7, 5, 52266, 8, 4, 3466, 8, 5, 5096, // 7, 5 +7, 5, 3180, 7, 6, 56756, 8, 5, 2294, 8, 6, 3306, // 7, 6 +7, 6, 1541, 7, 7, 61364, 8, 6, 1090, 8, 7, 1541, // 7, 7 +6, 7, 1090, 6, 8, 1541, 7, 7, 1542, 7, 8, 61363, // 7, 8 +6, 8, 2295, 6, 9, 3303, 7, 8, 3186, 7, 9, 56752, // 7, 9 +6, 9, 3470, 6, 10, 5092, 7, 9, 4721, 7, 10, 52253, // 7,10 +6, 10, 4521, 6, 11, 6774, 7, 10, 6023, 7, 11, 48218, // 7,11 +6, 11, 5454, 6, 12, 8359, 7, 11, 7106, 7, 12, 44617, // 7,12 +6, 12, 6284, 6, 13, 9867, 7, 12, 7996, 7, 13, 41389, // 7,13 +6, 13, 7020, 6, 14, 11317, 7, 13, 8718, 7, 14, 38481, // 7,14 +6, 14, 7674, 6, 15, 12728, 7, 14, 9290, 7, 15, 35844, // 7,15 +8, 0, 35844, 8, 1, 9290, 9, 0, 12728, 9, 1, 7674, // 8, 0 +8, 1, 38481, 8, 2, 8718, 9, 1, 11317, 9, 2, 7020, // 8, 1 +8, 2, 41389, 8, 3, 7996, 9, 2, 9867, 9, 3, 6284, // 8, 2 +8, 3, 44616, 8, 4, 7106, 9, 3, 8359, 9, 4, 5455, // 8, 3 +8, 4, 48218, 8, 5, 6023, 9, 4, 6774, 9, 5, 4521, // 8, 4 +8, 5, 52253, 8, 6, 4721, 9, 5, 5092, 9, 6, 3470, // 8, 5 +8, 6, 56751, 8, 7, 3186, 9, 6, 3303, 9, 7, 2296, // 8, 6 +8, 7, 61364, 8, 8, 1542, 9, 7, 1541, 9, 8, 1089, // 8, 7 +7, 8, 1542, 7, 9, 1090, 8, 8, 61364, 8, 9, 1540, // 8, 8 +7, 9, 3306, 7, 10, 2294, 8, 9, 56756, 8, 10, 3180, // 8, 9 +7, 10, 5097, 7, 11, 3466, 8, 10, 52266, 8, 11, 4707, // 8,10 +7, 11, 6783, 7, 12, 4513, 8, 11, 48240, 8, 12, 6000, // 8,11 +7, 12, 8373, 7, 13, 5443, 8, 12, 44649, 8, 13, 7071, // 8,12 +7, 13, 9886, 7, 14, 6266, 8, 13, 41432, 8, 14, 7952, // 8,13 +7, 14, 11344, 7, 15, 6997, 8, 14, 38534, 8, 15, 8661, // 8,14 +7, 15, 12764, 7, 16, 7643, 8, 15, 35905, 8, 16, 9224, // 8,15 +9, 0, 35315, 9, 1, 9635, 10, 0, 12717, 10, 1, 7869, // 9, 0 +9, 1, 37866, 9, 2, 9086, 10, 1, 11360, 10, 2, 7224, // 9, 1 +9, 2, 40656, 9, 3, 8397, 10, 2, 9977, 10, 3, 6506, // 9, 2 +9, 3, 43710, 9, 4, 7556, 10, 3, 8558, 10, 4, 5712, // 9, 3 +9, 4, 47035, 9, 5, 6558, 10, 4, 7100, 10, 5, 4843, // 9, 4 +9, 5, 50581, 9, 6, 5418, 10, 5, 5624, 10, 6, 3913, // 9, 5 +9, 6, 54105, 9, 7, 4225, 10, 6, 4217, 10, 7, 2989, // 9, 6 +9, 7, 56756, 9, 8, 3306, 10, 7, 3180, 10, 8, 2294, // 9, 7 +8, 8, 3186, 8, 9, 2295, 9, 8, 56751, 9, 9, 3304, // 9, 8 +8, 9, 4225, 8, 10, 2989, 9, 9, 54105, 9, 10, 4217, // 9, 9 +8, 10, 5637, 8, 11, 3911, 9, 10, 50587, 9, 11, 5401, // 9,10 +8, 11, 7119, 8, 12, 4838, 9, 11, 47049, 9, 12, 6530, // 9,11 +8, 12, 8584, 8, 13, 5703, 9, 12, 43733, 9, 13, 7516, // 9,12 +8, 13, 10013, 8, 14, 6491, 9, 13, 40688, 9, 14, 8344, // 9,13 +8, 14, 11407, 8, 15, 7202, 9, 14, 37906, 9, 15, 9021, // 9,14 +8, 15, 12777, 8, 16, 7839, 9, 15, 35362, 9, 16, 9558, // 9,15 +10, 0, 34532, 10, 1, 10086, 11, 0, 12783, 11, 1, 8135, // 10, 0 +10, 1, 36926, 10, 2, 9587, 11, 1, 11507, 11, 2, 7516, // 10, 1 +10, 2, 39503, 10, 3, 8966, 11, 2, 10226, 11, 3, 6841, // 10, 2 +10, 3, 42256, 10, 4, 8224, 11, 3, 8940, 11, 4, 6116, // 10, 3 +10, 4, 45139, 10, 5, 7377, 11, 4, 7667, 11, 5, 5353, // 10, 4 +10, 5, 48019, 10, 6, 6475, 11, 5, 6451, 11, 6, 4591, // 10, 5 +10, 6, 50587, 10, 7, 5637, 11, 6, 5400, 11, 7, 3912, // 10, 6 +10, 7, 52266, 10, 8, 5097, 11, 7, 4708, 11, 8, 3465, // 10, 7 +9, 8, 4721, 9, 9, 3470, 10, 8, 52253, 10, 9, 5092, // 10, 8 +9, 9, 5418, 9, 10, 3913, 10, 9, 50581, 10, 10, 5624, // 10, 9 +9, 10, 6475, 9, 11, 4591, 10, 10, 48019, 10, 11, 6451, // 10,10 +9, 11, 7698, 9, 12, 5350, 10, 11, 45146, 10, 12, 7342, // 10,11 +9, 12, 8982, 9, 13, 6108, 10, 12, 42271, 10, 13, 8175, // 10,12 +9, 13, 10279, 9, 14, 6829, 10, 13, 39526, 10, 14, 8902, // 10,13 +9, 14, 11575, 9, 15, 7497, 10, 14, 36955, 10, 15, 9509, // 10,14 +9, 15, 12867, 9, 16, 8107, 10, 15, 34567, 10, 16, 9995, // 10,15 +11, 0, 33539, 11, 1, 10635, 12, 0, 12899, 12, 1, 8463, // 11, 0 +11, 1, 35730, 11, 2, 10204, 12, 1, 11721, 12, 2, 7881, // 11, 1 +11, 2, 38042, 11, 3, 9674, 12, 2, 10559, 12, 3, 7261, // 11, 2 +11, 3, 40444, 11, 4, 9056, 12, 3, 9421, 12, 4, 6615, // 11, 3 +11, 4, 42861, 11, 5, 8378, 12, 4, 8332, 12, 5, 5965, // 11, 4 +11, 5, 45146, 11, 6, 7698, 12, 5, 7342, 12, 6, 5350, // 11, 5 +11, 6, 47049, 11, 7, 7119, 12, 6, 6530, 12, 7, 4838, // 11, 6 +11, 7, 48240, 11, 8, 6783, 12, 7, 6000, 12, 8, 4513, // 11, 7 +10, 8, 6023, 10, 9, 4521, 11, 8, 48218, 11, 9, 6774, // 11, 8 +10, 9, 6558, 10, 10, 4843, 11, 9, 47035, 11, 10, 7100, // 11, 9 +10, 10, 7377, 10, 11, 5353, 11, 10, 45139, 11, 11, 7667, // 11,10 +10, 11, 8378, 10, 12, 5965, 11, 11, 42861, 11, 12, 8332, // 11,11 +10, 12, 9478, 10, 13, 6611, 11, 12, 40452, 11, 13, 8995, // 11,12 +10, 13, 10630, 10, 14, 7252, 11, 13, 38057, 11, 14, 9597, // 11,13 +10, 14, 11810, 10, 15, 7865, 11, 14, 35750, 11, 15, 10111, // 11,14 +10, 15, 13007, 10, 16, 8438, 11, 15, 33564, 11, 16, 10527, // 11,15 +12, 0, 32391, 12, 1, 11269, 13, 0, 13038, 13, 1, 8838, // 12, 0 +12, 1, 34358, 12, 2, 10918, 13, 1, 11964, 13, 2, 8296, // 12, 1 +12, 2, 36392, 12, 3, 10488, 13, 2, 10922, 13, 3, 7734, // 12, 2 +12, 3, 38450, 12, 4, 9998, 13, 3, 9924, 13, 4, 7164, // 12, 3 +12, 4, 40452, 12, 5, 9478, 13, 4, 8995, 13, 5, 6611, // 12, 4 +12, 5, 42271, 12, 6, 8982, 13, 5, 8175, 13, 6, 6108, // 12, 5 +12, 6, 43733, 12, 7, 8584, 13, 6, 7516, 13, 7, 5703, // 12, 6 +12, 7, 44649, 12, 8, 8373, 13, 7, 7072, 13, 8, 5442, // 12, 7 +11, 8, 7106, 11, 9, 5454, 12, 8, 44616, 12, 9, 8360, // 12, 8 +11, 9, 7556, 11, 10, 5712, 12, 9, 43710, 12, 10, 8558, // 12, 9 +11, 10, 8224, 11, 11, 6116, 12, 10, 42256, 12, 11, 8940, // 12,10 +11, 11, 9056, 11, 12, 6615, 12, 11, 40444, 12, 12, 9421, // 12,11 +11, 12, 9998, 11, 13, 7164, 12, 12, 38450, 12, 13, 9924, // 12,12 +11, 13, 11012, 11, 14, 7728, 12, 13, 36399, 12, 14, 10397, // 12,13 +11, 14, 12074, 11, 15, 8284, 12, 14, 34369, 12, 15, 10809, // 12,14 +11, 15, 13171, 11, 16, 8816, 12, 15, 32406, 12, 16, 11143, // 12,15 +13, 0, 31138, 13, 1, 11977, 14, 0, 13176, 14, 1, 9245, // 13, 0 +13, 1, 32881, 13, 2, 11709, 14, 1, 12203, 14, 2, 8743, // 13, 1 +13, 2, 34650, 13, 3, 11382, 14, 2, 11272, 14, 3, 8232, // 13, 2 +13, 3, 36399, 13, 4, 11012, 14, 3, 10397, 14, 4, 7728, // 13, 3 +13, 4, 38057, 13, 5, 10630, 14, 4, 9597, 14, 5, 7252, // 13, 4 +13, 5, 39526, 13, 6, 10279, 14, 5, 8902, 14, 6, 6829, // 13, 5 +13, 6, 40688, 13, 7, 10013, 14, 6, 8344, 14, 7, 6491, // 13, 6 +13, 7, 41432, 13, 8, 9886, 14, 7, 7951, 14, 8, 6267, // 13, 7 +12, 8, 7996, 12, 9, 6284, 13, 8, 41389, 13, 9, 9867, // 13, 8 +12, 9, 8397, 12, 10, 6506, 13, 9, 40656, 13, 10, 9977, // 13, 9 +12, 10, 8966, 12, 11, 6842, 13, 10, 39503, 13, 11, 10225, // 13,10 +12, 11, 9674, 12, 12, 7261, 13, 11, 38042, 13, 12, 10559, // 13,11 +12, 12, 10488, 12, 13, 7734, 13, 12, 36392, 13, 13, 10922, // 13,12 +12, 13, 11382, 12, 14, 8232, 13, 13, 34650, 13, 14, 11272, // 13,13 +12, 14, 12334, 12, 15, 8735, 13, 14, 32886, 13, 15, 11581, // 13,14 +12, 15, 13332, 12, 16, 9229, 13, 15, 31146, 13, 16, 11829, // 13,15 +14, 0, 29828, 14, 1, 12746, 15, 0, 13291, 15, 1, 9671, // 14, 0 +14, 1, 31358, 14, 2, 12564, 15, 1, 12412, 15, 2, 9202, // 14, 1 +14, 2, 32886, 14, 3, 12334, 15, 2, 11580, 15, 3, 8736, // 14, 2 +14, 3, 34369, 14, 4, 12074, 15, 3, 10808, 15, 4, 8285, // 14, 3 +14, 4, 35750, 14, 5, 11810, 15, 4, 10111, 15, 5, 7865, // 14, 4 +14, 5, 36955, 14, 6, 11575, 15, 5, 9509, 15, 6, 7497, // 14, 5 +14, 6, 37906, 14, 7, 11407, 15, 6, 9020, 15, 7, 7203, // 14, 6 +14, 7, 38534, 14, 8, 11344, 15, 7, 8662, 15, 8, 6996, // 14, 7 +13, 8, 8718, 13, 9, 7020, 14, 8, 38481, 14, 9, 11317, // 14, 8 +13, 9, 9086, 13, 10, 7224, 14, 9, 37866, 14, 10, 11360, // 14, 9 +13, 10, 9587, 13, 11, 7517, 14, 10, 36926, 14, 11, 11506, // 14,10 +13, 11, 10204, 13, 12, 7881, 14, 11, 35730, 14, 12, 11721, // 14,11 +13, 12, 10918, 13, 13, 8296, 14, 12, 34358, 14, 13, 11964, // 14,12 +13, 13, 11709, 13, 14, 8742, 14, 13, 32881, 14, 14, 12204, // 14,13 +13, 14, 12564, 13, 15, 9202, 14, 14, 31358, 14, 15, 12412, // 14,14 +13, 15, 13470, 13, 16, 9662, 14, 15, 29831, 14, 16, 12573, // 14,15 +15, 0, 28495, 15, 1, 13569, 16, 0, 13368, 16, 1, 10104, // 15, 0 +15, 1, 29831, 15, 2, 13470, 16, 1, 12574, 16, 2, 9661, // 15, 1 +15, 2, 31146, 15, 3, 13332, 16, 2, 11829, 16, 3, 9229, // 15, 2 +15, 3, 32406, 15, 4, 13171, 16, 3, 11143, 16, 4, 8816, // 15, 3 +15, 4, 33564, 15, 5, 13007, 16, 4, 10528, 16, 5, 8437, // 15, 4 +15, 5, 34567, 15, 6, 12867, 16, 5, 9995, 16, 6, 8107, // 15, 5 +15, 6, 35362, 15, 7, 12777, 16, 6, 9558, 16, 7, 7839, // 15, 6 +15, 7, 35905, 15, 8, 12764, 16, 7, 9224, 16, 8, 7643, // 15, 7 +14, 8, 9290, 14, 9, 7674, 15, 8, 35844, 15, 9, 12728, // 15, 8 +14, 9, 9635, 14, 10, 7868, 15, 9, 35315, 15, 10, 12718, // 15, 9 +14, 10, 10086, 14, 11, 8135, 15, 10, 34532, 15, 11, 12783, // 15,10 +14, 11, 10635, 14, 12, 8463, 15, 11, 33539, 15, 12, 12899, // 15,11 +14, 12, 11269, 14, 13, 8838, 15, 12, 32391, 15, 13, 13038, // 15,12 +14, 13, 11977, 14, 14, 9245, 15, 13, 31138, 15, 14, 13176, // 15,13 +14, 14, 12746, 14, 15, 9671, 15, 14, 29828, 15, 15, 13291, // 15,14 +14, 15, 13569, 14, 16, 10104, 15, 15, 28495, 15, 16, 13368, // 15,15 +// angle of 2.5 degrees +0, -1, 14696, 0, 0, 24063, 1, -1, 11702, 1, 0, 15075, // 0, 0 +0, 0, 14872, 0, 1, 25368, 1, 0, 11187, 1, 1, 14109, // 0, 1 +0, 1, 14990, 0, 2, 26660, 1, 1, 10676, 1, 2, 13210, // 0, 2 +0, 2, 15060, 0, 3, 27903, 1, 2, 10185, 1, 3, 12388, // 0, 3 +0, 3, 15100, 0, 4, 29055, 1, 3, 9728, 1, 4, 11653, // 0, 4 +0, 4, 15135, 0, 5, 30064, 1, 4, 9323, 1, 5, 11014, // 0, 5 +0, 5, 15193, 0, 6, 30876, 1, 5, 8986, 1, 6, 10481, // 0, 6 +0, 6, 15301, 0, 7, 31444, 1, 6, 8727, 1, 7, 10064, // 0, 7 +-1, 7, 8669, -1, 8, 9959, 0, 7, 15376, 0, 8, 31532, // 0, 8 +-1, 8, 8927, -1, 9, 10351, 0, 8, 15319, 0, 9, 30939, // 0, 9 +-1, 9, 9265, -1, 10, 10855, 0, 9, 15311, 0, 10, 30105, // 0,10 +-1, 10, 9673, -1, 11, 11461, 0, 10, 15325, 0, 11, 29077, // 0,11 +-1, 11, 10135, -1, 12, 12159, 0, 11, 15330, 0, 12, 27912, // 0,12 +-1, 12, 10637, -1, 13, 12938, 0, 12, 15301, 0, 13, 26660, // 0,13 +-1, 13, 11164, -1, 14, 13787, 0, 13, 15220, 0, 14, 25365, // 0,14 +-1, 14, 11702, -1, 15, 14696, 0, 14, 15076, 0, 15, 24062, // 0,15 +1, -1, 13787, 1, 0, 25366, 2, -1, 11164, 2, 0, 15219, // 1, 0 +1, 0, 13853, 1, 1, 26893, 2, 0, 10644, 2, 1, 14146, // 1, 1 +1, 1, 13850, 1, 2, 28427, 2, 1, 10119, 2, 2, 13140, // 1, 2 +1, 2, 13789, 1, 3, 29928, 2, 2, 9603, 2, 3, 12216, // 1, 3 +1, 3, 13694, 1, 4, 31339, 2, 3, 9118, 2, 4, 11385, // 1, 4 +1, 4, 13600, 1, 5, 32586, 2, 4, 8685, 2, 5, 10665, // 1, 5 +1, 5, 13548, 1, 6, 33585, 2, 5, 8329, 2, 6, 10074, // 1, 6 +1, 6, 13582, 1, 7, 34261, 2, 6, 8068, 2, 7, 9625, // 1, 7 +0, 7, 8024, 0, 8, 9534, 1, 7, 13638, 1, 8, 34340, // 1, 8 +0, 8, 8286, 0, 9, 9961, 1, 8, 13647, 1, 9, 33642, // 1, 9 +0, 9, 8645, 0, 10, 10528, 1, 9, 13740, 1, 10, 32623, // 1,10 +0, 10, 9082, 0, 11, 11218, 1, 10, 13875, 1, 11, 31361, // 1,11 +0, 11, 9575, 0, 12, 12014, 1, 11, 14009, 1, 12, 29938, // 1,12 +0, 12, 10102, 0, 13, 12897, 1, 12, 14107, 1, 13, 28430, // 1,13 +0, 13, 10644, 0, 14, 13853, 1, 13, 14145, 1, 14, 26894, // 1,14 +0, 14, 11187, 0, 15, 14872, 1, 14, 14109, 1, 15, 25368, // 1,15 +2, -1, 12938, 2, 0, 26660, 3, -1, 10637, 3, 0, 15301, // 2, 0 +2, 0, 12897, 2, 1, 28430, 3, 0, 10102, 3, 1, 14107, // 2, 1 +2, 1, 12769, 2, 2, 30239, 3, 1, 9546, 3, 2, 12982, // 2, 2 +2, 2, 12569, 2, 3, 32045, 3, 2, 8988, 3, 3, 11934, // 2, 3 +2, 3, 12323, 2, 4, 33777, 3, 3, 8452, 3, 4, 10984, // 2, 4 +2, 4, 12079, 2, 5, 35332, 3, 4, 7969, 3, 5, 10156, // 2, 5 +2, 5, 11897, 2, 6, 36582, 3, 5, 7573, 3, 6, 9484, // 2, 6 +2, 6, 11842, 2, 7, 37402, 3, 6, 7298, 3, 7, 8994, // 2, 7 +1, 7, 7266, 1, 8, 8918, 2, 7, 11883, 2, 8, 37469, // 2, 8 +1, 8, 7543, 1, 9, 9390, 2, 8, 11972, 2, 9, 36631, // 2, 9 +1, 9, 7943, 1, 10, 10041, 2, 9, 12188, 2, 10, 35364, // 2,10 +1, 10, 8432, 1, 11, 10842, 2, 10, 12467, 2, 11, 33795, // 2,11 +1, 11, 8976, 1, 12, 11760, 2, 11, 12747, 2, 12, 32053, // 2,12 +1, 12, 9546, 1, 13, 12769, 2, 12, 12982, 2, 13, 30239, // 2,13 +1, 13, 10119, 1, 14, 13850, 2, 13, 13141, 2, 14, 28426, // 2,14 +1, 14, 10676, 1, 15, 14990, 2, 14, 13211, 2, 15, 26659, // 2,15 +3, -1, 12159, 3, 0, 27912, 4, -1, 10135, 4, 0, 15330, // 3, 0 +3, 0, 12014, 3, 1, 29938, 4, 0, 9575, 4, 1, 14009, // 3, 1 +3, 1, 11760, 3, 2, 32052, 4, 1, 8976, 4, 2, 12748, // 3, 2 +3, 2, 11411, 3, 3, 34213, 4, 2, 8358, 4, 3, 11554, // 3, 3 +3, 3, 10995, 3, 4, 36343, 4, 3, 7746, 4, 4, 10452, // 3, 4 +3, 4, 10569, 3, 5, 38307, 4, 4, 7180, 4, 5, 9480, // 3, 5 +3, 5, 10221, 3, 6, 39912, 4, 5, 6714, 4, 6, 8689, // 3, 6 +3, 6, 10051, 3, 7, 40940, 4, 6, 6403, 4, 7, 8142, // 3, 7 +2, 7, 6381, 2, 8, 8082, 3, 7, 10079, 3, 8, 40994, // 3, 8 +2, 8, 6695, 2, 9, 8617, 3, 8, 10275, 3, 9, 39949, // 3, 9 +2, 9, 7165, 2, 10, 9388, 3, 9, 10653, 3, 10, 38330, // 3,10 +2, 10, 7737, 2, 11, 10337, 3, 10, 11108, 3, 11, 36354, // 3,11 +2, 11, 8358, 2, 12, 11411, 3, 11, 11554, 3, 12, 34213, // 3,12 +2, 12, 8988, 2, 13, 12569, 3, 12, 11934, 3, 13, 32045, // 3,13 +2, 13, 9603, 2, 14, 13789, 3, 13, 12216, 3, 14, 29928, // 3,14 +2, 14, 10185, 2, 15, 15060, 3, 14, 12388, 3, 15, 27903, // 3,15 +4, -1, 11461, 4, 0, 29078, 5, -1, 9673, 5, 0, 15324, // 4, 0 +4, 0, 11218, 4, 1, 31361, 5, 0, 9082, 5, 1, 13875, // 4, 1 +4, 1, 10842, 4, 2, 33795, 5, 1, 8432, 5, 2, 12467, // 4, 2 +4, 2, 10337, 4, 3, 36354, 5, 2, 7737, 5, 3, 11108, // 4, 3 +4, 3, 9730, 4, 4, 38966, 5, 3, 7022, 5, 4, 9818, // 4, 4 +4, 4, 9081, 4, 5, 41475, 5, 4, 6334, 5, 5, 8646, // 4, 5 +4, 5, 8507, 4, 6, 43602, 5, 5, 5749, 5, 6, 7678, // 4, 6 +4, 6, 8177, 4, 7, 44962, 5, 6, 5368, 5, 7, 7029, // 4, 7 +3, 7, 5354, 3, 8, 6987, 4, 7, 8195, 4, 8, 45000, // 4, 8 +3, 8, 5739, 3, 9, 7626, 4, 8, 8545, 4, 9, 43626, // 4, 9 +3, 9, 6328, 3, 10, 8578, 4, 9, 9143, 4, 10, 41487, // 4,10 +3, 10, 7022, 3, 11, 9730, 4, 10, 9818, 4, 11, 38966, // 4,11 +3, 11, 7746, 3, 12, 10995, 4, 11, 10452, 4, 12, 36343, // 4,12 +3, 12, 8452, 3, 13, 12323, 4, 12, 10983, 4, 13, 33778, // 4,13 +3, 13, 9118, 3, 14, 13694, 4, 13, 11385, 4, 14, 31339, // 4,14 +3, 14, 9728, 3, 15, 15100, 4, 14, 11652, 4, 15, 29056, // 4,15 +5, -1, 10855, 5, 0, 30105, 6, -1, 9265, 6, 0, 15311, // 5, 0 +5, 0, 10528, 5, 1, 32624, 6, 0, 8645, 6, 1, 13739, // 5, 1 +5, 1, 10041, 5, 2, 35364, 6, 1, 7943, 6, 2, 12188, // 5, 2 +5, 2, 9388, 5, 3, 38330, 6, 2, 7165, 6, 3, 10653, // 5, 3 +5, 3, 8578, 5, 4, 41487, 6, 3, 6328, 6, 4, 9143, // 5, 4 +5, 4, 7659, 5, 5, 44700, 6, 4, 5472, 6, 5, 7705, // 5, 5 +5, 5, 6768, 5, 6, 47619, 6, 5, 4694, 6, 6, 6455, // 5, 6 +5, 6, 6183, 5, 7, 49566, 6, 6, 4172, 6, 7, 5615, // 5, 7 +4, 7, 4164, 4, 8, 5590, 5, 7, 6193, 5, 8, 49589, // 5, 8 +4, 8, 4690, 4, 9, 6422, 5, 8, 6794, 5, 9, 47630, // 5, 9 +4, 9, 5472, 4, 10, 7659, 5, 9, 7705, 5, 10, 44700, // 5,10 +4, 10, 6334, 4, 11, 9081, 5, 10, 8646, 5, 11, 41475, // 5,11 +4, 11, 7180, 4, 12, 10569, 5, 11, 9479, 5, 12, 38308, // 5,12 +4, 12, 7969, 4, 13, 12079, 5, 12, 10156, 5, 13, 35332, // 5,13 +4, 13, 8685, 4, 14, 13600, 5, 13, 10665, 5, 14, 32586, // 5,14 +4, 14, 9323, 4, 15, 15135, 5, 14, 11013, 5, 15, 30065, // 5,15 +6, -1, 10351, 6, 0, 30939, 7, -1, 8927, 7, 0, 15319, // 6, 0 +6, 0, 9961, 6, 1, 33642, 7, 0, 8286, 7, 1, 13647, // 6, 1 +6, 1, 9390, 6, 2, 36631, 7, 1, 7543, 7, 2, 11972, // 6, 2 +6, 2, 8617, 6, 3, 39949, 7, 2, 6695, 7, 3, 10275, // 6, 3 +6, 3, 7626, 6, 4, 43626, 7, 3, 5739, 7, 4, 8545, // 6, 4 +6, 4, 6422, 6, 5, 47630, 7, 4, 4690, 7, 5, 6794, // 6, 5 +6, 5, 5099, 6, 6, 51701, 7, 5, 3620, 7, 6, 5116, // 6, 6 +6, 6, 4044, 6, 7, 54831, 7, 6, 2797, 7, 7, 3864, // 6, 7 +5, 7, 2795, 5, 8, 3853, 6, 7, 4049, 6, 8, 54839, // 6, 8 +5, 8, 3620, 5, 9, 5099, 6, 8, 5116, 6, 9, 51701, // 6, 9 +5, 9, 4694, 5, 10, 6768, 6, 9, 6455, 6, 10, 47619, // 6,10 +5, 10, 5749, 5, 11, 8507, 6, 10, 7678, 6, 11, 43602, // 6,11 +5, 11, 6714, 5, 12, 10221, 6, 11, 8690, 6, 12, 39911, // 6,12 +5, 12, 7573, 5, 13, 11897, 6, 12, 9484, 6, 13, 36582, // 6,13 +5, 13, 8329, 5, 14, 13548, 6, 13, 10074, 6, 14, 33585, // 6,14 +5, 14, 8986, 5, 15, 15193, 6, 14, 10482, 6, 15, 30875, // 6,15 +7, -1, 9959, 7, 0, 31532, 8, -1, 8669, 8, 0, 15376, // 7, 0 +7, 0, 9534, 7, 1, 34340, 8, 0, 8024, 8, 1, 13638, // 7, 1 +7, 1, 8918, 7, 2, 37470, 8, 1, 7266, 8, 2, 11882, // 7, 2 +7, 2, 8082, 7, 3, 40994, 8, 2, 6381, 8, 3, 10079, // 7, 3 +7, 3, 6987, 7, 4, 44999, 8, 3, 5354, 8, 4, 8196, // 7, 4 +7, 4, 5590, 7, 5, 49588, 8, 4, 4164, 8, 5, 6194, // 7, 5 +7, 5, 3853, 7, 6, 54839, 8, 5, 2795, 8, 6, 4049, // 7, 6 +7, 6, 1903, 7, 7, 60382, 8, 6, 1347, 8, 7, 1904, // 7, 7 +6, 7, 1347, 6, 8, 1903, 7, 7, 1905, 7, 8, 60381, // 7, 8 +6, 8, 2797, 6, 9, 4044, 7, 8, 3864, 7, 9, 54831, // 7, 9 +6, 9, 4172, 6, 10, 6183, 7, 9, 5615, 7, 10, 49566, // 7,10 +6, 10, 5368, 6, 11, 8177, 7, 10, 7029, 7, 11, 44962, // 7,11 +6, 11, 6403, 6, 12, 10051, 7, 11, 8141, 7, 12, 40941, // 7,12 +6, 12, 7298, 6, 13, 11842, 7, 12, 8994, 7, 13, 37402, // 7,13 +6, 13, 8068, 6, 14, 13582, 7, 13, 9626, 7, 14, 34260, // 7,14 +6, 14, 8727, 6, 15, 15301, 7, 14, 10065, 7, 15, 31443, // 7,15 +8, 0, 31444, 8, 1, 10065, 9, 0, 15301, 9, 1, 8726, // 8, 0 +8, 1, 34261, 8, 2, 9626, 9, 1, 13582, 9, 2, 8067, // 8, 1 +8, 2, 37402, 8, 3, 8994, 9, 2, 11842, 9, 3, 7298, // 8, 2 +8, 3, 40940, 8, 4, 8141, 9, 3, 10051, 9, 4, 6404, // 8, 3 +8, 4, 44962, 8, 5, 7029, 9, 4, 8177, 9, 5, 5368, // 8, 4 +8, 5, 49566, 8, 6, 5615, 9, 5, 6183, 9, 6, 4172, // 8, 5 +8, 6, 54831, 8, 7, 3864, 9, 6, 4044, 9, 7, 2797, // 8, 6 +8, 7, 60382, 8, 8, 1905, 9, 7, 1903, 9, 8, 1346, // 8, 7 +7, 8, 1905, 7, 9, 1347, 8, 8, 60382, 8, 9, 1902, // 8, 8 +7, 9, 4049, 7, 10, 2795, 8, 9, 54839, 8, 10, 3853, // 8, 9 +7, 10, 6193, 7, 11, 4164, 8, 10, 49588, 8, 11, 5591, // 8,10 +7, 11, 8195, 7, 12, 5354, 8, 11, 44999, 8, 12, 6988, // 8,11 +7, 12, 10079, 7, 13, 6381, 8, 12, 40994, 8, 13, 8082, // 8,12 +7, 13, 11883, 7, 14, 7266, 8, 13, 37470, 8, 14, 8917, // 8,13 +7, 14, 13638, 7, 15, 8024, 8, 14, 34340, 8, 15, 9534, // 8,14 +7, 15, 15376, 7, 16, 8669, 8, 15, 31532, 8, 16, 9959, // 8,15 +9, 0, 30876, 9, 1, 10482, 10, 0, 15193, 10, 1, 8985, // 9, 0 +9, 1, 33585, 9, 2, 10074, 10, 1, 13548, 10, 2, 8329, // 9, 1 +9, 2, 36582, 9, 3, 9484, 10, 2, 11897, 10, 3, 7573, // 9, 2 +9, 3, 39912, 9, 4, 8690, 10, 3, 10221, 10, 4, 6713, // 9, 3 +9, 4, 43602, 9, 5, 7678, 10, 4, 8507, 10, 5, 5749, // 9, 4 +9, 5, 47619, 9, 6, 6455, 10, 5, 6768, 10, 6, 4694, // 9, 5 +9, 6, 51701, 9, 7, 5116, 10, 6, 5099, 10, 7, 3620, // 9, 6 +9, 7, 54839, 9, 8, 4049, 10, 7, 3853, 10, 8, 2795, // 9, 7 +8, 8, 3864, 8, 9, 2797, 9, 8, 54831, 9, 9, 4044, // 9, 8 +8, 9, 5116, 8, 10, 3620, 9, 9, 51701, 9, 10, 5099, // 9, 9 +8, 10, 6794, 8, 11, 4690, 9, 10, 47630, 9, 11, 6422, // 9,10 +8, 11, 8545, 8, 12, 5739, 9, 11, 43626, 9, 12, 7626, // 9,11 +8, 12, 10275, 8, 13, 6695, 9, 12, 39949, 9, 13, 8617, // 9,12 +8, 13, 11972, 8, 14, 7543, 9, 13, 36631, 9, 14, 9390, // 9,13 +8, 14, 13647, 8, 15, 8286, 9, 14, 33642, 9, 15, 9961, // 9,14 +8, 15, 15319, 8, 16, 8927, 9, 15, 30939, 9, 16, 10351, // 9,15 +10, 0, 30064, 10, 1, 11013, 11, 0, 15135, 11, 1, 9324, // 10, 0 +10, 1, 32586, 10, 2, 10665, 11, 1, 13600, 11, 2, 8685, // 10, 1 +10, 2, 35332, 10, 3, 10156, 11, 2, 12079, 11, 3, 7969, // 10, 2 +10, 3, 38307, 10, 4, 9479, 11, 3, 10569, 11, 4, 7181, // 10, 3 +10, 4, 41475, 10, 5, 8646, 11, 4, 9081, 11, 5, 6334, // 10, 4 +10, 5, 44700, 10, 6, 7705, 11, 5, 7659, 11, 6, 5472, // 10, 5 +10, 6, 47630, 10, 7, 6794, 11, 6, 6422, 11, 7, 4690, // 10, 6 +10, 7, 49588, 10, 8, 6193, 11, 7, 5590, 11, 8, 4165, // 10, 7 +9, 8, 5615, 9, 9, 4172, 10, 8, 49566, 10, 9, 6183, // 10, 8 +9, 9, 6455, 9, 10, 4694, 10, 9, 47619, 10, 10, 6768, // 10, 9 +9, 10, 7705, 9, 11, 5472, 10, 10, 44700, 10, 11, 7659, // 10,10 +9, 11, 9143, 9, 12, 6328, 10, 11, 41487, 10, 12, 8578, // 10,11 +9, 12, 10653, 9, 13, 7165, 10, 12, 38330, 10, 13, 9388, // 10,12 +9, 13, 12188, 9, 14, 7943, 10, 13, 35364, 10, 14, 10041, // 10,13 +9, 14, 13740, 9, 15, 8645, 10, 14, 32624, 10, 15, 10527, // 10,14 +9, 15, 15311, 9, 16, 9265, 10, 15, 30105, 10, 16, 10855, // 10,15 +11, 0, 29055, 11, 1, 11652, 12, 0, 15100, 12, 1, 9729, // 11, 0 +11, 1, 31339, 11, 2, 11385, 12, 1, 13694, 12, 2, 9118, // 11, 1 +11, 2, 33777, 11, 3, 10983, 12, 2, 12323, 12, 3, 8453, // 11, 2 +11, 3, 36343, 11, 4, 10452, 12, 3, 10995, 12, 4, 7746, // 11, 3 +11, 4, 38966, 11, 5, 9818, 12, 4, 9730, 12, 5, 7022, // 11, 4 +11, 5, 41487, 11, 6, 9143, 12, 5, 8578, 12, 6, 6328, // 11, 5 +11, 6, 43626, 11, 7, 8545, 12, 6, 7626, 12, 7, 5739, // 11, 6 +11, 7, 44999, 11, 8, 8195, 12, 7, 6987, 12, 8, 5355, // 11, 7 +10, 8, 7029, 10, 9, 5368, 11, 8, 44962, 11, 9, 8177, // 11, 8 +10, 9, 7678, 10, 10, 5749, 11, 9, 43602, 11, 10, 8507, // 11, 9 +10, 10, 8646, 10, 11, 6334, 11, 10, 41475, 11, 11, 9081, // 11,10 +10, 11, 9818, 10, 12, 7022, 11, 11, 38966, 11, 12, 9730, // 11,11 +10, 12, 11108, 10, 13, 7737, 11, 12, 36354, 11, 13, 10337, // 11,12 +10, 13, 12467, 10, 14, 8432, 11, 13, 33795, 11, 14, 10842, // 11,13 +10, 14, 13875, 10, 15, 9082, 11, 14, 31361, 11, 15, 11218, // 11,14 +10, 15, 15325, 10, 16, 9673, 11, 15, 29078, 11, 16, 11460, // 11,15 +12, 0, 27903, 12, 1, 12388, 13, 0, 15060, 13, 1, 10185, // 12, 0 +12, 1, 29928, 12, 2, 12216, 13, 1, 13789, 13, 2, 9603, // 12, 1 +12, 2, 32045, 12, 3, 11934, 13, 2, 12569, 13, 3, 8988, // 12, 2 +12, 3, 34213, 12, 4, 11554, 13, 3, 11411, 13, 4, 8358, // 12, 3 +12, 4, 36354, 12, 5, 11108, 13, 4, 10337, 13, 5, 7737, // 12, 4 +12, 5, 38330, 12, 6, 10653, 13, 5, 9388, 13, 6, 7165, // 12, 5 +12, 6, 39949, 12, 7, 10275, 13, 6, 8617, 13, 7, 6695, // 12, 6 +12, 7, 40994, 12, 8, 10079, 13, 7, 8082, 13, 8, 6381, // 12, 7 +11, 8, 8141, 11, 9, 6403, 12, 8, 40940, 12, 9, 10052, // 12, 8 +11, 9, 8690, 11, 10, 6714, 12, 9, 39912, 12, 10, 10220, // 12, 9 +11, 10, 9479, 11, 11, 7180, 12, 10, 38307, 12, 11, 10570, // 12,10 +11, 11, 10452, 11, 12, 7746, 12, 11, 36343, 12, 12, 10995, // 12,11 +11, 12, 11554, 11, 13, 8358, 12, 12, 34213, 12, 13, 11411, // 12,12 +11, 13, 12747, 11, 14, 8976, 12, 13, 32052, 12, 14, 11761, // 12,13 +11, 14, 14009, 11, 15, 9575, 12, 14, 29938, 12, 15, 12014, // 12,14 +11, 15, 15330, 11, 16, 10135, 12, 15, 27912, 12, 16, 12159, // 12,15 +13, 0, 26660, 13, 1, 13211, 14, 0, 14990, 14, 1, 10675, // 13, 0 +13, 1, 28427, 13, 2, 13141, 14, 1, 13850, 14, 2, 10118, // 13, 1 +13, 2, 30239, 13, 3, 12982, 14, 2, 12769, 14, 3, 9546, // 13, 2 +13, 3, 32052, 13, 4, 12747, 14, 3, 11760, 14, 4, 8977, // 13, 3 +13, 4, 33795, 13, 5, 12467, 14, 4, 10842, 14, 5, 8432, // 13, 4 +13, 5, 35364, 13, 6, 12188, 14, 5, 10041, 14, 6, 7943, // 13, 5 +13, 6, 36631, 13, 7, 11972, 14, 6, 9390, 14, 7, 7543, // 13, 6 +13, 7, 37470, 13, 8, 11883, 14, 7, 8918, 14, 8, 7265, // 13, 7 +12, 8, 8994, 12, 9, 7298, 13, 8, 37402, 13, 9, 11842, // 13, 8 +12, 9, 9484, 12, 10, 7573, 13, 9, 36582, 13, 10, 11897, // 13, 9 +12, 10, 10156, 12, 11, 7969, 13, 10, 35332, 13, 11, 12079, // 13,10 +12, 11, 10983, 12, 12, 8452, 13, 11, 33777, 13, 12, 12324, // 13,11 +12, 12, 11934, 12, 13, 8988, 13, 12, 32045, 13, 13, 12569, // 13,12 +12, 13, 12982, 12, 14, 9546, 13, 13, 30239, 13, 14, 12769, // 13,13 +12, 14, 14107, 12, 15, 10102, 13, 14, 28430, 13, 15, 12897, // 13,14 +12, 15, 15301, 12, 16, 10637, 13, 15, 26660, 13, 16, 12938, // 13,15 +14, 0, 25368, 14, 1, 14109, 15, 0, 14872, 15, 1, 11187, // 14, 0 +14, 1, 26893, 14, 2, 14145, 15, 1, 13853, 15, 2, 10645, // 14, 1 +14, 2, 28430, 14, 3, 14107, 15, 2, 12897, 15, 3, 10102, // 14, 2 +14, 3, 29938, 14, 4, 14009, 15, 3, 12014, 15, 4, 9575, // 14, 3 +14, 4, 31361, 14, 5, 13875, 15, 4, 11218, 15, 5, 9082, // 14, 4 +14, 5, 32624, 14, 6, 13740, 15, 5, 10528, 15, 6, 8644, // 14, 5 +14, 6, 33642, 14, 7, 13647, 15, 6, 9961, 15, 7, 8286, // 14, 6 +14, 7, 34340, 14, 8, 13638, 15, 7, 9534, 15, 8, 8024, // 14, 7 +13, 8, 9626, 13, 9, 8068, 14, 8, 34261, 14, 9, 13581, // 14, 8 +13, 9, 10074, 13, 10, 8329, 14, 9, 33585, 14, 10, 13548, // 14, 9 +13, 10, 10665, 13, 11, 8685, 14, 10, 32586, 14, 11, 13600, // 14,10 +13, 11, 11385, 13, 12, 9118, 14, 11, 31339, 14, 12, 13694, // 14,11 +13, 12, 12216, 13, 13, 9603, 14, 12, 29928, 14, 13, 13789, // 14,12 +13, 13, 13141, 13, 14, 10119, 14, 13, 28427, 14, 14, 13849, // 14,13 +13, 14, 14145, 13, 15, 10644, 14, 14, 26893, 14, 15, 13854, // 14,14 +13, 15, 15220, 13, 16, 11164, 14, 15, 25366, 14, 16, 13786, // 14,15 +15, 0, 24063, 15, 1, 15076, 16, 0, 14696, 16, 1, 11701, // 15, 0 +15, 1, 25366, 15, 2, 15220, 16, 1, 13787, 16, 2, 11163, // 15, 1 +15, 2, 26660, 15, 3, 15301, 16, 2, 12938, 16, 3, 10637, // 15, 2 +15, 3, 27912, 15, 4, 15330, 16, 3, 12159, 16, 4, 10135, // 15, 3 +15, 4, 29078, 15, 5, 15325, 16, 4, 11461, 16, 5, 9672, // 15, 4 +15, 5, 30105, 15, 6, 15311, 16, 5, 10855, 16, 6, 9265, // 15, 5 +15, 6, 30939, 15, 7, 15319, 16, 6, 10351, 16, 7, 8927, // 15, 6 +15, 7, 31532, 15, 8, 15376, 16, 7, 9959, 16, 8, 8669, // 15, 7 +14, 8, 10065, 14, 9, 8727, 15, 8, 31444, 15, 9, 15300, // 15, 8 +14, 9, 10482, 14, 10, 8986, 15, 9, 30876, 15, 10, 15192, // 15, 9 +14, 10, 11013, 14, 11, 9323, 15, 10, 30064, 15, 11, 15136, // 15,10 +14, 11, 11652, 14, 12, 9728, 15, 11, 29055, 15, 12, 15101, // 15,11 +14, 12, 12388, 14, 13, 10185, 15, 12, 27903, 15, 13, 15060, // 15,12 +14, 13, 13211, 14, 14, 10676, 15, 13, 26660, 15, 14, 14989, // 15,13 +14, 14, 14109, 14, 15, 11187, 15, 14, 25368, 15, 15, 14872, // 15,14 +14, 15, 15076, 14, 16, 11702, 15, 15, 24063, 15, 16, 14695, // 15,15 diff --git a/vp8/common/seg_common.c b/vp8/common/seg_common.c index 3ba374a49..b616391ba 100644 --- a/vp8/common/seg_common.c +++ b/vp8/common/seg_common.c @@ -12,156 +12,136 @@ const int segfeaturedata_signed[SEG_LVL_MAX] = {1, 1, 0, 0, 0, 0}; const int vp8_seg_feature_data_bits[SEG_LVL_MAX] = - {QINDEX_BITS, 6, 4, 4, 6, 2}; +{QINDEX_BITS, 6, 4, 4, 6, 2}; // These functions provide access to new segment level features. // Eventually these function may be "optimized out" but for the moment, // the coding mechanism is still subject to change so these provide a // convenient single point of change. -int segfeature_active( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id ) -{ - // Return true if mask bit set and segmentation enabled. - return ( xd->segmentation_enabled && - ( xd->segment_feature_mask[segment_id] & - (0x01 << feature_id) ) ); +int segfeature_active(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id) { + // Return true if mask bit set and segmentation enabled. + return (xd->segmentation_enabled && + (xd->segment_feature_mask[segment_id] & + (0x01 << feature_id))); } -void clearall_segfeatures( MACROBLOCKD *xd ) -{ - vpx_memset(xd->segment_feature_data, 0, sizeof(xd->segment_feature_data)); - vpx_memset(xd->segment_feature_mask, 0, sizeof(xd->segment_feature_mask)); +void clearall_segfeatures(MACROBLOCKD *xd) { + vpx_memset(xd->segment_feature_data, 0, sizeof(xd->segment_feature_data)); + vpx_memset(xd->segment_feature_mask, 0, sizeof(xd->segment_feature_mask)); } -void enable_segfeature( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id ) -{ - xd->segment_feature_mask[segment_id] |= (0x01 << feature_id); +void enable_segfeature(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id) { + xd->segment_feature_mask[segment_id] |= (0x01 << feature_id); } -void disable_segfeature( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id ) -{ - xd->segment_feature_mask[segment_id] &= ~(1 << feature_id); +void disable_segfeature(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id) { + xd->segment_feature_mask[segment_id] &= ~(1 << feature_id); } -int seg_feature_data_bits( SEG_LVL_FEATURES feature_id ) -{ - return vp8_seg_feature_data_bits[feature_id]; +int seg_feature_data_bits(SEG_LVL_FEATURES feature_id) { + return vp8_seg_feature_data_bits[feature_id]; } -int is_segfeature_signed( SEG_LVL_FEATURES feature_id ) -{ - return ( segfeaturedata_signed[feature_id] ); +int is_segfeature_signed(SEG_LVL_FEATURES feature_id) { + return (segfeaturedata_signed[feature_id]); } -void clear_segdata( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id) -{ - xd->segment_feature_data[segment_id][feature_id] = 0; +void clear_segdata(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id) { + xd->segment_feature_data[segment_id][feature_id] = 0; } -void set_segdata( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id, - int seg_data ) -{ - xd->segment_feature_data[segment_id][feature_id] = seg_data; +void set_segdata(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id, + int seg_data) { + xd->segment_feature_data[segment_id][feature_id] = seg_data; } -int get_segdata( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id ) -{ - return xd->segment_feature_data[segment_id][feature_id]; +int get_segdata(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id) { + return xd->segment_feature_data[segment_id][feature_id]; } #if CONFIG_FEATUREUPDATES -int old_segfeature_active( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id ) -{ - // Return true if mask bit set and segmentation enabled. - return ( xd->segmentation_enabled && - ( xd->old_segment_feature_mask[segment_id] & - (0x01 << feature_id) ) ); +int old_segfeature_active(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id) { + // Return true if mask bit set and segmentation enabled. + return (xd->segmentation_enabled && + (xd->old_segment_feature_mask[segment_id] & + (0x01 << feature_id))); } -int get_old_segdata( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id ) -{ - return xd->old_segment_feature_data[segment_id][feature_id]; +int get_old_segdata(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id) { + return xd->old_segment_feature_data[segment_id][feature_id]; } -int segfeature_changed( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id ) -{ - // Return true if mask bit or data is different from last time - return - ( xd->segmentation_enabled && - ( - (xd->old_segment_feature_mask[segment_id] & (1 << feature_id) ) != - (xd->segment_feature_mask[segment_id] & (1 << feature_id) ) - || xd->old_segment_feature_data[segment_id][feature_id] != - xd->segment_feature_data[segment_id][feature_id] - ) - ); -} - -void save_segment_info ( MACROBLOCKD *xd ) -{ - int i,j; - for (i = 0; i < MAX_MB_SEGMENTS; i++) - { - xd->old_segment_feature_mask[i] = xd->segment_feature_mask[i]; - - // For each segmentation codable feature... - for (j = 0; j < SEG_LVL_MAX; j++) - { - xd->old_segment_feature_data[i][j]=xd->segment_feature_data[i][j]; - - } +int segfeature_changed(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id) { + // Return true if mask bit or data is different from last time + return + (xd->segmentation_enabled && + ( + (xd->old_segment_feature_mask[segment_id] & (1 << feature_id)) != + (xd->segment_feature_mask[segment_id] & (1 << feature_id)) + || xd->old_segment_feature_data[segment_id][feature_id] != + xd->segment_feature_data[segment_id][feature_id] + ) + ); +} + +void save_segment_info(MACROBLOCKD *xd) { + int i, j; + for (i = 0; i < MAX_MB_SEGMENTS; i++) { + xd->old_segment_feature_mask[i] = xd->segment_feature_mask[i]; + + // For each segmentation codable feature... + for (j = 0; j < SEG_LVL_MAX; j++) { + xd->old_segment_feature_data[i][j] = xd->segment_feature_data[i][j]; + } + } } #endif -void clear_segref( MACROBLOCKD *xd, int segment_id ) -{ - xd->segment_feature_data[segment_id][SEG_LVL_REF_FRAME] = 0; +void clear_segref(MACROBLOCKD *xd, int segment_id) { + xd->segment_feature_data[segment_id][SEG_LVL_REF_FRAME] = 0; } -void set_segref( MACROBLOCKD *xd, - int segment_id, - MV_REFERENCE_FRAME ref_frame ) -{ - xd->segment_feature_data[segment_id][SEG_LVL_REF_FRAME] |= - (1 << ref_frame); +void set_segref(MACROBLOCKD *xd, + int segment_id, + MV_REFERENCE_FRAME ref_frame) { + xd->segment_feature_data[segment_id][SEG_LVL_REF_FRAME] |= + (1 << ref_frame); } -int check_segref( MACROBLOCKD *xd, - int segment_id, - MV_REFERENCE_FRAME ref_frame ) -{ - return ( xd->segment_feature_data[segment_id][SEG_LVL_REF_FRAME] & - (1 << ref_frame) ) ? 1 : 0; +int check_segref(MACROBLOCKD *xd, + int segment_id, + MV_REFERENCE_FRAME ref_frame) { + return (xd->segment_feature_data[segment_id][SEG_LVL_REF_FRAME] & + (1 << ref_frame)) ? 1 : 0; } -int check_segref_inter(MACROBLOCKD *xd, int segment_id) -{ - return ( xd->segment_feature_data[segment_id][SEG_LVL_REF_FRAME] & - ~(1 << INTRA_FRAME) ) ? 1 : 0; +int check_segref_inter(MACROBLOCKD *xd, int segment_id) { + return (xd->segment_feature_data[segment_id][SEG_LVL_REF_FRAME] & + ~(1 << INTRA_FRAME)) ? 1 : 0; } -int get_seg_tx_type(MACROBLOCKD *xd, int segment_id) -{ - if ( segfeature_active(xd, segment_id, SEG_LVL_TRANSFORM) ) - return get_segdata(xd, segment_id, SEG_LVL_TRANSFORM); - else - return TX_4X4; +int get_seg_tx_type(MACROBLOCKD *xd, int segment_id) { + if (segfeature_active(xd, segment_id, SEG_LVL_TRANSFORM)) + return get_segdata(xd, segment_id, SEG_LVL_TRANSFORM); + else + return TX_4X4; } // TBD? Functions to read and write segment data with range / validity checking diff --git a/vp8/common/seg_common.h b/vp8/common/seg_common.h index bfd364e6d..74131926f 100644 --- a/vp8/common/seg_common.h +++ b/vp8/common/seg_common.h @@ -15,67 +15,67 @@ #ifndef __INC_SEG_COMMON_H__ #define __INC_SEG_COMMON_H__ 1 -int segfeature_active( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id ); - -void clearall_segfeatures( MACROBLOCKD *xd ); +int segfeature_active(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id); -void enable_segfeature( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id ); +void clearall_segfeatures(MACROBLOCKD *xd); -void disable_segfeature( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id ); +void enable_segfeature(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id); -int seg_feature_data_bits( SEG_LVL_FEATURES feature_id ); +void disable_segfeature(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id); -int is_segfeature_signed( SEG_LVL_FEATURES feature_id ); +int seg_feature_data_bits(SEG_LVL_FEATURES feature_id); -void clear_segdata( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id); +int is_segfeature_signed(SEG_LVL_FEATURES feature_id); -void set_segdata( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id, - int seg_data ); +void clear_segdata(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id); -int get_segdata( MACROBLOCKD *xd, +void set_segdata(MACROBLOCKD *xd, int segment_id, - SEG_LVL_FEATURES feature_id ); + SEG_LVL_FEATURES feature_id, + int seg_data); + +int get_segdata(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id); #if CONFIG_FEATUREUPDATES -int old_segfeature_active( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id ); +int old_segfeature_active(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id); -int get_old_segdata( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id ); +int get_old_segdata(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id); -void save_segment_info ( MACROBLOCKD *xd ); +void save_segment_info(MACROBLOCKD *xd); -int segfeature_changed( MACROBLOCKD *xd, - int segment_id, - SEG_LVL_FEATURES feature_id ); +int segfeature_changed(MACROBLOCKD *xd, + int segment_id, + SEG_LVL_FEATURES feature_id); #endif -void clear_segref( MACROBLOCKD *xd, int segment_id ); +void clear_segref(MACROBLOCKD *xd, int segment_id); -void set_segref( MACROBLOCKD *xd, - int segment_id, - MV_REFERENCE_FRAME ref_frame ); +void set_segref(MACROBLOCKD *xd, + int segment_id, + MV_REFERENCE_FRAME ref_frame); -int check_segref( MACROBLOCKD *xd, - int segment_id, - MV_REFERENCE_FRAME ref_frame ); +int check_segref(MACROBLOCKD *xd, + int segment_id, + MV_REFERENCE_FRAME ref_frame); int check_segref_inter(MACROBLOCKD *xd, int segment_id); diff --git a/vp8/common/setupintrarecon.c b/vp8/common/setupintrarecon.c index 7976e252b..bc6c832ca 100644 --- a/vp8/common/setupintrarecon.c +++ b/vp8/common/setupintrarecon.c @@ -12,21 +12,20 @@ #include "setupintrarecon.h" #include "vpx_mem/vpx_mem.h" -void vp8_setup_intra_recon(YV12_BUFFER_CONFIG *ybf) -{ - int i; +void vp8_setup_intra_recon(YV12_BUFFER_CONFIG *ybf) { + int i; - /* set up frame new frame for intra coded blocks */ - vpx_memset(ybf->y_buffer - 1 - ybf->y_stride, 127, ybf->y_width + 5); - for (i = 0; i < ybf->y_height; i++) - ybf->y_buffer[ybf->y_stride *i - 1] = (unsigned char) 129; + /* set up frame new frame for intra coded blocks */ + vpx_memset(ybf->y_buffer - 1 - ybf->y_stride, 127, ybf->y_width + 5); + for (i = 0; i < ybf->y_height; i++) + ybf->y_buffer[ybf->y_stride * i - 1] = (unsigned char) 129; - vpx_memset(ybf->u_buffer - 1 - ybf->uv_stride, 127, ybf->uv_width + 5); - for (i = 0; i < ybf->uv_height; i++) - ybf->u_buffer[ybf->uv_stride *i - 1] = (unsigned char) 129; + vpx_memset(ybf->u_buffer - 1 - ybf->uv_stride, 127, ybf->uv_width + 5); + for (i = 0; i < ybf->uv_height; i++) + ybf->u_buffer[ybf->uv_stride * i - 1] = (unsigned char) 129; - vpx_memset(ybf->v_buffer - 1 - ybf->uv_stride, 127, ybf->uv_width + 5); - for (i = 0; i < ybf->uv_height; i++) - ybf->v_buffer[ybf->uv_stride *i - 1] = (unsigned char) 129; + vpx_memset(ybf->v_buffer - 1 - ybf->uv_stride, 127, ybf->uv_width + 5); + for (i = 0; i < ybf->uv_height; i++) + ybf->v_buffer[ybf->uv_stride * i - 1] = (unsigned char) 129; } diff --git a/vp8/common/subpixel.h b/vp8/common/subpixel.h index 1812bed03..c2dae7275 100644 --- a/vp8/common/subpixel.h +++ b/vp8/common/subpixel.h @@ -13,8 +13,8 @@ #define SUBPIXEL_H #define prototype_subpixel_predict(sym) \ - void sym(unsigned char *src, int src_pitch, int xofst, int yofst, \ - unsigned char *dst, int dst_pitch) + void sym(unsigned char *src, int src_pitch, int xofst, int yofst, \ + unsigned char *dst, int dst_pitch) #if ARCH_X86 || ARCH_X86_64 #include "x86/subpixel_x86.h" @@ -166,38 +166,37 @@ extern prototype_subpixel_predict(vp8_subpix_bilinear4x4); extern prototype_subpixel_predict(vp8_subpix_bilinear_avg4x4); typedef prototype_subpixel_predict((*vp8_subpix_fn_t)); -typedef struct -{ +typedef struct { #if CONFIG_ENHANCED_INTERP - vp8_subpix_fn_t eighttap16x16; - vp8_subpix_fn_t eighttap8x8; - vp8_subpix_fn_t eighttap_avg16x16; - vp8_subpix_fn_t eighttap_avg8x8; - vp8_subpix_fn_t eighttap_avg4x4; - vp8_subpix_fn_t eighttap8x4; - vp8_subpix_fn_t eighttap4x4; - vp8_subpix_fn_t eighttap16x16_sharp; - vp8_subpix_fn_t eighttap8x8_sharp; - vp8_subpix_fn_t eighttap_avg16x16_sharp; - vp8_subpix_fn_t eighttap_avg8x8_sharp; - vp8_subpix_fn_t eighttap_avg4x4_sharp; - vp8_subpix_fn_t eighttap8x4_sharp; - vp8_subpix_fn_t eighttap4x4_sharp; -#endif - vp8_subpix_fn_t sixtap16x16; - vp8_subpix_fn_t sixtap8x8; - vp8_subpix_fn_t sixtap_avg16x16; - vp8_subpix_fn_t sixtap_avg8x8; - vp8_subpix_fn_t sixtap8x4; - vp8_subpix_fn_t sixtap4x4; - vp8_subpix_fn_t sixtap_avg4x4; - vp8_subpix_fn_t bilinear16x16; - vp8_subpix_fn_t bilinear8x8; - vp8_subpix_fn_t bilinear_avg16x16; - vp8_subpix_fn_t bilinear_avg8x8; - vp8_subpix_fn_t bilinear8x4; - vp8_subpix_fn_t bilinear4x4; - vp8_subpix_fn_t bilinear_avg4x4; + vp8_subpix_fn_t eighttap16x16; + vp8_subpix_fn_t eighttap8x8; + vp8_subpix_fn_t eighttap_avg16x16; + vp8_subpix_fn_t eighttap_avg8x8; + vp8_subpix_fn_t eighttap_avg4x4; + vp8_subpix_fn_t eighttap8x4; + vp8_subpix_fn_t eighttap4x4; + vp8_subpix_fn_t eighttap16x16_sharp; + vp8_subpix_fn_t eighttap8x8_sharp; + vp8_subpix_fn_t eighttap_avg16x16_sharp; + vp8_subpix_fn_t eighttap_avg8x8_sharp; + vp8_subpix_fn_t eighttap_avg4x4_sharp; + vp8_subpix_fn_t eighttap8x4_sharp; + vp8_subpix_fn_t eighttap4x4_sharp; +#endif + vp8_subpix_fn_t sixtap16x16; + vp8_subpix_fn_t sixtap8x8; + vp8_subpix_fn_t sixtap_avg16x16; + vp8_subpix_fn_t sixtap_avg8x8; + vp8_subpix_fn_t sixtap8x4; + vp8_subpix_fn_t sixtap4x4; + vp8_subpix_fn_t sixtap_avg4x4; + vp8_subpix_fn_t bilinear16x16; + vp8_subpix_fn_t bilinear8x8; + vp8_subpix_fn_t bilinear_avg16x16; + vp8_subpix_fn_t bilinear_avg8x8; + vp8_subpix_fn_t bilinear8x4; + vp8_subpix_fn_t bilinear4x4; + vp8_subpix_fn_t bilinear_avg4x4; } vp8_subpix_rtcd_vtable_t; #if CONFIG_RUNTIME_CPU_DETECT diff --git a/vp8/common/swapyv12buffer.c b/vp8/common/swapyv12buffer.c index 73656b3d7..dec8de2a7 100644 --- a/vp8/common/swapyv12buffer.c +++ b/vp8/common/swapyv12buffer.c @@ -11,24 +11,23 @@ #include "swapyv12buffer.h" -void vp8_swap_yv12_buffer(YV12_BUFFER_CONFIG *new_frame, YV12_BUFFER_CONFIG *last_frame) -{ - unsigned char *temp; +void vp8_swap_yv12_buffer(YV12_BUFFER_CONFIG *new_frame, YV12_BUFFER_CONFIG *last_frame) { + unsigned char *temp; - temp = last_frame->buffer_alloc; - last_frame->buffer_alloc = new_frame->buffer_alloc; - new_frame->buffer_alloc = temp; + temp = last_frame->buffer_alloc; + last_frame->buffer_alloc = new_frame->buffer_alloc; + new_frame->buffer_alloc = temp; - temp = last_frame->y_buffer; - last_frame->y_buffer = new_frame->y_buffer; - new_frame->y_buffer = temp; + temp = last_frame->y_buffer; + last_frame->y_buffer = new_frame->y_buffer; + new_frame->y_buffer = temp; - temp = last_frame->u_buffer; - last_frame->u_buffer = new_frame->u_buffer; - new_frame->u_buffer = temp; + temp = last_frame->u_buffer; + last_frame->u_buffer = new_frame->u_buffer; + new_frame->u_buffer = temp; - temp = last_frame->v_buffer; - last_frame->v_buffer = new_frame->v_buffer; - new_frame->v_buffer = temp; + temp = last_frame->v_buffer; + last_frame->v_buffer = new_frame->v_buffer; + new_frame->v_buffer = temp; } diff --git a/vp8/common/textblit.c b/vp8/common/textblit.c index 1756100a7..2a704ea91 100644 --- a/vp8/common/textblit.c +++ b/vp8/common/textblit.c @@ -11,120 +11,106 @@ #include <stdlib.h> -void vp8_blit_text(const char *msg, unsigned char *address, const int pitch) -{ - int letter_bitmap; - unsigned char *output_pos = address; - int colpos; - const int font[] = - { - 0x0, 0x5C00, 0x8020, 0xAFABEA, 0xD7EC0, 0x1111111, 0x1855740, 0x18000, - 0x45C0, 0x74400, 0x51140, 0x23880, 0xC4000, 0x21080, 0x80000, 0x111110, - 0xE9D72E, 0x87E40, 0x12AD732, 0xAAD62A, 0x4F94C4, 0x4D6B7, 0x456AA, - 0x3E8423, 0xAAD6AA, 0xAAD6A2, 0x2800, 0x2A00, 0x8A880, 0x52940, 0x22A20, - 0x15422, 0x6AD62E, 0x1E4A53E, 0xAAD6BF, 0x8C62E, 0xE8C63F, 0x118D6BF, - 0x1094BF, 0xCAC62E, 0x1F2109F, 0x118FE31, 0xF8C628, 0x8A89F, 0x108421F, - 0x1F1105F, 0x1F4105F, 0xE8C62E, 0x2294BF, 0x164C62E, 0x12694BF, 0x8AD6A2, - 0x10FC21, 0x1F8421F, 0x744107, 0xF8220F, 0x1151151, 0x117041, 0x119D731, - 0x47E0, 0x1041041, 0xFC400, 0x10440, 0x1084210, 0x820 - }; - colpos = 0; - - while (msg[colpos] != 0) - { - char letter = msg[colpos]; - int fontcol, fontrow; - - if (letter <= 'Z' && letter >= ' ') - letter_bitmap = font[letter-' ']; - else if (letter <= 'z' && letter >= 'a') - letter_bitmap = font[letter-'a'+'A' - ' ']; - else - letter_bitmap = font[0]; - - for (fontcol = 6; fontcol >= 0 ; fontcol--) - for (fontrow = 0; fontrow < 5; fontrow++) - output_pos[fontrow *pitch + fontcol] = - ((letter_bitmap >> (fontcol * 5)) & (1 << fontrow) ? 255 : 0); - - output_pos += 7; - colpos++; - } +void vp8_blit_text(const char *msg, unsigned char *address, const int pitch) { + int letter_bitmap; + unsigned char *output_pos = address; + int colpos; + const int font[] = { + 0x0, 0x5C00, 0x8020, 0xAFABEA, 0xD7EC0, 0x1111111, 0x1855740, 0x18000, + 0x45C0, 0x74400, 0x51140, 0x23880, 0xC4000, 0x21080, 0x80000, 0x111110, + 0xE9D72E, 0x87E40, 0x12AD732, 0xAAD62A, 0x4F94C4, 0x4D6B7, 0x456AA, + 0x3E8423, 0xAAD6AA, 0xAAD6A2, 0x2800, 0x2A00, 0x8A880, 0x52940, 0x22A20, + 0x15422, 0x6AD62E, 0x1E4A53E, 0xAAD6BF, 0x8C62E, 0xE8C63F, 0x118D6BF, + 0x1094BF, 0xCAC62E, 0x1F2109F, 0x118FE31, 0xF8C628, 0x8A89F, 0x108421F, + 0x1F1105F, 0x1F4105F, 0xE8C62E, 0x2294BF, 0x164C62E, 0x12694BF, 0x8AD6A2, + 0x10FC21, 0x1F8421F, 0x744107, 0xF8220F, 0x1151151, 0x117041, 0x119D731, + 0x47E0, 0x1041041, 0xFC400, 0x10440, 0x1084210, 0x820 + }; + colpos = 0; + + while (msg[colpos] != 0) { + char letter = msg[colpos]; + int fontcol, fontrow; + + if (letter <= 'Z' && letter >= ' ') + letter_bitmap = font[letter - ' ']; + else if (letter <= 'z' && letter >= 'a') + letter_bitmap = font[letter - 'a' + 'A' - ' ']; + else + letter_bitmap = font[0]; + + for (fontcol = 6; fontcol >= 0; fontcol--) + for (fontrow = 0; fontrow < 5; fontrow++) + output_pos[fontrow * pitch + fontcol] = + ((letter_bitmap >> (fontcol * 5)) & (1 << fontrow) ? 255 : 0); + + output_pos += 7; + colpos++; + } } -static void plot (const int x, const int y, unsigned char *image, const int pitch) -{ - image [x+y*pitch] ^= 255; +static void plot(const int x, const int y, unsigned char *image, const int pitch) { + image [x + y * pitch] ^= 255; } /* Bresenham line algorithm */ -void vp8_blit_line(int x0, int x1, int y0, int y1, unsigned char *image, const int pitch) -{ - int steep = abs(y1 - y0) > abs(x1 - x0); - int deltax, deltay; - int error, ystep, y, x; - - if (steep) - { - int t; - t = x0; - x0 = y0; - y0 = t; - - t = x1; - x1 = y1; - y1 = t; - } - - if (x0 > x1) - { - int t; - t = x0; - x0 = x1; - x1 = t; - - t = y0; - y0 = y1; - y1 = t; +void vp8_blit_line(int x0, int x1, int y0, int y1, unsigned char *image, const int pitch) { + int steep = abs(y1 - y0) > abs(x1 - x0); + int deltax, deltay; + int error, ystep, y, x; + + if (steep) { + int t; + t = x0; + x0 = y0; + y0 = t; + + t = x1; + x1 = y1; + y1 = t; + } + + if (x0 > x1) { + int t; + t = x0; + x0 = x1; + x1 = t; + + t = y0; + y0 = y1; + y1 = t; + } + + deltax = x1 - x0; + deltay = abs(y1 - y0); + error = deltax / 2; + + y = y0; + + if (y0 < y1) + ystep = 1; + else + ystep = -1; + + if (steep) { + for (x = x0; x <= x1; x++) { + plot(y, x, image, pitch); + + error = error - deltay; + if (error < 0) { + y = y + ystep; + error = error + deltax; + } } - - deltax = x1 - x0; - deltay = abs(y1 - y0); - error = deltax / 2; - - y = y0; - - if (y0 < y1) - ystep = 1; - else - ystep = -1; - - if (steep) - { - for (x = x0; x <= x1; x++) - { - plot(y,x, image, pitch); - - error = error - deltay; - if (error < 0) - { - y = y + ystep; - error = error + deltax; - } - } - } - else - { - for (x = x0; x <= x1; x++) - { - plot(x,y, image, pitch); - - error = error - deltay; - if (error < 0) - { - y = y + ystep; - error = error + deltax; - } - } + } else { + for (x = x0; x <= x1; x++) { + plot(x, y, image, pitch); + + error = error - deltay; + if (error < 0) { + y = y + ystep; + error = error + deltax; + } } + } } diff --git a/vp8/common/treecoder.c b/vp8/common/treecoder.c index d80c64bdf..0bb8a0d19 100644 --- a/vp8/common/treecoder.c +++ b/vp8/common/treecoder.c @@ -17,127 +17,108 @@ #include "treecoder.h" static void tree2tok( - struct vp8_token_struct *const p, - vp8_tree t, - int i, - int v, - int L -) -{ - v += v; - ++L; - - do - { - const vp8_tree_index j = t[i++]; - - if (j <= 0) - { - p[-j].value = v; - p[-j].Len = L; - } - else - tree2tok(p, t, j, v, L); - } - while (++v & 1); + struct vp8_token_struct *const p, + vp8_tree t, + int i, + int v, + int L +) { + v += v; + ++L; + + do { + const vp8_tree_index j = t[i++]; + + if (j <= 0) { + p[-j].value = v; + p[-j].Len = L; + } else + tree2tok(p, t, j, v, L); + } while (++v & 1); } -void vp8_tokens_from_tree(struct vp8_token_struct *p, vp8_tree t) -{ - tree2tok(p, t, 0, 0, 0); +void vp8_tokens_from_tree(struct vp8_token_struct *p, vp8_tree t) { + tree2tok(p, t, 0, 0, 0); } void vp8_tokens_from_tree_offset(struct vp8_token_struct *p, vp8_tree t, - int offset) -{ - tree2tok(p - offset, t, 0, 0, 0); + int offset) { + tree2tok(p - offset, t, 0, 0, 0); } static void branch_counts( - int n, /* n = size of alphabet */ - vp8_token tok [ /* n */ ], - vp8_tree tree, - unsigned int branch_ct [ /* n-1 */ ] [2], - const unsigned int num_events[ /* n */ ] -) -{ - const int tree_len = n - 1; - int t = 0; + int n, /* n = size of alphabet */ + vp8_token tok [ /* n */ ], + vp8_tree tree, + unsigned int branch_ct [ /* n-1 */ ] [2], + const unsigned int num_events[ /* n */ ] +) { + const int tree_len = n - 1; + int t = 0; #if CONFIG_DEBUG - assert(tree_len); + assert(tree_len); #endif - do - { - branch_ct[t][0] = branch_ct[t][1] = 0; - } - while (++t < tree_len); + do { + branch_ct[t][0] = branch_ct[t][1] = 0; + } while (++t < tree_len); - t = 0; + t = 0; - do - { - int L = tok[t].Len; - const int enc = tok[t].value; - const unsigned int ct = num_events[t]; + do { + int L = tok[t].Len; + const int enc = tok[t].value; + const unsigned int ct = num_events[t]; - vp8_tree_index i = 0; + vp8_tree_index i = 0; - do - { - const int b = (enc >> --L) & 1; - const int j = i >> 1; + do { + const int b = (enc >> --L) & 1; + const int j = i >> 1; #if CONFIG_DEBUG - assert(j < tree_len && 0 <= L); + assert(j < tree_len && 0 <= L); #endif - branch_ct [j] [b] += ct; - i = tree[ i + b]; - } - while (i > 0); + branch_ct [j] [b] += ct; + i = tree[ i + b]; + } while (i > 0); #if CONFIG_DEBUG - assert(!L); + assert(!L); #endif - } - while (++t < n); + } while (++t < n); } void vp8_tree_probs_from_distribution( - int n, /* n = size of alphabet */ - vp8_token tok [ /* n */ ], - vp8_tree tree, - vp8_prob probs [ /* n-1 */ ], - unsigned int branch_ct [ /* n-1 */ ] [2], - const unsigned int num_events[ /* n */ ], - unsigned int Pfac, - int rd -) -{ - const int tree_len = n - 1; - int t = 0; - - branch_counts(n, tok, tree, branch_ct, num_events); - - do - { - const unsigned int *const c = branch_ct[t]; - const unsigned int tot = c[0] + c[1]; + int n, /* n = size of alphabet */ + vp8_token tok [ /* n */ ], + vp8_tree tree, + vp8_prob probs [ /* n-1 */ ], + unsigned int branch_ct [ /* n-1 */ ] [2], + const unsigned int num_events[ /* n */ ], + unsigned int Pfac, + int rd +) { + const int tree_len = n - 1; + int t = 0; + + branch_counts(n, tok, tree, branch_ct, num_events); + + do { + const unsigned int *const c = branch_ct[t]; + const unsigned int tot = c[0] + c[1]; #if CONFIG_DEBUG - assert(tot < (1 << 24)); /* no overflow below */ + assert(tot < (1 << 24)); /* no overflow below */ #endif - if (tot) - { - const unsigned int p = ((c[0] * Pfac) + (rd ? tot >> 1 : 0)) / tot; - probs[t] = p < 256 ? (p ? p : 1) : 255; /* agree w/old version for now */ - } - else - probs[t] = vp8_prob_half; - } - while (++t < tree_len); + if (tot) { + const unsigned int p = ((c[0] * Pfac) + (rd ? tot >> 1 : 0)) / tot; + probs[t] = p < 256 ? (p ? p : 1) : 255; /* agree w/old version for now */ + } else + probs[t] = vp8_prob_half; + } while (++t < tree_len); } diff --git a/vp8/common/treecoder.h b/vp8/common/treecoder.h index ebf51c5ed..c4d0aa6ee 100644 --- a/vp8/common/treecoder.h +++ b/vp8/common/treecoder.h @@ -45,10 +45,9 @@ typedef const bool_reader c_bool_reader; typedef const vp8_tree_index vp8_tree[], *vp8_tree_p; -typedef const struct vp8_token_struct -{ - int value; - int Len; +typedef const struct vp8_token_struct { + int value; + int Len; } vp8_token; /* Construct encoding array from tree. */ @@ -64,26 +63,26 @@ void vp8_tokens_from_tree_offset(struct vp8_token_struct *, vp8_tree, probability updates. */ void vp8_tree_probs_from_distribution( - int n, /* n = size of alphabet */ - vp8_token tok [ /* n */ ], - vp8_tree tree, - vp8_prob probs [ /* n-1 */ ], - unsigned int branch_ct [ /* n-1 */ ] [2], - const unsigned int num_events[ /* n */ ], - unsigned int Pfactor, - int Round + int n, /* n = size of alphabet */ + vp8_token tok [ /* n */ ], + vp8_tree tree, + vp8_prob probs [ /* n-1 */ ], + unsigned int branch_ct [ /* n-1 */ ] [2], + const unsigned int num_events[ /* n */ ], + unsigned int Pfactor, + int Round ); /* Variant of above using coder spec rather than hardwired 8-bit probs. */ void vp8bc_tree_probs_from_distribution( - int n, /* n = size of alphabet */ - vp8_token tok [ /* n */ ], - vp8_tree tree, - vp8_prob probs [ /* n-1 */ ], - unsigned int branch_ct [ /* n-1 */ ] [2], - const unsigned int num_events[ /* n */ ], - c_bool_coder_spec *s + int n, /* n = size of alphabet */ + vp8_token tok [ /* n */ ], + vp8_tree tree, + vp8_prob probs [ /* n-1 */ ], + unsigned int branch_ct [ /* n-1 */ ] [2], + const unsigned int num_events[ /* n */ ], + c_bool_coder_spec *s ); diff --git a/vp8/common/x86/loopfilter_x86.c b/vp8/common/x86/loopfilter_x86.c index 9360ac17c..add888835 100644 --- a/vp8/common/x86/loopfilter_x86.c +++ b/vp8/common/x86/loopfilter_x86.c @@ -30,77 +30,71 @@ extern loop_filter_uvfunction vp8_mbloop_filter_vertical_edge_uv_sse2; #if HAVE_MMX /* Horizontal MB filtering */ void vp8_loop_filter_mbh_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_mbloop_filter_horizontal_edge_mmx(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); + int y_stride, int uv_stride, loop_filter_info *lfi) { + vp8_mbloop_filter_horizontal_edge_mmx(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); - if (u_ptr) - vp8_mbloop_filter_horizontal_edge_mmx(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); + if (u_ptr) + vp8_mbloop_filter_horizontal_edge_mmx(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - if (v_ptr) - vp8_mbloop_filter_horizontal_edge_mmx(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); + if (v_ptr) + vp8_mbloop_filter_horizontal_edge_mmx(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); } /* Vertical MB Filtering */ void vp8_loop_filter_mbv_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_mbloop_filter_vertical_edge_mmx(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); + int y_stride, int uv_stride, loop_filter_info *lfi) { + vp8_mbloop_filter_vertical_edge_mmx(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); - if (u_ptr) - vp8_mbloop_filter_vertical_edge_mmx(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); + if (u_ptr) + vp8_mbloop_filter_vertical_edge_mmx(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); - if (v_ptr) - vp8_mbloop_filter_vertical_edge_mmx(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); + if (v_ptr) + vp8_mbloop_filter_vertical_edge_mmx(v_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 1); } /* Horizontal B Filtering */ void vp8_loop_filter_bh_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_loop_filter_horizontal_edge_mmx(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_horizontal_edge_mmx(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_horizontal_edge_mmx(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + int y_stride, int uv_stride, loop_filter_info *lfi) { + vp8_loop_filter_horizontal_edge_mmx(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + vp8_loop_filter_horizontal_edge_mmx(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + vp8_loop_filter_horizontal_edge_mmx(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - if (u_ptr) - vp8_loop_filter_horizontal_edge_mmx(u_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); + if (u_ptr) + vp8_loop_filter_horizontal_edge_mmx(u_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); - if (v_ptr) - vp8_loop_filter_horizontal_edge_mmx(v_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); + if (v_ptr) + vp8_loop_filter_horizontal_edge_mmx(v_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); } -void vp8_loop_filter_bhs_mmx(unsigned char *y_ptr, int y_stride, const unsigned char *blimit) -{ - vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr + 4 * y_stride, y_stride, blimit); - vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr + 8 * y_stride, y_stride, blimit); - vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr + 12 * y_stride, y_stride, blimit); +void vp8_loop_filter_bhs_mmx(unsigned char *y_ptr, int y_stride, const unsigned char *blimit) { + vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr + 4 * y_stride, y_stride, blimit); + vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr + 8 * y_stride, y_stride, blimit); + vp8_loop_filter_simple_horizontal_edge_mmx(y_ptr + 12 * y_stride, y_stride, blimit); } /* Vertical B Filtering */ void vp8_loop_filter_bv_mmx(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_loop_filter_vertical_edge_mmx(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_vertical_edge_mmx(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_vertical_edge_mmx(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + int y_stride, int uv_stride, loop_filter_info *lfi) { + vp8_loop_filter_vertical_edge_mmx(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + vp8_loop_filter_vertical_edge_mmx(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + vp8_loop_filter_vertical_edge_mmx(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - if (u_ptr) - vp8_loop_filter_vertical_edge_mmx(u_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); + if (u_ptr) + vp8_loop_filter_vertical_edge_mmx(u_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); - if (v_ptr) - vp8_loop_filter_vertical_edge_mmx(v_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); + if (v_ptr) + vp8_loop_filter_vertical_edge_mmx(v_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, 1); } -void vp8_loop_filter_bvs_mmx(unsigned char *y_ptr, int y_stride, const unsigned char *blimit) -{ - vp8_loop_filter_simple_vertical_edge_mmx(y_ptr + 4, y_stride, blimit); - vp8_loop_filter_simple_vertical_edge_mmx(y_ptr + 8, y_stride, blimit); - vp8_loop_filter_simple_vertical_edge_mmx(y_ptr + 12, y_stride, blimit); +void vp8_loop_filter_bvs_mmx(unsigned char *y_ptr, int y_stride, const unsigned char *blimit) { + vp8_loop_filter_simple_vertical_edge_mmx(y_ptr + 4, y_stride, blimit); + vp8_loop_filter_simple_vertical_edge_mmx(y_ptr + 8, y_stride, blimit); + vp8_loop_filter_simple_vertical_edge_mmx(y_ptr + 12, y_stride, blimit); } #endif @@ -108,65 +102,59 @@ void vp8_loop_filter_bvs_mmx(unsigned char *y_ptr, int y_stride, const unsigned /* Horizontal MB filtering */ #if HAVE_SSE2 void vp8_loop_filter_mbh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_mbloop_filter_horizontal_edge_sse2(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); + int y_stride, int uv_stride, loop_filter_info *lfi) { + vp8_mbloop_filter_horizontal_edge_sse2(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); - if (u_ptr) - vp8_mbloop_filter_horizontal_edge_uv_sse2(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, v_ptr); + if (u_ptr) + vp8_mbloop_filter_horizontal_edge_uv_sse2(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, v_ptr); } /* Vertical MB Filtering */ void vp8_loop_filter_mbv_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_mbloop_filter_vertical_edge_sse2(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); + int y_stride, int uv_stride, loop_filter_info *lfi) { + vp8_mbloop_filter_vertical_edge_sse2(y_ptr, y_stride, lfi->mblim, lfi->lim, lfi->hev_thr, 2); - if (u_ptr) - vp8_mbloop_filter_vertical_edge_uv_sse2(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, v_ptr); + if (u_ptr) + vp8_mbloop_filter_vertical_edge_uv_sse2(u_ptr, uv_stride, lfi->mblim, lfi->lim, lfi->hev_thr, v_ptr); } /* Horizontal B Filtering */ void vp8_loop_filter_bh_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_loop_filter_horizontal_edge_sse2(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_horizontal_edge_sse2(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_horizontal_edge_sse2(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - - if (u_ptr) - vp8_loop_filter_horizontal_edge_uv_sse2(u_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, v_ptr + 4 * uv_stride); + int y_stride, int uv_stride, loop_filter_info *lfi) { + vp8_loop_filter_horizontal_edge_sse2(y_ptr + 4 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + vp8_loop_filter_horizontal_edge_sse2(y_ptr + 8 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + vp8_loop_filter_horizontal_edge_sse2(y_ptr + 12 * y_stride, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + + if (u_ptr) + vp8_loop_filter_horizontal_edge_uv_sse2(u_ptr + 4 * uv_stride, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, v_ptr + 4 * uv_stride); } -void vp8_loop_filter_bhs_sse2(unsigned char *y_ptr, int y_stride, const unsigned char *blimit) -{ - vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr + 4 * y_stride, y_stride, blimit); - vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr + 8 * y_stride, y_stride, blimit); - vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr + 12 * y_stride, y_stride, blimit); +void vp8_loop_filter_bhs_sse2(unsigned char *y_ptr, int y_stride, const unsigned char *blimit) { + vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr + 4 * y_stride, y_stride, blimit); + vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr + 8 * y_stride, y_stride, blimit); + vp8_loop_filter_simple_horizontal_edge_sse2(y_ptr + 12 * y_stride, y_stride, blimit); } /* Vertical B Filtering */ void vp8_loop_filter_bv_sse2(unsigned char *y_ptr, unsigned char *u_ptr, unsigned char *v_ptr, - int y_stride, int uv_stride, loop_filter_info *lfi) -{ - vp8_loop_filter_vertical_edge_sse2(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_vertical_edge_sse2(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - vp8_loop_filter_vertical_edge_sse2(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); - - if (u_ptr) - vp8_loop_filter_vertical_edge_uv_sse2(u_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, v_ptr + 4); + int y_stride, int uv_stride, loop_filter_info *lfi) { + vp8_loop_filter_vertical_edge_sse2(y_ptr + 4, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + vp8_loop_filter_vertical_edge_sse2(y_ptr + 8, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + vp8_loop_filter_vertical_edge_sse2(y_ptr + 12, y_stride, lfi->blim, lfi->lim, lfi->hev_thr, 2); + + if (u_ptr) + vp8_loop_filter_vertical_edge_uv_sse2(u_ptr + 4, uv_stride, lfi->blim, lfi->lim, lfi->hev_thr, v_ptr + 4); } -void vp8_loop_filter_bvs_sse2(unsigned char *y_ptr, int y_stride, const unsigned char *blimit) -{ - vp8_loop_filter_simple_vertical_edge_sse2(y_ptr + 4, y_stride, blimit); - vp8_loop_filter_simple_vertical_edge_sse2(y_ptr + 8, y_stride, blimit); - vp8_loop_filter_simple_vertical_edge_sse2(y_ptr + 12, y_stride, blimit); +void vp8_loop_filter_bvs_sse2(unsigned char *y_ptr, int y_stride, const unsigned char *blimit) { + vp8_loop_filter_simple_vertical_edge_sse2(y_ptr + 4, y_stride, blimit); + vp8_loop_filter_simple_vertical_edge_sse2(y_ptr + 8, y_stride, blimit); + vp8_loop_filter_simple_vertical_edge_sse2(y_ptr + 12, y_stride, blimit); } #endif diff --git a/vp8/common/x86/recon_wrapper_sse2.c b/vp8/common/x86/recon_wrapper_sse2.c index cb7b69c08..57ba3fc7e 100644 --- a/vp8/common/x86/recon_wrapper_sse2.c +++ b/vp8/common/x86/recon_wrapper_sse2.c @@ -14,8 +14,8 @@ #include "vpx_mem/vpx_mem.h" #define build_intra_predictors_mbuv_prototype(sym) \ - void sym(unsigned char *dst, int dst_stride, \ - const unsigned char *src, int src_stride) + void sym(unsigned char *dst, int dst_stride, \ + const unsigned char *src, int src_stride) typedef build_intra_predictors_mbuv_prototype((*build_intra_predictors_mbuv_fn_t)); extern build_intra_predictors_mbuv_prototype(vp8_intra_pred_uv_dc_mmx2); @@ -33,64 +33,70 @@ static void vp8_build_intra_predictors_mbuv_x86(MACROBLOCKD *x, unsigned char *dst_v, int dst_stride, build_intra_predictors_mbuv_fn_t tm_func, - build_intra_predictors_mbuv_fn_t ho_func) -{ - int mode = x->mode_info_context->mbmi.uv_mode; - build_intra_predictors_mbuv_fn_t fn; - int src_stride = x->dst.uv_stride; + build_intra_predictors_mbuv_fn_t ho_func) { + int mode = x->mode_info_context->mbmi.uv_mode; + build_intra_predictors_mbuv_fn_t fn; + int src_stride = x->dst.uv_stride; - switch (mode) { - case V_PRED: fn = vp8_intra_pred_uv_ve_mmx; break; - case H_PRED: fn = ho_func; break; - case TM_PRED: fn = tm_func; break; - case DC_PRED: - if (x->up_available) { - if (x->left_available) { - fn = vp8_intra_pred_uv_dc_mmx2; break; - } else { - fn = vp8_intra_pred_uv_dctop_mmx2; break; - } - } else if (x->left_available) { - fn = vp8_intra_pred_uv_dcleft_mmx2; break; - } else { - fn = vp8_intra_pred_uv_dc128_mmx; break; - } - break; - default: return; - } + switch (mode) { + case V_PRED: + fn = vp8_intra_pred_uv_ve_mmx; + break; + case H_PRED: + fn = ho_func; + break; + case TM_PRED: + fn = tm_func; + break; + case DC_PRED: + if (x->up_available) { + if (x->left_available) { + fn = vp8_intra_pred_uv_dc_mmx2; + break; + } else { + fn = vp8_intra_pred_uv_dctop_mmx2; + break; + } + } else if (x->left_available) { + fn = vp8_intra_pred_uv_dcleft_mmx2; + break; + } else { + fn = vp8_intra_pred_uv_dc128_mmx; + break; + } + break; + default: + return; + } - fn(dst_u, dst_stride, x->dst.u_buffer, src_stride); - fn(dst_v, dst_stride, x->dst.v_buffer, src_stride); + fn(dst_u, dst_stride, x->dst.u_buffer, src_stride); + fn(dst_v, dst_stride, x->dst.v_buffer, src_stride); } -void vp8_build_intra_predictors_mbuv_sse2(MACROBLOCKD *x) -{ - vp8_build_intra_predictors_mbuv_x86(x, &x->predictor[256], - &x->predictor[320], 8, - vp8_intra_pred_uv_tm_sse2, - vp8_intra_pred_uv_ho_mmx2); +void vp8_build_intra_predictors_mbuv_sse2(MACROBLOCKD *x) { + vp8_build_intra_predictors_mbuv_x86(x, &x->predictor[256], + &x->predictor[320], 8, + vp8_intra_pred_uv_tm_sse2, + vp8_intra_pred_uv_ho_mmx2); } -void vp8_build_intra_predictors_mbuv_ssse3(MACROBLOCKD *x) -{ - vp8_build_intra_predictors_mbuv_x86(x, &x->predictor[256], - &x->predictor[320], 8, - vp8_intra_pred_uv_tm_ssse3, - vp8_intra_pred_uv_ho_ssse3); +void vp8_build_intra_predictors_mbuv_ssse3(MACROBLOCKD *x) { + vp8_build_intra_predictors_mbuv_x86(x, &x->predictor[256], + &x->predictor[320], 8, + vp8_intra_pred_uv_tm_ssse3, + vp8_intra_pred_uv_ho_ssse3); } -void vp8_build_intra_predictors_mbuv_s_sse2(MACROBLOCKD *x) -{ - vp8_build_intra_predictors_mbuv_x86(x, x->dst.u_buffer, - x->dst.v_buffer, x->dst.uv_stride, - vp8_intra_pred_uv_tm_sse2, - vp8_intra_pred_uv_ho_mmx2); +void vp8_build_intra_predictors_mbuv_s_sse2(MACROBLOCKD *x) { + vp8_build_intra_predictors_mbuv_x86(x, x->dst.u_buffer, + x->dst.v_buffer, x->dst.uv_stride, + vp8_intra_pred_uv_tm_sse2, + vp8_intra_pred_uv_ho_mmx2); } -void vp8_build_intra_predictors_mbuv_s_ssse3(MACROBLOCKD *x) -{ - vp8_build_intra_predictors_mbuv_x86(x, x->dst.u_buffer, - x->dst.v_buffer, x->dst.uv_stride, - vp8_intra_pred_uv_tm_ssse3, - vp8_intra_pred_uv_ho_ssse3); +void vp8_build_intra_predictors_mbuv_s_ssse3(MACROBLOCKD *x) { + vp8_build_intra_predictors_mbuv_x86(x, x->dst.u_buffer, + x->dst.v_buffer, x->dst.uv_stride, + vp8_intra_pred_uv_tm_ssse3, + vp8_intra_pred_uv_ho_ssse3); } diff --git a/vp8/common/x86/vp8_asm_stubs.c b/vp8/common/x86/vp8_asm_stubs.c index 458b3f638..4df4f808d 100644 --- a/vp8/common/x86/vp8_asm_stubs.c +++ b/vp8/common/x86/vp8_asm_stubs.c @@ -14,112 +14,112 @@ #include "vp8/common/subpixel.h" #if CONFIG_SIXTEENTH_SUBPEL_UV -extern const short vp8_six_tap_mmx[16][6*8]; -extern const short vp8_bilinear_filters_mmx[16][2*8]; +extern const short vp8_six_tap_mmx[16][6 * 8]; +extern const short vp8_bilinear_filters_mmx[16][2 * 8]; #else -extern const short vp8_six_tap_mmx[8][6*8]; -extern const short vp8_bilinear_filters_mmx[8][2*8]; +extern const short vp8_six_tap_mmx[8][6 * 8]; +extern const short vp8_bilinear_filters_mmx[8][2 * 8]; #endif -//#define ANNOUNCE_FUNCTION +// #define ANNOUNCE_FUNCTION extern void vp8_filter_block1d_h6_mmx ( - unsigned char *src_ptr, - unsigned short *output_ptr, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter + unsigned char *src_ptr, + unsigned short *output_ptr, + unsigned int src_pixels_per_line, + unsigned int pixel_step, + unsigned int output_height, + unsigned int output_width, + const short *vp8_filter ); extern void vp8_filter_block1dc_v6_mmx ( - unsigned short *src_ptr, - unsigned char *output_ptr, - int output_pitch, - unsigned int pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter + unsigned short *src_ptr, + unsigned char *output_ptr, + int output_pitch, + unsigned int pixels_per_line, + unsigned int pixel_step, + unsigned int output_height, + unsigned int output_width, + const short *vp8_filter ); extern void vp8_filter_block1d8_h6_sse2 ( - unsigned char *src_ptr, - unsigned short *output_ptr, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter + unsigned char *src_ptr, + unsigned short *output_ptr, + unsigned int src_pixels_per_line, + unsigned int pixel_step, + unsigned int output_height, + unsigned int output_width, + const short *vp8_filter ); extern void vp8_filter_block1d16_h6_sse2 ( - unsigned char *src_ptr, - unsigned short *output_ptr, - unsigned int src_pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter + unsigned char *src_ptr, + unsigned short *output_ptr, + unsigned int src_pixels_per_line, + unsigned int pixel_step, + unsigned int output_height, + unsigned int output_width, + const short *vp8_filter ); extern void vp8_filter_block1d8_v6_sse2 ( - unsigned short *src_ptr, - unsigned char *output_ptr, - int dst_ptich, - unsigned int pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter + unsigned short *src_ptr, + unsigned char *output_ptr, + int dst_ptich, + unsigned int pixels_per_line, + unsigned int pixel_step, + unsigned int output_height, + unsigned int output_width, + const short *vp8_filter ); extern void vp8_filter_block1d16_v6_sse2 ( - unsigned short *src_ptr, - unsigned char *output_ptr, - int dst_ptich, - unsigned int pixels_per_line, - unsigned int pixel_step, - unsigned int output_height, - unsigned int output_width, - const short *vp8_filter + unsigned short *src_ptr, + unsigned char *output_ptr, + int dst_ptich, + unsigned int pixels_per_line, + unsigned int pixel_step, + unsigned int output_height, + unsigned int output_width, + const short *vp8_filter ); extern void vp8_unpack_block1d16_h6_sse2 ( - unsigned char *src_ptr, - unsigned short *output_ptr, - unsigned int src_pixels_per_line, - unsigned int output_height, - unsigned int output_width + unsigned char *src_ptr, + unsigned short *output_ptr, + unsigned int src_pixels_per_line, + unsigned int output_height, + unsigned int output_width ); extern void vp8_filter_block1d8_h6_only_sse2 ( - unsigned char *src_ptr, - unsigned int src_pixels_per_line, - unsigned char *output_ptr, - int dst_ptich, - unsigned int output_height, - const short *vp8_filter + unsigned char *src_ptr, + unsigned int src_pixels_per_line, + unsigned char *output_ptr, + int dst_ptich, + unsigned int output_height, + const short *vp8_filter ); extern void vp8_filter_block1d16_h6_only_sse2 ( - unsigned char *src_ptr, - unsigned int src_pixels_per_line, - unsigned char *output_ptr, - int dst_ptich, - unsigned int output_height, - const short *vp8_filter + unsigned char *src_ptr, + unsigned int src_pixels_per_line, + unsigned char *output_ptr, + int dst_ptich, + unsigned int output_height, + const short *vp8_filter ); extern void vp8_filter_block1d8_v6_only_sse2 ( - unsigned char *src_ptr, - unsigned int src_pixels_per_line, - unsigned char *output_ptr, - int dst_ptich, - unsigned int output_height, - const short *vp8_filter + unsigned char *src_ptr, + unsigned int src_pixels_per_line, + unsigned char *output_ptr, + int dst_ptich, + unsigned int output_height, + const short *vp8_filter ); extern prototype_subpixel_predict(vp8_bilinear_predict8x8_mmx); @@ -127,115 +127,111 @@ extern prototype_subpixel_predict(vp8_bilinear_predict8x8_mmx); #if HAVE_MMX void vp8_sixtap_predict4x4_mmx ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { #ifdef ANNOUNCE_FUNCTION - printf("vp8_sixtap_predict4x4_mmx\n"); + printf("vp8_sixtap_predict4x4_mmx\n"); #endif - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 16*16); /* Temp data bufffer used in filtering */ - const short *HFilter, *VFilter; - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 9, 8, HFilter); - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1dc_v6_mmx(FData2 + 8, dst_ptr, dst_pitch, 8, 4 , 4, 4, VFilter); + DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 16 * 16); /* Temp data bufffer used in filtering */ + const short *HFilter, *VFilter; + HFilter = vp8_six_tap_mmx[xoffset]; + vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 9, 8, HFilter); + VFilter = vp8_six_tap_mmx[yoffset]; + vp8_filter_block1dc_v6_mmx(FData2 + 8, dst_ptr, dst_pitch, 8, 4, 4, 4, VFilter); } void vp8_sixtap_predict16x16_mmx ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { #ifdef ANNOUNCE_FUNCTION - printf("vp8_sixtap_predict16x16_mmx\n"); + printf("vp8_sixtap_predict16x16_mmx\n"); #endif - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 24*24); /* Temp data bufffer used in filtering */ + DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 24 * 24); /* Temp data bufffer used in filtering */ - const short *HFilter, *VFilter; + const short *HFilter, *VFilter; - HFilter = vp8_six_tap_mmx[xoffset]; + HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 21, 32, HFilter); - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line) + 4, FData2 + 4, src_pixels_per_line, 1, 21, 32, HFilter); - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line) + 8, FData2 + 8, src_pixels_per_line, 1, 21, 32, HFilter); - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line) + 12, FData2 + 12, src_pixels_per_line, 1, 21, 32, HFilter); + vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 21, 32, HFilter); + vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line) + 4, FData2 + 4, src_pixels_per_line, 1, 21, 32, HFilter); + vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line) + 8, FData2 + 8, src_pixels_per_line, 1, 21, 32, HFilter); + vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line) + 12, FData2 + 12, src_pixels_per_line, 1, 21, 32, HFilter); - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1dc_v6_mmx(FData2 + 32, dst_ptr, dst_pitch, 32, 16 , 16, 16, VFilter); - vp8_filter_block1dc_v6_mmx(FData2 + 36, dst_ptr + 4, dst_pitch, 32, 16 , 16, 16, VFilter); - vp8_filter_block1dc_v6_mmx(FData2 + 40, dst_ptr + 8, dst_pitch, 32, 16 , 16, 16, VFilter); - vp8_filter_block1dc_v6_mmx(FData2 + 44, dst_ptr + 12, dst_pitch, 32, 16 , 16, 16, VFilter); + VFilter = vp8_six_tap_mmx[yoffset]; + vp8_filter_block1dc_v6_mmx(FData2 + 32, dst_ptr, dst_pitch, 32, 16, 16, 16, VFilter); + vp8_filter_block1dc_v6_mmx(FData2 + 36, dst_ptr + 4, dst_pitch, 32, 16, 16, 16, VFilter); + vp8_filter_block1dc_v6_mmx(FData2 + 40, dst_ptr + 8, dst_pitch, 32, 16, 16, 16, VFilter); + vp8_filter_block1dc_v6_mmx(FData2 + 44, dst_ptr + 12, dst_pitch, 32, 16, 16, 16, VFilter); } void vp8_sixtap_predict8x8_mmx ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { #ifdef ANNOUNCE_FUNCTION - printf("vp8_sixtap_predict8x8_mmx\n"); + printf("vp8_sixtap_predict8x8_mmx\n"); #endif - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256); /* Temp data bufffer used in filtering */ + DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256); /* Temp data bufffer used in filtering */ - const short *HFilter, *VFilter; + const short *HFilter, *VFilter; - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 13, 16, HFilter); - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line) + 4, FData2 + 4, src_pixels_per_line, 1, 13, 16, HFilter); + HFilter = vp8_six_tap_mmx[xoffset]; + vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 13, 16, HFilter); + vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line) + 4, FData2 + 4, src_pixels_per_line, 1, 13, 16, HFilter); - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1dc_v6_mmx(FData2 + 16, dst_ptr, dst_pitch, 16, 8 , 8, 8, VFilter); - vp8_filter_block1dc_v6_mmx(FData2 + 20, dst_ptr + 4, dst_pitch, 16, 8 , 8, 8, VFilter); + VFilter = vp8_six_tap_mmx[yoffset]; + vp8_filter_block1dc_v6_mmx(FData2 + 16, dst_ptr, dst_pitch, 16, 8, 8, 8, VFilter); + vp8_filter_block1dc_v6_mmx(FData2 + 20, dst_ptr + 4, dst_pitch, 16, 8, 8, 8, VFilter); } void vp8_sixtap_predict8x4_mmx ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { #ifdef ANNOUNCE_FUNCTION - printf("vp8_sixtap_predict8x4_mmx\n"); + printf("vp8_sixtap_predict8x4_mmx\n"); #endif - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256); /* Temp data bufffer used in filtering */ + DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256); /* Temp data bufffer used in filtering */ - const short *HFilter, *VFilter; + const short *HFilter, *VFilter; - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 9, 16, HFilter); - vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line) + 4, FData2 + 4, src_pixels_per_line, 1, 9, 16, HFilter); + HFilter = vp8_six_tap_mmx[xoffset]; + vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 9, 16, HFilter); + vp8_filter_block1d_h6_mmx(src_ptr - (2 * src_pixels_per_line) + 4, FData2 + 4, src_pixels_per_line, 1, 9, 16, HFilter); - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1dc_v6_mmx(FData2 + 16, dst_ptr, dst_pitch, 16, 8 , 4, 8, VFilter); - vp8_filter_block1dc_v6_mmx(FData2 + 20, dst_ptr + 4, dst_pitch, 16, 8 , 4, 8, VFilter); + VFilter = vp8_six_tap_mmx[yoffset]; + vp8_filter_block1dc_v6_mmx(FData2 + 16, dst_ptr, dst_pitch, 16, 8, 4, 8, VFilter); + vp8_filter_block1dc_v6_mmx(FData2 + 20, dst_ptr + 4, dst_pitch, 16, 8, 4, 8, VFilter); } @@ -243,18 +239,17 @@ void vp8_sixtap_predict8x4_mmx void vp8_bilinear_predict16x16_mmx ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - vp8_bilinear_predict8x8_mmx(src_ptr, src_pixels_per_line, xoffset, yoffset, dst_ptr, dst_pitch); - vp8_bilinear_predict8x8_mmx(src_ptr + 8, src_pixels_per_line, xoffset, yoffset, dst_ptr + 8, dst_pitch); - vp8_bilinear_predict8x8_mmx(src_ptr + 8 * src_pixels_per_line, src_pixels_per_line, xoffset, yoffset, dst_ptr + dst_pitch * 8, dst_pitch); - vp8_bilinear_predict8x8_mmx(src_ptr + 8 * src_pixels_per_line + 8, src_pixels_per_line, xoffset, yoffset, dst_ptr + dst_pitch * 8 + 8, dst_pitch); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + vp8_bilinear_predict8x8_mmx(src_ptr, src_pixels_per_line, xoffset, yoffset, dst_ptr, dst_pitch); + vp8_bilinear_predict8x8_mmx(src_ptr + 8, src_pixels_per_line, xoffset, yoffset, dst_ptr + 8, dst_pitch); + vp8_bilinear_predict8x8_mmx(src_ptr + 8 * src_pixels_per_line, src_pixels_per_line, xoffset, yoffset, dst_ptr + dst_pitch * 8, dst_pitch); + vp8_bilinear_predict8x8_mmx(src_ptr + 8 * src_pixels_per_line + 8, src_pixels_per_line, xoffset, yoffset, dst_ptr + dst_pitch * 8 + 8, dst_pitch); } #endif @@ -262,127 +257,106 @@ void vp8_bilinear_predict16x16_mmx #if HAVE_SSE2 void vp8_sixtap_predict16x16_sse2 ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch - -) -{ - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 24*24); /* Temp data bufffer used in filtering */ - - const short *HFilter, *VFilter; + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch + +) { + DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 24 * 24); /* Temp data bufffer used in filtering */ + + const short *HFilter, *VFilter; #ifdef ANNOUNCE_FUNCTION - printf("vp8_sixtap_predict16x16_sse2\n"); + printf("vp8_sixtap_predict16x16_sse2\n"); #endif - if (xoffset) - { - if (yoffset) - { - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d16_h6_sse2(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 21, 32, HFilter); - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1d16_v6_sse2(FData2 + 32, dst_ptr, dst_pitch, 32, 16 , 16, dst_pitch, VFilter); - } - else - { - /* First-pass only */ - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d16_h6_only_sse2(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 16, HFilter); - } - } - else - { - /* Second-pass only */ - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_unpack_block1d16_h6_sse2(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 21, 32); - vp8_filter_block1d16_v6_sse2(FData2 + 32, dst_ptr, dst_pitch, 32, 16 , 16, dst_pitch, VFilter); + if (xoffset) { + if (yoffset) { + HFilter = vp8_six_tap_mmx[xoffset]; + vp8_filter_block1d16_h6_sse2(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 21, 32, HFilter); + VFilter = vp8_six_tap_mmx[yoffset]; + vp8_filter_block1d16_v6_sse2(FData2 + 32, dst_ptr, dst_pitch, 32, 16, 16, dst_pitch, VFilter); + } else { + /* First-pass only */ + HFilter = vp8_six_tap_mmx[xoffset]; + vp8_filter_block1d16_h6_only_sse2(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 16, HFilter); } + } else { + /* Second-pass only */ + VFilter = vp8_six_tap_mmx[yoffset]; + vp8_unpack_block1d16_h6_sse2(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 21, 32); + vp8_filter_block1d16_v6_sse2(FData2 + 32, dst_ptr, dst_pitch, 32, 16, 16, dst_pitch, VFilter); + } } void vp8_sixtap_predict8x8_sse2 ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256); /* Temp data bufffer used in filtering */ - const short *HFilter, *VFilter; + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256); /* Temp data bufffer used in filtering */ + const short *HFilter, *VFilter; #ifdef ANNOUNCE_FUNCTION - printf("vp8_sixtap_predict8x8_sse2\n"); + printf("vp8_sixtap_predict8x8_sse2\n"); #endif - if (xoffset) - { - if (yoffset) - { - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d8_h6_sse2(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 13, 16, HFilter); - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1d8_v6_sse2(FData2 + 16, dst_ptr, dst_pitch, 16, 8 , 8, dst_pitch, VFilter); - } - else - { - /* First-pass only */ - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d8_h6_only_sse2(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 8, HFilter); - } - } - else - { - /* Second-pass only */ - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1d8_v6_only_sse2(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 8, VFilter); + if (xoffset) { + if (yoffset) { + HFilter = vp8_six_tap_mmx[xoffset]; + vp8_filter_block1d8_h6_sse2(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 13, 16, HFilter); + VFilter = vp8_six_tap_mmx[yoffset]; + vp8_filter_block1d8_v6_sse2(FData2 + 16, dst_ptr, dst_pitch, 16, 8, 8, dst_pitch, VFilter); + } else { + /* First-pass only */ + HFilter = vp8_six_tap_mmx[xoffset]; + vp8_filter_block1d8_h6_only_sse2(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 8, HFilter); } + } else { + /* Second-pass only */ + VFilter = vp8_six_tap_mmx[yoffset]; + vp8_filter_block1d8_v6_only_sse2(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 8, VFilter); + } } void vp8_sixtap_predict8x4_sse2 ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256); /* Temp data bufffer used in filtering */ - const short *HFilter, *VFilter; + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + DECLARE_ALIGNED_ARRAY(16, unsigned short, FData2, 256); /* Temp data bufffer used in filtering */ + const short *HFilter, *VFilter; #ifdef ANNOUNCE_FUNCTION - printf("vp8_sixtap_predict8x4_sse2\n"); + printf("vp8_sixtap_predict8x4_sse2\n"); #endif - if (xoffset) - { - if (yoffset) - { - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d8_h6_sse2(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 9, 16, HFilter); - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1d8_v6_sse2(FData2 + 16, dst_ptr, dst_pitch, 16, 8 , 4, dst_pitch, VFilter); - } - else - { - /* First-pass only */ - HFilter = vp8_six_tap_mmx[xoffset]; - vp8_filter_block1d8_h6_only_sse2(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 4, HFilter); - } - } - else - { - /* Second-pass only */ - VFilter = vp8_six_tap_mmx[yoffset]; - vp8_filter_block1d8_v6_only_sse2(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 4, VFilter); + if (xoffset) { + if (yoffset) { + HFilter = vp8_six_tap_mmx[xoffset]; + vp8_filter_block1d8_h6_sse2(src_ptr - (2 * src_pixels_per_line), FData2, src_pixels_per_line, 1, 9, 16, HFilter); + VFilter = vp8_six_tap_mmx[yoffset]; + vp8_filter_block1d8_v6_sse2(FData2 + 16, dst_ptr, dst_pitch, 16, 8, 4, dst_pitch, VFilter); + } else { + /* First-pass only */ + HFilter = vp8_six_tap_mmx[xoffset]; + vp8_filter_block1d8_h6_only_sse2(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 4, HFilter); } + } else { + /* Second-pass only */ + VFilter = vp8_six_tap_mmx[yoffset]; + vp8_filter_block1d8_v6_only_sse2(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 4, VFilter); + } } #endif @@ -391,200 +365,172 @@ void vp8_sixtap_predict8x4_sse2 extern void vp8_filter_block1d8_h6_ssse3 ( - unsigned char *src_ptr, - unsigned int src_pixels_per_line, - unsigned char *output_ptr, - unsigned int output_pitch, - unsigned int output_height, - unsigned int vp8_filter_index + unsigned char *src_ptr, + unsigned int src_pixels_per_line, + unsigned char *output_ptr, + unsigned int output_pitch, + unsigned int output_height, + unsigned int vp8_filter_index ); extern void vp8_filter_block1d16_h6_ssse3 ( - unsigned char *src_ptr, - unsigned int src_pixels_per_line, - unsigned char *output_ptr, - unsigned int output_pitch, - unsigned int output_height, - unsigned int vp8_filter_index + unsigned char *src_ptr, + unsigned int src_pixels_per_line, + unsigned char *output_ptr, + unsigned int output_pitch, + unsigned int output_height, + unsigned int vp8_filter_index ); extern void vp8_filter_block1d16_v6_ssse3 ( - unsigned char *src_ptr, - unsigned int src_pitch, - unsigned char *output_ptr, - unsigned int out_pitch, - unsigned int output_height, - unsigned int vp8_filter_index + unsigned char *src_ptr, + unsigned int src_pitch, + unsigned char *output_ptr, + unsigned int out_pitch, + unsigned int output_height, + unsigned int vp8_filter_index ); extern void vp8_filter_block1d8_v6_ssse3 ( - unsigned char *src_ptr, - unsigned int src_pitch, - unsigned char *output_ptr, - unsigned int out_pitch, - unsigned int output_height, - unsigned int vp8_filter_index + unsigned char *src_ptr, + unsigned int src_pitch, + unsigned char *output_ptr, + unsigned int out_pitch, + unsigned int output_height, + unsigned int vp8_filter_index ); extern void vp8_filter_block1d4_h6_ssse3 ( - unsigned char *src_ptr, - unsigned int src_pixels_per_line, - unsigned char *output_ptr, - unsigned int output_pitch, - unsigned int output_height, - unsigned int vp8_filter_index + unsigned char *src_ptr, + unsigned int src_pixels_per_line, + unsigned char *output_ptr, + unsigned int output_pitch, + unsigned int output_height, + unsigned int vp8_filter_index ); extern void vp8_filter_block1d4_v6_ssse3 ( - unsigned char *src_ptr, - unsigned int src_pitch, - unsigned char *output_ptr, - unsigned int out_pitch, - unsigned int output_height, - unsigned int vp8_filter_index + unsigned char *src_ptr, + unsigned int src_pitch, + unsigned char *output_ptr, + unsigned int out_pitch, + unsigned int output_height, + unsigned int vp8_filter_index ); void vp8_sixtap_predict16x16_ssse3 ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch - -) -{ - DECLARE_ALIGNED_ARRAY(16, unsigned char, FData2, 24*24); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch + +) { + DECLARE_ALIGNED_ARRAY(16, unsigned char, FData2, 24 * 24); #ifdef ANNOUNCE_FUNCTION - printf("vp8_sixtap_predict16x16_ssse3\n"); + printf("vp8_sixtap_predict16x16_ssse3\n"); #endif - if (xoffset) - { - if (yoffset) - { - vp8_filter_block1d16_h6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, FData2, 16, 21, xoffset); - vp8_filter_block1d16_v6_ssse3(FData2 , 16, dst_ptr, dst_pitch, 16, yoffset); - } - else - { - /* First-pass only */ - vp8_filter_block1d16_h6_ssse3(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 16, xoffset); - } - } - else - { - /* Second-pass only */ - vp8_filter_block1d16_v6_ssse3(src_ptr - (2 * src_pixels_per_line) , src_pixels_per_line, dst_ptr, dst_pitch, 16, yoffset); + if (xoffset) { + if (yoffset) { + vp8_filter_block1d16_h6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, FData2, 16, 21, xoffset); + vp8_filter_block1d16_v6_ssse3(FData2, 16, dst_ptr, dst_pitch, 16, yoffset); + } else { + /* First-pass only */ + vp8_filter_block1d16_h6_ssse3(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 16, xoffset); } + } else { + /* Second-pass only */ + vp8_filter_block1d16_v6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 16, yoffset); + } } void vp8_sixtap_predict8x8_ssse3 ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - DECLARE_ALIGNED_ARRAY(16, unsigned char, FData2, 256); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + DECLARE_ALIGNED_ARRAY(16, unsigned char, FData2, 256); #ifdef ANNOUNCE_FUNCTION - printf("vp8_sixtap_predict8x8_ssse3\n"); + printf("vp8_sixtap_predict8x8_ssse3\n"); #endif - if (xoffset) - { - if (yoffset) - { - vp8_filter_block1d8_h6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, FData2, 8, 13, xoffset); - vp8_filter_block1d8_v6_ssse3(FData2, 8, dst_ptr, dst_pitch, 8, yoffset); - } - else - { - vp8_filter_block1d8_h6_ssse3(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 8, xoffset); - } - } - else - { - /* Second-pass only */ - vp8_filter_block1d8_v6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 8, yoffset); + if (xoffset) { + if (yoffset) { + vp8_filter_block1d8_h6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, FData2, 8, 13, xoffset); + vp8_filter_block1d8_v6_ssse3(FData2, 8, dst_ptr, dst_pitch, 8, yoffset); + } else { + vp8_filter_block1d8_h6_ssse3(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 8, xoffset); } + } else { + /* Second-pass only */ + vp8_filter_block1d8_v6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 8, yoffset); + } } void vp8_sixtap_predict8x4_ssse3 ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - DECLARE_ALIGNED_ARRAY(16, unsigned char, FData2, 256); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + DECLARE_ALIGNED_ARRAY(16, unsigned char, FData2, 256); #ifdef ANNOUNCE_FUNCTION - printf("vp8_sixtap_predict8x4_ssse3\n"); + printf("vp8_sixtap_predict8x4_ssse3\n"); #endif - if (xoffset) - { - if (yoffset) - { - vp8_filter_block1d8_h6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, FData2, 8, 9, xoffset); - vp8_filter_block1d8_v6_ssse3(FData2, 8, dst_ptr, dst_pitch, 4, yoffset); - } - else - { - /* First-pass only */ - vp8_filter_block1d8_h6_ssse3(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 4, xoffset); - } - } - else - { - /* Second-pass only */ - vp8_filter_block1d8_v6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 4, yoffset); + if (xoffset) { + if (yoffset) { + vp8_filter_block1d8_h6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, FData2, 8, 9, xoffset); + vp8_filter_block1d8_v6_ssse3(FData2, 8, dst_ptr, dst_pitch, 4, yoffset); + } else { + /* First-pass only */ + vp8_filter_block1d8_h6_ssse3(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 4, xoffset); } + } else { + /* Second-pass only */ + vp8_filter_block1d8_v6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 4, yoffset); + } } void vp8_sixtap_predict4x4_ssse3 ( - unsigned char *src_ptr, - int src_pixels_per_line, - int xoffset, - int yoffset, - unsigned char *dst_ptr, - int dst_pitch -) -{ - DECLARE_ALIGNED_ARRAY(16, unsigned char, FData2, 4*9); + unsigned char *src_ptr, + int src_pixels_per_line, + int xoffset, + int yoffset, + unsigned char *dst_ptr, + int dst_pitch +) { + DECLARE_ALIGNED_ARRAY(16, unsigned char, FData2, 4 * 9); #ifdef ANNOUNCE_FUNCTION - printf("vp8_sixtap_predict4x4_ssse3\n"); + printf("vp8_sixtap_predict4x4_ssse3\n"); #endif - if (xoffset) - { - if (yoffset) - { - vp8_filter_block1d4_h6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, FData2, 4, 9, xoffset); - vp8_filter_block1d4_v6_ssse3(FData2, 4, dst_ptr, dst_pitch, 4, yoffset); - } - else - { - vp8_filter_block1d4_h6_ssse3(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 4, xoffset); - } - } - else - { - vp8_filter_block1d4_v6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 4, yoffset); + if (xoffset) { + if (yoffset) { + vp8_filter_block1d4_h6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, FData2, 4, 9, xoffset); + vp8_filter_block1d4_v6_ssse3(FData2, 4, dst_ptr, dst_pitch, 4, yoffset); + } else { + vp8_filter_block1d4_h6_ssse3(src_ptr, src_pixels_per_line, dst_ptr, dst_pitch, 4, xoffset); + } + } else { + vp8_filter_block1d4_v6_ssse3(src_ptr - (2 * src_pixels_per_line), src_pixels_per_line, dst_ptr, dst_pitch, 4, yoffset); } } diff --git a/vp8/common/x86/x86_systemdependent.c b/vp8/common/x86/x86_systemdependent.c index fae8632a8..7bce3ca34 100644 --- a/vp8/common/x86/x86_systemdependent.c +++ b/vp8/common/x86/x86_systemdependent.c @@ -19,127 +19,123 @@ #include "vp8/common/pragmas.h" #include "vp8/common/onyxc_int.h" -void vp8_arch_x86_common_init(VP8_COMMON *ctx) -{ +void vp8_arch_x86_common_init(VP8_COMMON *ctx) { #if CONFIG_RUNTIME_CPU_DETECT - VP8_COMMON_RTCD *rtcd = &ctx->rtcd; - int flags = x86_simd_caps(); + VP8_COMMON_RTCD *rtcd = &ctx->rtcd; + int flags = x86_simd_caps(); - /* Note: - * - * This platform can be built without runtime CPU detection as well. If - * you modify any of the function mappings present in this file, be sure - * to also update them in static mapings (<arch>/filename_<arch>.h) - */ + /* Note: + * + * This platform can be built without runtime CPU detection as well. If + * you modify any of the function mappings present in this file, be sure + * to also update them in static mapings (<arch>/filename_<arch>.h) + */ - /* Override default functions with fastest ones for this CPU. */ + /* Override default functions with fastest ones for this CPU. */ #if HAVE_MMX // The commented functions need to be re-written for vpx. - if (flags & HAS_MMX) - { - rtcd->idct.idct1 = vpx_short_idct4x4llm_1_mmx; - rtcd->idct.idct16 = vpx_short_idct4x4llm_mmx; - rtcd->idct.idct1_scalar_add = vpx_dc_only_idct_add_mmx; - //rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_mmx; - //rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_mmx; - - rtcd->recon.recon = vp8_recon_b_mmx; - rtcd->recon.copy8x8 = vp8_copy_mem8x8_mmx; - rtcd->recon.copy8x4 = vp8_copy_mem8x4_mmx; - rtcd->recon.copy16x16 = vp8_copy_mem16x16_mmx; + if (flags & HAS_MMX) { + rtcd->idct.idct1 = vpx_short_idct4x4llm_1_mmx; + rtcd->idct.idct16 = vpx_short_idct4x4llm_mmx; + rtcd->idct.idct1_scalar_add = vpx_dc_only_idct_add_mmx; + // rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_mmx; + // rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_mmx; + + rtcd->recon.recon = vp8_recon_b_mmx; + rtcd->recon.copy8x8 = vp8_copy_mem8x8_mmx; + rtcd->recon.copy8x4 = vp8_copy_mem8x4_mmx; + rtcd->recon.copy16x16 = vp8_copy_mem16x16_mmx; #if CONFIG_ENHANCED_INTERP == 0 && CONFIG_HIGH_PRECISION_MV == 0 && CONFIG_SIXTEENTH_SUBPEL_UV == 0 - rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_mmx; - rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_mmx; - rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_mmx; - rtcd->subpix.sixtap4x4 = vp8_sixtap_predict4x4_mmx; + rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_mmx; + rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_mmx; + rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_mmx; + rtcd->subpix.sixtap4x4 = vp8_sixtap_predict4x4_mmx; #endif - rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_mmx; - rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_mmx; - rtcd->subpix.bilinear8x4 = vp8_bilinear_predict8x4_mmx; - rtcd->subpix.bilinear4x4 = vp8_bilinear_predict4x4_mmx; - - rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_mmx; - rtcd->loopfilter.normal_b_v = vp8_loop_filter_bv_mmx; - rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_mmx; - rtcd->loopfilter.normal_b_h = vp8_loop_filter_bh_mmx; - rtcd->loopfilter.simple_mb_v = vp8_loop_filter_simple_vertical_edge_mmx; - rtcd->loopfilter.simple_b_v = vp8_loop_filter_bvs_mmx; - rtcd->loopfilter.simple_mb_h = vp8_loop_filter_simple_horizontal_edge_mmx; - rtcd->loopfilter.simple_b_h = vp8_loop_filter_bhs_mmx; + rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_mmx; + rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_mmx; + rtcd->subpix.bilinear8x4 = vp8_bilinear_predict8x4_mmx; + rtcd->subpix.bilinear4x4 = vp8_bilinear_predict4x4_mmx; + + rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_mmx; + rtcd->loopfilter.normal_b_v = vp8_loop_filter_bv_mmx; + rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_mmx; + rtcd->loopfilter.normal_b_h = vp8_loop_filter_bh_mmx; + rtcd->loopfilter.simple_mb_v = vp8_loop_filter_simple_vertical_edge_mmx; + rtcd->loopfilter.simple_b_v = vp8_loop_filter_bvs_mmx; + rtcd->loopfilter.simple_mb_h = vp8_loop_filter_simple_horizontal_edge_mmx; + rtcd->loopfilter.simple_b_h = vp8_loop_filter_bhs_mmx; #if CONFIG_POSTPROC - rtcd->postproc.down = vp8_mbpost_proc_down_mmx; - /*rtcd->postproc.across = vp8_mbpost_proc_across_ip_c;*/ - rtcd->postproc.downacross = vp8_post_proc_down_and_across_mmx; - rtcd->postproc.addnoise = vp8_plane_add_noise_mmx; + rtcd->postproc.down = vp8_mbpost_proc_down_mmx; + /*rtcd->postproc.across = vp8_mbpost_proc_across_ip_c;*/ + rtcd->postproc.downacross = vp8_post_proc_down_and_across_mmx; + rtcd->postproc.addnoise = vp8_plane_add_noise_mmx; #endif - } + } #endif #if HAVE_SSE2 - if (flags & HAS_SSE2) - { - rtcd->recon.recon2 = vp8_recon2b_sse2; - rtcd->recon.recon4 = vp8_recon4b_sse2; - rtcd->recon.copy16x16 = vp8_copy_mem16x16_sse2; + if (flags & HAS_SSE2) { + rtcd->recon.recon2 = vp8_recon2b_sse2; + rtcd->recon.recon4 = vp8_recon4b_sse2; + rtcd->recon.copy16x16 = vp8_copy_mem16x16_sse2; #if CONFIG_NEWINTRAMODES == 0 - rtcd->recon.build_intra_predictors_mbuv = - vp8_build_intra_predictors_mbuv_sse2; - rtcd->recon.build_intra_predictors_mbuv_s = - vp8_build_intra_predictors_mbuv_s_sse2; + rtcd->recon.build_intra_predictors_mbuv = + vp8_build_intra_predictors_mbuv_sse2; + rtcd->recon.build_intra_predictors_mbuv_s = + vp8_build_intra_predictors_mbuv_s_sse2; #endif - //rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_sse2; + // rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_sse2; #if CONFIG_ENHANCED_INTERP == 0 && CONFIG_HIGH_PRECISION_MV == 0 && CONFIG_SIXTEENTH_SUBPEL_UV == 0 - rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_sse2; - rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_sse2; - rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_sse2; + rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_sse2; + rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_sse2; + rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_sse2; #endif - rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_sse2; - rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_sse2; - - rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_sse2; - rtcd->loopfilter.normal_b_v = vp8_loop_filter_bv_sse2; - rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_sse2; - rtcd->loopfilter.normal_b_h = vp8_loop_filter_bh_sse2; - rtcd->loopfilter.simple_mb_v = vp8_loop_filter_simple_vertical_edge_sse2; - rtcd->loopfilter.simple_b_v = vp8_loop_filter_bvs_sse2; - rtcd->loopfilter.simple_mb_h = vp8_loop_filter_simple_horizontal_edge_sse2; - rtcd->loopfilter.simple_b_h = vp8_loop_filter_bhs_sse2; + rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_sse2; + rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_sse2; + + rtcd->loopfilter.normal_mb_v = vp8_loop_filter_mbv_sse2; + rtcd->loopfilter.normal_b_v = vp8_loop_filter_bv_sse2; + rtcd->loopfilter.normal_mb_h = vp8_loop_filter_mbh_sse2; + rtcd->loopfilter.normal_b_h = vp8_loop_filter_bh_sse2; + rtcd->loopfilter.simple_mb_v = vp8_loop_filter_simple_vertical_edge_sse2; + rtcd->loopfilter.simple_b_v = vp8_loop_filter_bvs_sse2; + rtcd->loopfilter.simple_mb_h = vp8_loop_filter_simple_horizontal_edge_sse2; + rtcd->loopfilter.simple_b_h = vp8_loop_filter_bhs_sse2; #if CONFIG_POSTPROC - rtcd->postproc.down = vp8_mbpost_proc_down_xmm; - rtcd->postproc.across = vp8_mbpost_proc_across_ip_xmm; - rtcd->postproc.downacross = vp8_post_proc_down_and_across_xmm; - rtcd->postproc.addnoise = vp8_plane_add_noise_wmt; + rtcd->postproc.down = vp8_mbpost_proc_down_xmm; + rtcd->postproc.across = vp8_mbpost_proc_across_ip_xmm; + rtcd->postproc.downacross = vp8_post_proc_down_and_across_xmm; + rtcd->postproc.addnoise = vp8_plane_add_noise_wmt; #endif - } + } #endif #if HAVE_SSSE3 - if (flags & HAS_SSSE3) - { + if (flags & HAS_SSSE3) { #if CONFIG_ENHANCED_INTERP == 0 && CONFIG_HIGH_PRECISION_MV == 0 && CONFIG_SIXTEENTH_SUBPEL_UV == 0 - rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_ssse3; - rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_ssse3; - rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_ssse3; - rtcd->subpix.sixtap4x4 = vp8_sixtap_predict4x4_ssse3; - rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_ssse3; - rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_ssse3; + rtcd->subpix.sixtap16x16 = vp8_sixtap_predict16x16_ssse3; + rtcd->subpix.sixtap8x8 = vp8_sixtap_predict8x8_ssse3; + rtcd->subpix.sixtap8x4 = vp8_sixtap_predict8x4_ssse3; + rtcd->subpix.sixtap4x4 = vp8_sixtap_predict4x4_ssse3; + rtcd->subpix.bilinear16x16 = vp8_bilinear_predict16x16_ssse3; + rtcd->subpix.bilinear8x8 = vp8_bilinear_predict8x8_ssse3; #endif #if CONFIG_NEWINTRAMODES == 0 - rtcd->recon.build_intra_predictors_mbuv = - vp8_build_intra_predictors_mbuv_ssse3; - rtcd->recon.build_intra_predictors_mbuv_s = - vp8_build_intra_predictors_mbuv_s_ssse3; + rtcd->recon.build_intra_predictors_mbuv = + vp8_build_intra_predictors_mbuv_ssse3; + rtcd->recon.build_intra_predictors_mbuv_s = + vp8_build_intra_predictors_mbuv_s_ssse3; #endif - } + } #endif #endif |