Lines Matching full:entropy

14  * This file contains Huffman entropy encoding routines.
68 /* Expanded entropy encoder object for Huffman encoding.
166 huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; in start_pass_huff() local
172 entropy->pub.encode_mcu = encode_mcu_gather; in start_pass_huff()
173 entropy->pub.finish_pass = finish_pass_gather; in start_pass_huff()
178 entropy->pub.encode_mcu = encode_mcu_huff; in start_pass_huff()
179 entropy->pub.finish_pass = finish_pass_huff; in start_pass_huff()
182 entropy->simd = jsimd_can_huff_encode_one_block(); in start_pass_huff()
198 if (entropy->dc_count_ptrs[dctbl] == NULL) in start_pass_huff()
199 entropy->dc_count_ptrs[dctbl] = (long *) in start_pass_huff()
202 memset(entropy->dc_count_ptrs[dctbl], 0, 257 * sizeof(long)); in start_pass_huff()
203 if (entropy->ac_count_ptrs[actbl] == NULL) in start_pass_huff()
204 entropy->ac_count_ptrs[actbl] = (long *) in start_pass_huff()
207 memset(entropy->ac_count_ptrs[actbl], 0, 257 * sizeof(long)); in start_pass_huff()
213 &entropy->dc_derived_tbls[dctbl]); in start_pass_huff()
215 &entropy->ac_derived_tbls[actbl]); in start_pass_huff()
218 entropy->saved.last_dc_val[ci] = 0; in start_pass_huff()
222 if (entropy->simd) { in start_pass_huff()
223 entropy->saved.put_buffer.simd = 0; in start_pass_huff()
225 entropy->saved.free_bits = 0; in start_pass_huff()
227 entropy->saved.free_bits = SIMD_BIT_BUF_SIZE; in start_pass_huff()
230 entropy->saved.put_buffer.c = 0; in start_pass_huff()
231 entropy->saved.free_bits = BIT_BUF_SIZE; in start_pass_huff()
235 entropy->restarts_to_go = cinfo->restart_interval; in start_pass_huff()
236 entropy->next_restart_num = 0; in start_pass_huff()
687 huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; in encode_mcu_huff() local
695 state.cur = entropy->saved; in encode_mcu_huff()
697 state.simd = entropy->simd; in encode_mcu_huff()
701 if (entropy->restarts_to_go == 0) in encode_mcu_huff()
702 if (!emit_restart(&state, entropy->next_restart_num)) in encode_mcu_huff()
707 if (entropy->simd) { in encode_mcu_huff()
713 entropy->dc_derived_tbls[compptr->dc_tbl_no], in encode_mcu_huff()
714 entropy->ac_derived_tbls[compptr->ac_tbl_no])) in encode_mcu_huff()
725 entropy->dc_derived_tbls[compptr->dc_tbl_no], in encode_mcu_huff()
726 entropy->ac_derived_tbls[compptr->ac_tbl_no])) in encode_mcu_huff()
736 entropy->saved = state.cur; in encode_mcu_huff()
740 if (entropy->restarts_to_go == 0) { in encode_mcu_huff()
741 entropy->restarts_to_go = cinfo->restart_interval; in encode_mcu_huff()
742 entropy->next_restart_num++; in encode_mcu_huff()
743 entropy->next_restart_num &= 7; in encode_mcu_huff()
745 entropy->restarts_to_go--; in encode_mcu_huff()
759 huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; in finish_pass_huff() local
765 state.cur = entropy->saved; in finish_pass_huff()
767 state.simd = entropy->simd; in finish_pass_huff()
776 entropy->saved = state.cur; in finish_pass_huff()
872 huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; in encode_mcu_gather() local
878 if (entropy->restarts_to_go == 0) { in encode_mcu_gather()
881 entropy->saved.last_dc_val[ci] = 0; in encode_mcu_gather()
883 entropy->restarts_to_go = cinfo->restart_interval; in encode_mcu_gather()
885 entropy->restarts_to_go--; in encode_mcu_gather()
891 htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci], in encode_mcu_gather()
892 entropy->dc_count_ptrs[compptr->dc_tbl_no], in encode_mcu_gather()
893 entropy->ac_count_ptrs[compptr->ac_tbl_no]); in encode_mcu_gather()
894 entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0]; in encode_mcu_gather()
1075 huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; in finish_pass_gather() local
1096 jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]); in finish_pass_gather()
1103 jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[actbl]); in finish_pass_gather()
1114 * Module initialization routine for Huffman entropy encoding.
1120 huff_entropy_ptr entropy; in jinit_huff_encoder() local
1123 entropy = (huff_entropy_ptr) in jinit_huff_encoder()
1126 cinfo->entropy = (struct jpeg_entropy_encoder *)entropy; in jinit_huff_encoder()
1127 entropy->pub.start_pass = start_pass_huff; in jinit_huff_encoder()
1131 entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; in jinit_huff_encoder()
1133 entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL; in jinit_huff_encoder()