[x264-devel] [PATCH 20/32] Generate a header listing every symbol that needs to be duplicated
Vittorio Giovara
vittorio.giovara at gmail.com
Fri Jan 20 15:20:45 CET 2017
Function signature corresponds to x264_$BITDEPTH_funcname and it used to
simplify duplication of asm code.
undef as needed in rdo.c.
---
.gitignore | 1 +
Makefile | 4 +
encoder/rdo.c | 2 +
tools/api.list | 446 +++++++++++++++++++++++++++++++++++++++++++++++++++++
tools/duplicate.sh | 15 ++
5 files changed, 468 insertions(+)
create mode 100644 tools/api.list
create mode 100755 tools/duplicate.sh
diff --git a/.gitignore b/.gitignore
index 174458b..5476ace 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,5 +45,6 @@ checkasm
.digress_x264
dataDec.txt
log.dec
+common/bitdepth.h
common/oclobj.h
x264_lookahead.clbin
diff --git a/Makefile b/Makefile
index e704008..1475877 100644
--- a/Makefile
+++ b/Makefile
@@ -174,6 +174,10 @@ GENERATED += common/oclobj.h
SRCS += common/opencl.c encoder/slicetype-cl.c
endif
+common/bitdepth.h: $(SRCPATH)/tools/duplicate.sh $(SRCPATH)/tools/api.list
+ $(SRCPATH)/tools/duplicate.sh $(SRCPATH)/tools/api.list > $@
+GENERATED += common/bitdepth.h
+
OBJS += $(SRCS:%.c=%.o)
OBJCLI += $(SRCCLI:%.c=%.o)
OBJSO += $(SRCSO:%.c=%.o)
diff --git a/encoder/rdo.c b/encoder/rdo.c
index 2aab136..7b5fabe 100644
--- a/encoder/rdo.c
+++ b/encoder/rdo.c
@@ -55,6 +55,8 @@ static uint16_t cabac_size_5ones[128];
#undef x264_cabac_encode_decision_noup
#undef x264_cabac_encode_bypass
#undef x264_cabac_encode_terminal
+#undef x264_cabac_encode_ue_bypass
+#undef x264_macroblock_write_cabac
#define x264_cabac_encode_decision(c,x,v) x264_cabac_size_decision(c,x,v)
#define x264_cabac_encode_decision_noup(c,x,v) x264_cabac_size_decision_noup(c,x,v)
#define x264_cabac_encode_terminal(c) ((c)->f8_bits_encoded += 7)
diff --git a/tools/api.list b/tools/api.list
new file mode 100644
index 0000000..76c7303
--- /dev/null
+++ b/tools/api.list
@@ -0,0 +1,446 @@
+ac_energy_mb
+adaptive_quant_frame
+analyse_bi_chroma
+analyse_free_costs
+analyse_init_costs
+analyse_update_cache
+analyse_weight_frame
+bitstream_backup
+bitstream_check_buffer
+bitstream_check_buffer_filler
+bitstream_check_buffer_internal
+bitstream_init
+bitstream_restore
+cabac_8x8_mvd
+cabac_block_residual
+cabac_block_residual_422_dc
+cabac_block_residual_8x8_rd_c
+cabac_block_residual_c
+cabac_block_residual_internal
+cabac_block_residual_rd_c
+cabac_cbf_ctxidxinc
+cabac_cbp_chroma
+cabac_cbp_luma
+cabac_context_init
+cabac_encode_bypass_c
+cabac_encode_decision_c
+cabac_encode_flush
+cabac_encode_init
+cabac_encode_init_core
+cabac_encode_renorm
+cabac_encode_terminal_c
+cabac_encode_ue_bypass
+cabac_entropy
+cabac_field_decoding_flag
+cabac_init
+cabac_intra4x4_pred_mode
+cabac_intra_chroma_pred_mode
+cabac_mb_header_b
+cabac_mb_header_i
+cabac_mb_header_p
+cabac_mb_skip
+cabac_mb_type_intra
+cabac_mvd_cpn
+cabac_putbyte
+cabac_qp_delta
+cabac_range_lps
+cabac_ref_b
+cabac_ref_internal
+cabac_ref_p
+cabac_renorm_shift
+cabac_size_unary
+cabac_subpartition_b
+cabac_subpartition_p
+cabac_transform_size
+cabac_transition
+cabac_transition_unary
+cache_mv_func_table
+cache_mvd_func_table
+cache_ref_func_table
+cavlc_8x8_mvd
+cavlc_block_residual_escape
+cavlc_block_residual_internal
+cavlc_init
+cavlc_intra4x4_pred_size
+cavlc_macroblock_luma_residual
+cavlc_mb_header_b
+cavlc_mb_header_i
+cavlc_mb_header_p
+cavlc_mvd
+cavlc_partition_luma_residual
+cavlc_qp_delta
+check_encapsulated_buffer
+chroma_size_cabac
+chroma_size_cavlc
+coeff0_token
+coeff_abs_level_m1_offset
+coeff_flag_offset_chroma_422_dc
+coeff_token
+copy_column8
+count_cat_m1
+cqm_delete
+cqm_init
+cqm_parse_file
+cqm_parse_jmlist
+dct4_weight2_tab
+dct4_weight_tab
+dct8_weight2_tab
+dct8_weight_tab
+dct_init
+deblock_init
+decimate_score15
+decimate_score16
+decimate_score64
+decimate_score_internal
+decimate_table4
+decimate_table8
+denoise_dct
+encoder_close
+encoder_delayed_frames
+encoder_encapsulate_nals
+encoder_encode
+encoder_frame_end
+encoder_headers
+encoder_intra_refresh
+encoder_invalidate_reference
+encoder_maximum_delayed_frames
+encoder_open
+encoder_parameters
+encoder_reconfig
+encoder_reconfig_apply
+encoder_thread_init
+encoder_try_reconfig
+exp2_lut
+expand_border_mbpair
+fdec_filter_row
+field_vsad
+filler_write
+frame_cond_broadcast
+frame_cond_wait
+frame_copy_picture
+frame_deblock_row
+frame_delete
+frame_delete_list
+frame_dump
+frame_expand_border
+frame_expand_border_chroma
+frame_expand_border_filtered
+frame_expand_border_lowres
+frame_expand_border_mod16
+frame_filter
+frame_init_lowres
+frame_internal_csp
+frame_new
+frame_new_slice
+frame_pop
+frame_pop_blank_unused
+frame_pop_unused
+frame_push
+frame_push_blank_unused
+frame_push_unused
+frame_shift
+frame_unshift
+hpel_ref0
+hpel_ref1
+hrd_fullness
+intra_rd
+intra_rd_refine
+intra_sa8d_x3_8x8
+intra_sad_x3_16x16
+intra_sad_x3_4x4
+intra_sad_x3_8x16c
+intra_sad_x3_8x8
+intra_sad_x3_8x8c
+intra_satd_x3_16x16
+intra_satd_x3_4x4
+intra_satd_x3_8x16c
+intra_satd_x3_8x8c
+iter_kludge
+lambda2_tab
+lambda_tab
+last_coeff_flag_offset
+last_coeff_flag_offset_8x8
+log
+log2_lut
+log2_lz_lut
+lookahead_delete
+lookahead_encoder_shift
+lookahead_get_frames
+lookahead_init
+lookahead_is_empty
+lookahead_put_frame
+lookahead_shift
+lookahead_slicetype_decide
+lookahead_thread
+lookahead_update_last_nonb
+macroblock_analyse
+macroblock_backup_intra
+macroblock_bipred_init
+macroblock_cache_allocate
+macroblock_cache_free
+macroblock_cache_load
+macroblock_cache_load_interlaced
+macroblock_cache_load_neighbours
+macroblock_cache_load_neighbours_deblock
+macroblock_cache_load_progressive
+macroblock_cache_save
+macroblock_deblock
+macroblock_deblock_strength
+macroblock_deblock_strength_mbaff
+macroblock_encode
+macroblock_encode_internal
+macroblock_encode_p4x4
+macroblock_encode_p4x4_internal
+macroblock_encode_p8x8
+macroblock_encode_p8x8_internal
+macroblock_encode_skip
+macroblock_load_pic_pointers
+macroblock_probe_skip
+macroblock_probe_skip_internal
+macroblock_slice_init
+macroblock_store_pic
+macroblock_thread_allocate
+macroblock_thread_free
+macroblock_thread_init
+macroblock_tree_read
+macroblock_tree_rescale
+macroblock_tree_rescale_destroy
+macroblock_tree_rescale_init
+macroblock_write_cabac
+macroblock_write_cabac_internal
+macroblock_write_cavlc
+mb_analyse_b_rd
+mb_analyse_init
+mb_analyse_init_qp
+mb_analyse_inter_b16x16
+mb_analyse_inter_b16x8
+mb_analyse_inter_b8x16
+mb_analyse_inter_b8x8
+mb_analyse_inter_b8x8_mixed_ref
+mb_analyse_inter_direct
+mb_analyse_inter_p16x16
+mb_analyse_inter_p16x8
+mb_analyse_inter_p4x4
+mb_analyse_inter_p4x4_chroma
+mb_analyse_inter_p4x4_chroma_internal
+mb_analyse_inter_p4x8
+mb_analyse_inter_p8x16
+mb_analyse_inter_p8x4
+mb_analyse_inter_p8x8
+mb_analyse_inter_p8x8_mixed_ref
+mb_analyse_intra
+mb_analyse_intra_chroma
+mb_analyse_load_costs
+mb_analyse_p_rd
+mb_analyse_qp_rd
+mb_analyse_transform
+mb_analyse_transform_rd
+mb_cache_mv_b16x8
+mb_cache_mv_b8x16
+mb_cache_mv_b8x8
+mb_cache_mv_p8x8
+mb_encode_chroma
+mb_encode_chroma_internal
+mb_encode_i16x16
+mb_init_fenc_cache
+mb_load_mv_direct8x8
+mb_mc
+mb_mc_01xywh
+mb_mc_0xywh
+mb_mc_1xywh
+mb_mc_8x8
+mb_optimize_chroma_dc
+mb_predict_mv
+mb_predict_mv_16x16
+mb_predict_mv_direct16x16
+mb_predict_mv_direct16x16_spatial
+mb_predict_mv_direct16x16_spatial_interlaced
+mb_predict_mv_direct16x16_spatial_progressive
+mb_predict_mv_direct16x16_temporal
+mb_predict_mv_pskip
+mb_predict_mv_ref16x16
+mc_init
+me_refine_bidir
+me_refine_bidir_rd
+me_refine_bidir_satd
+me_refine_qpel
+me_refine_qpel_rd
+me_refine_qpel_refdupe
+me_search_ref
+nal_check_buffer
+nal_encode
+nal_end
+nal_escape_c
+nal_start
+noise_reduction_update
+partition_i4x4_size_cabac
+partition_i4x4_size_cavlc
+partition_i8x8_size_cabac
+partition_i8x8_size_cavlc
+partition_size_cabac
+partition_size_cavlc
+pixel_ads1
+pixel_ads2
+pixel_ads4
+pixel_init
+pixel_sa8d_16x16
+pixel_sa8d_8x8
+pixel_satd_4x4
+pixel_satd_8x4
+pixel_ssd_nv12
+pixel_ssd_wxh
+pixel_ssim_wxh
+plane_copy_c
+plane_copy_deinterleave_c
+plane_copy_deinterleave_rgb_c
+plane_copy_deinterleave_v210_c
+plane_copy_interleave_c
+plane_copy_swap_c
+pps_init
+pps_write
+predict_16x16_dc_128_c
+predict_16x16_dc_c
+predict_16x16_dc_left_c
+predict_16x16_dc_top_c
+predict_16x16_h_c
+predict_16x16_init
+predict_16x16_p_c
+predict_16x16_v_c
+predict_4x4_dc_128_c
+predict_4x4_dc_c
+predict_4x4_dc_left_c
+predict_4x4_dc_top_c
+predict_4x4_ddl_c
+predict_4x4_ddr_c
+predict_4x4_h_c
+predict_4x4_hd_c
+predict_4x4_hu_c
+predict_4x4_init
+predict_4x4_v_c
+predict_4x4_vl_c
+predict_4x4_vr_c
+predict_8x16c_dc_128_c
+predict_8x16c_dc_c
+predict_8x16c_dc_left_c
+predict_8x16c_dc_top_c
+predict_8x16c_h_c
+predict_8x16c_init
+predict_8x16c_p_c
+predict_8x16c_v_c
+predict_8x8_dc_128_c
+predict_8x8_dc_c
+predict_8x8_dc_left_c
+predict_8x8_dc_top_c
+predict_8x8_ddl_c
+predict_8x8_ddr_c
+predict_8x8_filter_c
+predict_8x8_h_c
+predict_8x8_hd_c
+predict_8x8_hu_c
+predict_8x8_init
+predict_8x8_v_c
+predict_8x8_vl_c
+predict_8x8_vr_c
+predict_8x8c_dc_128_c
+predict_8x8c_dc_c
+predict_8x8c_dc_left_c
+predict_8x8c_dc_top_c
+predict_8x8c_h_c
+predict_8x8c_init
+predict_8x8c_p_c
+predict_8x8c_v_c
+predict_lossless_16x16
+predict_lossless_4x4
+predict_lossless_8x8
+predict_lossless_chroma
+prefetch_fenc
+print_intra
+psnr
+psy_trellis_init
+quant_4x4_trellis
+quant_8x8_trellis
+quant_chroma_dc_trellis
+quant_init
+quant_luma_dc_trellis
+ratecontrol_delete
+ratecontrol_end
+ratecontrol_init_reconfigurable
+ratecontrol_mb
+ratecontrol_mb_qp
+ratecontrol_new
+ratecontrol_qp
+ratecontrol_set_weights
+ratecontrol_slice_type
+ratecontrol_start
+ratecontrol_summary
+ratecontrol_zone_init
+rc_analyse_slice
+rd_cost_part
+rdo_init
+reference_build_list
+reference_build_list_optimal
+reference_check_reorder
+reference_distance
+reference_hierarchy_reset
+reference_reset
+reference_update
+refine_bidir
+sei_avcintra_umid_write
+sei_avcintra_vanc_write
+sei_buffering_period_write
+sei_dec_ref_pic_marking_write
+sei_frame_packing_write
+sei_pic_timing_write
+sei_recovery_point_write
+sei_version_write
+sei_write
+set_aspect_ratio
+significant_coeff_flag_offset
+significant_coeff_flag_offset_8x8
+slice_header_init
+slice_header_write
+slice_init
+slice_write
+slices_write
+slicetype_analyse
+slicetype_decide
+sps_init
+sps_init_reconfigurable
+sps_write
+ssim
+strcat_filename
+subpartition_size_cabac
+subpartition_size_cavlc
+sync_frame_list_delete
+sync_frame_list_init
+sync_frame_list_pop
+sync_frame_list_push
+thread_sync_context
+thread_sync_ratecontrol
+thread_sync_stat
+threaded_slices_write
+threading_destroy
+threadpool_delete
+threadpool_init
+threadpool_list_delete
+threadpool_run
+threadpool_thread
+threadpool_wait
+threadpool_wait_all
+threads_distribute_ratecontrol
+threads_merge_ratecontrol
+threads_normalize_predictors
+threadslice_cond_broadcast
+threadslice_cond_wait
+total_zeros
+total_zeros_2x2_dc
+total_zeros_2x4_dc
+validate_levels
+validate_parameters
+weight_cache
+weight_none
+weight_scale_plane
+weighted_pred_init
+weighted_reference_duplicate
+weights_analyse
+zigzag_init
diff --git a/tools/duplicate.sh b/tools/duplicate.sh
new file mode 100755
index 0000000..add3f21
--- /dev/null
+++ b/tools/duplicate.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Read the list of symbols to rename and create a header file.
+
+echo "#ifndef COMMON_BITDEPTH_H"
+echo "#define COMMON_BITDEPTH_H"
+echo "#define x264_glue_expand(x,y,z) x##y##z"
+echo "#define x264_glue(x,y,z) x264_glue_expand(x,y,z)"
+
+API_LIST=`cat $1`
+for var in $API_LIST; do
+ echo "#define x264_$var x264_glue(x264_,BIT_DEPTH,_${var})"
+done
+
+echo "#endif"
--
2.10.0
More information about the x264-devel
mailing list