Grok  7.6.2
ojph_block_encoder.h
Go to the documentation of this file.
1 //***************************************************************************/
2 // This software is released under the 2-Clause BSD license, included
3 // below.
4 //
5 // Copyright (c) 2019, Aous Naman
6 // Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
7 // Copyright (c) 2019, The University of New South Wales, Australia
8 //
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions are
11 // met:
12 //
13 // 1. Redistributions of source code must retain the above copyright
14 // notice, this list of conditions and the following disclaimer.
15 //
16 // 2. Redistributions in binary form must reproduce the above copyright
17 // notice, this list of conditions and the following disclaimer in the
18 // documentation and/or other materials provided with the distribution.
19 //
20 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21 // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23 // PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
26 // TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 //***************************************************************************/
32 // This file is part of the OpenJPH software implementation.
33 // File: ojph_block_encoder.h
34 // Author: Aous Naman
35 // Date: 17 September 2019
36 //***************************************************************************/
37 
38 
39 #ifndef OJPH_BLOCK_ENCODER_H
40 #define OJPH_BLOCK_ENCODER_H
41 
42 #include "ojph_defs.h"
43 
44 namespace ojph {
45 
47  // defined elsewhere
48  class mem_elastic_allocator;
49  struct coded_lists;
50 
51  namespace local {
52 
54  void
55  ojph_encode_codeblock(ui32* buf, ui32 missing_msbs, ui32 num_passes,
56  ui32 width, ui32 height, ui32 stride,
57  ui32* lengths,
59  ojph::coded_lists *& coded);
60 
63  }
64 }
65 
66 #endif // !OJPH_BLOCK_ENCODER_H
ojph::ui8
uint8_t ui8
Definition: ojph_defs.h:50
ojph::local::ms_struct::pos
ui32 pos
Definition: ojph_block_encoder.cpp:393
ojph_message.h
ojph::count_leading_zeros
static ui32 count_leading_zeros(ui32 val)
Definition: ojph_arch.h:93
ojph::local::ms_terminate
static void ms_terminate(ms_struct *msp)
Definition: ojph_block_encoder.cpp:438
ojph::local::mel_struct::pos
ui32 pos
Definition: ojph_block_encoder.cpp:220
ojph::local::mel_init
static void mel_init(dec_mel_st *melp, ui8 *bbuf, int lcup, int scup)
Initiates a dec_mel_st structure for MEL decoding and reads some bytes in order to get the read addre...
Definition: ojph_block_decoder.cpp:237
ojph_min
#define ojph_min(a, b)
Definition: ojph_defs.h:76
ojph::local::vlc_tbl0
static ui16 vlc_tbl0[1024]
vlc_tbl0 contains decoding information for initial row of quads
Definition: ojph_block_decoder.cpp:70
ojph::local::terminate_mel_vlc
static void terminate_mel_vlc(mel_struct *melp, vlc_struct *vlcp)
Definition: ojph_block_encoder.cpp:357
OJPH_ERROR
#define OJPH_ERROR(t,...)
Definition: ojph_message.h:131
table0.h
table1.h
ojph::local::vlc_init
static void vlc_init(vlc_struct *vlcp, ui32 buffer_size, ui8 *data)
Definition: ojph_block_encoder.cpp:309
ojph::local::vlc_encode
static void vlc_encode(vlc_struct *vlcp, int cwd, int cwd_len)
Definition: ojph_block_encoder.cpp:323
ojph::local::mel_struct::remaining_bits
int remaining_bits
Definition: ojph_block_encoder.cpp:224
ojph::local::vlc_struct::pos
ui32 pos
Definition: ojph_block_encoder.cpp:299
ojph_mem.h
ojph::population_count
static ui32 population_count(ui32 val)
Definition: ojph_arch.h:73
ojph::local::mel_struct::k
int k
Definition: ojph_block_encoder.cpp:227
ojph::coded_lists::avail_size
ui32 avail_size
Definition: ojph_mem.h:172
ojph::local::ms_struct::max_bits
int max_bits
Definition: ojph_block_encoder.cpp:396
ojph::ui32
uint32_t ui32
Definition: ojph_defs.h:54
ojph_defs.h
ojph::local::ulvc_cwd_pre
static int ulvc_cwd_pre[33]
Definition: ojph_block_encoder.cpp:63
ojph::local::mel_struct::tmp
int tmp
Definition: ojph_block_encoder.cpp:225
ojph::coded_lists::buf
ui8 * buf
Definition: ojph_mem.h:173
ojph::local::ms_struct
Definition: ojph_block_encoder.cpp:390
ojph::local::ojph_encode_codeblock
void ojph_encode_codeblock(ui32 *buf, ui32 missing_msbs, ui32 num_passes, ui32 width, ui32 height, ui32 stride, ui32 *lengths, ojph::mem_elastic_allocator *elastic, ojph::coded_lists *&coded)
Definition: ojph_block_encoder.cpp:463
ojph::mem_elastic_allocator::get_buffer
void get_buffer(ui32 needed_bytes, coded_lists *&p)
Definition: ojph_mem.cpp:95
ojph::local::vlc_struct::buf
ui8 * buf
Definition: ojph_block_encoder.cpp:298
ojph::local::mel_struct::buf
ui8 * buf
Definition: ojph_block_encoder.cpp:219
ojph::coded_lists
Definition: ojph_mem.h:162
ojph::local::ulvc_cwd_suf
static int ulvc_cwd_suf[33]
Definition: ojph_block_encoder.cpp:65
ojph::local::mel_emit_bit
static void mel_emit_bit(mel_struct *melp, int v)
Definition: ojph_block_encoder.cpp:247
ojph::local::vlc_struct
Definition: ojph_block_encoder.cpp:296
ojph::si32
int32_t si32
Definition: ojph_defs.h:55
ojph::local::ms_init
static void ms_init(ms_struct *msp, ui32 buffer_size, ui8 *data)
Definition: ojph_block_encoder.cpp:403
ojph::local::encode_vlc_init_tables
bool encode_vlc_init_tables()
Definition: ojph_block_encoder.cpp:69
ojph::local::vlc_struct::last_greater_than_8F
bool last_greater_than_8F
Definition: ojph_block_encoder.cpp:304
ojph::ui16
uint16_t ui16
Definition: ojph_defs.h:52
ojph::local::ms_struct::buf
ui8 * buf
Definition: ojph_block_encoder.cpp:392
ojph::local::encode_uvlc_init_tables
bool encode_uvlc_init_tables()
Definition: ojph_block_encoder.cpp:189
ojph::local::ulvc_cwd_suf_len
static int ulvc_cwd_suf_len[33]
Definition: ojph_block_encoder.cpp:66
ojph::local::mel_encode
static void mel_encode(mel_struct *melp, bool bit)
Definition: ojph_block_encoder.cpp:265
ojph_max
#define ojph_max(a, b)
Definition: ojph_defs.h:73
ojph::local::mel_struct::buf_size
ui32 buf_size
Definition: ojph_block_encoder.cpp:221
ojph::local::ms_struct::buf_size
ui32 buf_size
Definition: ojph_block_encoder.cpp:394
ojph::local::vlc_struct::buf_size
ui32 buf_size
Definition: ojph_block_encoder.cpp:300
ojph_arch.h
ojph::local::mel_struct
Definition: ojph_block_encoder.cpp:217
ojph::local::vlc_tbl1
static ui16 vlc_tbl1[1024]
vlc_tbl1 contains decoding information for non-initial row of quads
Definition: ojph_block_decoder.cpp:73
ojph::mem_elastic_allocator
Definition: ojph_mem.h:178
ojph::local::ms_encode
static void ms_encode(ms_struct *msp, ui32 cwd, int cwd_len)
Definition: ojph_block_encoder.cpp:415
ojph::local::ms_struct::tmp
int tmp
Definition: ojph_block_encoder.cpp:398
ojph::local::vlc_struct::used_bits
int used_bits
Definition: ojph_block_encoder.cpp:302
ojph::local::ulvc_cwd_pre_len
static int ulvc_cwd_pre_len[33]
Definition: ojph_block_encoder.cpp:64
ojph
Definition: ojph_block_decoder.cpp:49
ojph::local::vlc_struct::tmp
int tmp
Definition: ojph_block_encoder.cpp:303
ojph_block_encoder.h
ojph::local::mel_struct::run
int run
Definition: ojph_block_encoder.cpp:226
ojph::local::ms_struct::used_bits
int used_bits
Definition: ojph_block_encoder.cpp:397
ojph::local::mel_struct::threshold
int threshold
Definition: ojph_block_encoder.cpp:228