Lines Matching full:entropy
14 * This file contains Huffman entropy encoding routines.
69 /* Expanded entropy encoder object for Huffman encoding.
167 huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; in start_pass_huff() local
173 entropy->pub.encode_mcu = encode_mcu_gather; in start_pass_huff()
174 entropy->pub.finish_pass = finish_pass_gather; in start_pass_huff()
179 entropy->pub.encode_mcu = encode_mcu_huff; in start_pass_huff()
180 entropy->pub.finish_pass = finish_pass_huff; in start_pass_huff()
183 entropy->simd = jsimd_can_huff_encode_one_block(); in start_pass_huff()
199 if (entropy->dc_count_ptrs[dctbl] == NULL) in start_pass_huff()
200 entropy->dc_count_ptrs[dctbl] = (long *) in start_pass_huff()
203 MEMZERO(entropy->dc_count_ptrs[dctbl], 257 * sizeof(long)); in start_pass_huff()
204 if (entropy->ac_count_ptrs[actbl] == NULL) in start_pass_huff()
205 entropy->ac_count_ptrs[actbl] = (long *) in start_pass_huff()
208 MEMZERO(entropy->ac_count_ptrs[actbl], 257 * sizeof(long)); in start_pass_huff()
214 &entropy->dc_derived_tbls[dctbl]); in start_pass_huff()
216 &entropy->ac_derived_tbls[actbl]); in start_pass_huff()
219 entropy->saved.last_dc_val[ci] = 0; in start_pass_huff()
223 if (entropy->simd) { in start_pass_huff()
224 entropy->saved.put_buffer.simd = 0; in start_pass_huff()
226 entropy->saved.free_bits = 0; in start_pass_huff()
228 entropy->saved.free_bits = SIMD_BIT_BUF_SIZE; in start_pass_huff()
231 entropy->saved.put_buffer.c = 0; in start_pass_huff()
232 entropy->saved.free_bits = BIT_BUF_SIZE; in start_pass_huff()
236 entropy->restarts_to_go = cinfo->restart_interval; in start_pass_huff()
237 entropy->next_restart_num = 0; in start_pass_huff()
688 huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; in encode_mcu_huff() local
696 state.cur = entropy->saved; in encode_mcu_huff()
698 state.simd = entropy->simd; in encode_mcu_huff()
702 if (entropy->restarts_to_go == 0) in encode_mcu_huff()
703 if (!emit_restart(&state, entropy->next_restart_num)) in encode_mcu_huff()
708 if (entropy->simd) { in encode_mcu_huff()
714 entropy->dc_derived_tbls[compptr->dc_tbl_no], in encode_mcu_huff()
715 entropy->ac_derived_tbls[compptr->ac_tbl_no])) in encode_mcu_huff()
726 entropy->dc_derived_tbls[compptr->dc_tbl_no], in encode_mcu_huff()
727 entropy->ac_derived_tbls[compptr->ac_tbl_no])) in encode_mcu_huff()
737 entropy->saved = state.cur; in encode_mcu_huff()
741 if (entropy->restarts_to_go == 0) { in encode_mcu_huff()
742 entropy->restarts_to_go = cinfo->restart_interval; in encode_mcu_huff()
743 entropy->next_restart_num++; in encode_mcu_huff()
744 entropy->next_restart_num &= 7; in encode_mcu_huff()
746 entropy->restarts_to_go--; in encode_mcu_huff()
760 huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; in finish_pass_huff() local
766 state.cur = entropy->saved; in finish_pass_huff()
768 state.simd = entropy->simd; in finish_pass_huff()
777 entropy->saved = state.cur; in finish_pass_huff()
873 huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; in encode_mcu_gather() local
879 if (entropy->restarts_to_go == 0) { in encode_mcu_gather()
882 entropy->saved.last_dc_val[ci] = 0; in encode_mcu_gather()
884 entropy->restarts_to_go = cinfo->restart_interval; in encode_mcu_gather()
886 entropy->restarts_to_go--; in encode_mcu_gather()
892 htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci], in encode_mcu_gather()
893 entropy->dc_count_ptrs[compptr->dc_tbl_no], in encode_mcu_gather()
894 entropy->ac_count_ptrs[compptr->ac_tbl_no]); in encode_mcu_gather()
895 entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0]; in encode_mcu_gather()
1076 huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy; in finish_pass_gather() local
1097 jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]); in finish_pass_gather()
1104 jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[actbl]); in finish_pass_gather()
1115 * Module initialization routine for Huffman entropy encoding.
1121 huff_entropy_ptr entropy; in jinit_huff_encoder() local
1124 entropy = (huff_entropy_ptr) in jinit_huff_encoder()
1127 cinfo->entropy = (struct jpeg_entropy_encoder *)entropy; in jinit_huff_encoder()
1128 entropy->pub.start_pass = start_pass_huff; in jinit_huff_encoder()
1132 entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; in jinit_huff_encoder()
1134 entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL; in jinit_huff_encoder()