FFmpeg
|
JPEG2000 image encoder. More...
#include <float.h>
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"
#include "bytestream.h"
#include "jpeg2000.h"
#include "version.h"
#include "libavutil/common.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"
#include "libavutil/opt.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/avstring.h"
#include "libavutil/thread.h"
Go to the source code of this file.
Data Structures | |
struct | Jpeg2000Tile |
struct | Jpeg2000EncoderContext |
Macros | |
#define | NMSEDEC_BITS 7 |
#define | NMSEDEC_FRACBITS (NMSEDEC_BITS-1) |
#define | WMSEDEC_SHIFT 13 |
must be >= 13 More... | |
#define | LAMBDA_SCALE (100000000LL << (WMSEDEC_SHIFT - 13)) |
#define | CODEC_JP2 1 |
#define | CODEC_J2K 0 |
#define | COPY_FRAME(D, PIXEL) |
#define | OFFSET(x) offsetof(Jpeg2000EncoderContext, x) |
#define | VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM |
Functions | |
static void | put_bits (Jpeg2000EncoderContext *s, int val, int n) |
put n times val bit More... | |
static void | put_num (Jpeg2000EncoderContext *s, int num, int n) |
put n least significant bits of a number num More... | |
static void | j2k_flush (Jpeg2000EncoderContext *s) |
flush the bitstream More... | |
static void | tag_tree_code (Jpeg2000EncoderContext *s, Jpeg2000TgtNode *node, int threshold) |
code the value stored in node More... | |
static void | tag_tree_update (Jpeg2000TgtNode *node) |
update the value in node More... | |
static int | put_siz (Jpeg2000EncoderContext *s) |
static int | put_cod (Jpeg2000EncoderContext *s) |
static int | put_qcd (Jpeg2000EncoderContext *s, int compno) |
static int | put_com (Jpeg2000EncoderContext *s, int compno) |
static uint8_t * | put_sot (Jpeg2000EncoderContext *s, int tileno) |
static void | compute_rates (Jpeg2000EncoderContext *s) |
static int | init_tiles (Jpeg2000EncoderContext *s) |
compute the sizes of tiles, resolution levels, bands, etc. More... | |
static void | init_quantization (Jpeg2000EncoderContext *s) |
static void | init_luts (void) |
static int | getnmsedec_sig (int x, int bpno) |
static int | getnmsedec_ref (int x, int bpno) |
static void | encode_sigpass (Jpeg2000T1Context *t1, int width, int height, int bandno, int *nmsedec, int bpno) |
static void | encode_refpass (Jpeg2000T1Context *t1, int width, int height, int *nmsedec, int bpno) |
static void | encode_clnpass (Jpeg2000T1Context *t1, int width, int height, int bandno, int *nmsedec, int bpno) |
static void | encode_cblk (Jpeg2000EncoderContext *s, Jpeg2000T1Context *t1, Jpeg2000Cblk *cblk, Jpeg2000Tile *tile, int width, int height, int bandpos, int lev) |
static void | putnumpasses (Jpeg2000EncoderContext *s, int n) |
static int | encode_packet (Jpeg2000EncoderContext *s, Jpeg2000ResLevel *rlevel, int layno, int precno, const uint8_t *expn, int numgbits, int packetno, int nlayers) |
static int | encode_packets (Jpeg2000EncoderContext *s, Jpeg2000Tile *tile, int tileno, int nlayers) |
static void | makelayer (Jpeg2000EncoderContext *s, int layno, double thresh, Jpeg2000Tile *tile, int final) |
static void | makelayers (Jpeg2000EncoderContext *s, Jpeg2000Tile *tile) |
static int | getcut (Jpeg2000Cblk *cblk, uint64_t lambda) |
static void | truncpasses (Jpeg2000EncoderContext *s, Jpeg2000Tile *tile) |
static int | encode_tile (Jpeg2000EncoderContext *s, Jpeg2000Tile *tile, int tileno) |
static void | cleanup (Jpeg2000EncoderContext *s) |
static void | reinit (Jpeg2000EncoderContext *s) |
static void | update_size (uint8_t *size, const uint8_t *end) |
static int | encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet) |
static int | parse_layer_rates (Jpeg2000EncoderContext *s) |
static av_cold int | j2kenc_init (AVCodecContext *avctx) |
static int | j2kenc_destroy (AVCodecContext *avctx) |
Variables | |
static int | lut_nmsedec_ref [1<< NMSEDEC_BITS] |
static int | lut_nmsedec_ref0 [1<< NMSEDEC_BITS] |
static int | lut_nmsedec_sig [1<< NMSEDEC_BITS] |
static int | lut_nmsedec_sig0 [1<< NMSEDEC_BITS] |
static const int | dwt_norms [2][4][10] |
static const AVOption | options [] |
static const AVClass | j2k_class |
const FFCodec | ff_jpeg2000_encoder |
JPEG2000 image encoder.
Definition in file j2kenc.c.
#define NMSEDEC_FRACBITS (NMSEDEC_BITS-1) |
#define LAMBDA_SCALE (100000000LL << (WMSEDEC_SHIFT - 13)) |
#define OFFSET | ( | x | ) | offsetof(Jpeg2000EncoderContext, x) |
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM |
|
static |
put n times val bit
Definition at line 223 of file j2kenc.c.
Referenced by aac_adtstoasc_filter(), aac_encode_frame(), ac3_output_frame_header(), adpcm_encode_frame(), adts_decode_extradata(), adts_write_frame_header(), asv1_encode_block(), asv1_put_level(), av_dynamic_hdr_plus_to_t35(), avpriv_dca_convert_bitstream(), binary_export(), bit_copy(), cbs_av1_write_increment(), cbs_av1_write_leb128(), cbs_av1_write_ns(), cbs_av1_write_obu(), cbs_av1_write_uvlc(), cbs_h2645_write_slice_data(), cbs_mpeg2_write_slice(), cbs_vp9_write_increment(), cbs_vp9_write_le(), cbs_vp9_write_s(), cbs_write_se_golomb(), cbs_write_ue_golomb(), cfhd_encode_frame(), codebook_trellis_rate(), copy_bits(), dca_vlc_enc_alloc(), dca_vlc_enc_quant(), dnxhd_encode_block(), dnxhd_encode_dc(), dnxhd_encode_thread(), dv_encode_ac(), dv_encode_video_segment(), eac3_output_frame_header(), encode_422_bitstream(), encode_aspect_ratio(), encode_bitstream(), encode_block(), encode_clean_area(), encode_color_spec(), encode_exp_vlc(), encode_ext_header(), encode_flush(), encode_four_color_block(), encode_frame(), encode_frame_rate(), encode_frame_size(), encode_hq_slice(), encode_individual_channel(), encode_line(), encode_ms_info(), encode_packet(), encode_parse_info(), encode_picture_ls(), encode_plane_slice(), encode_pulses(), encode_quant_matrix(), encode_sample_fmt(), encode_scalar(), encode_scale_factors(), encode_scan_format(), encode_signal_range(), encode_subband(), encode_superframe(), encode_table(), encode_vlc_codeword(), encode_window_bands_info(), encode_yuv422p10(), ff_aac_encode_ltp_info(), ff_aac_encode_main_pred(), ff_aac_encode_tns_info(), ff_alloc_timecode_sei(), ff_cbs_write_unsigned(), ff_copy_bits(), ff_dolby_e_convert_input(), ff_dovi_rpu_generate(), ff_flv2_encode_ac_esc(), ff_flv_encode_picture_header(), ff_h261_encode_mb(), ff_h261_encode_picture_header(), ff_h263_encode_gob_header(), ff_h263_encode_mb(), ff_h263_encode_mba(), ff_h263_encode_motion(), ff_h263_encode_picture_header(), ff_hevc_encode_nal_vps(), ff_iamf_write_audio_frame(), ff_isom_put_dvcc_dvvc(), ff_isom_write_av1c(), ff_lzw_encode_flush(), ff_mjpeg_encode_dc(), ff_mjpeg_encode_picture_header(), ff_mjpeg_escape_FF(), ff_mjpeg_find_marker(), ff_mpeg4_encode_mb(), ff_mpeg4_encode_picture_header(), ff_mpeg4_encode_video_packet_header(), ff_mpeg4_merge_partitions(), ff_mpeg4_stuffing(), ff_mpv_encode_picture(), ff_msmpeg4_code012(), ff_msmpeg4_encode_block(), ff_msmpeg4_encode_ext_header(), ff_msmpeg4_encode_mb(), ff_msmpeg4_encode_motion(), ff_msmpeg4_encode_picture_header(), ff_pce_copy_bits(), ff_put_string(), ff_rv10_encode_picture_header(), ff_rv20_encode_picture_header(), ff_wmv2_encode_mb(), ff_wmv2_encode_picture_header(), ff_write_quant_matrix(), floor_encode(), flv_write_codec_header(), generate_ext_v1(), generate_ext_v2(), h261_encode_block(), h261_encode_gob_header(), h261_encode_motion(), h263_encode_block(), h263p_encode_umotion(), iamf_write_audio_element(), iamf_write_codec_config(), iamf_write_mixing_presentation(), jpeg_put_comments(), jpeg_table_header(), latm_write_frame_header(), latm_write_packet(), ls_encode_run(), main(), mov_write_ac3_tag(), mov_write_dvc1_structs(), mov_write_eac3_tag(), mpeg4_encode_block(), mpeg4_encode_dc(), mpeg4_encode_gop_header(), mpeg4_encode_visual_object_header(), mpeg4_encode_vol_header(), msmpeg4_encode_dc(), msmpeg4v2_encode_motion(), output_audio_block(), pack_bitstream(), pack_float_sample(), pnm_decode_frame(), put_alpha_diff(), put_alpha_run(), put_audio_specific_config(), put_bitstream_info(), put_cabac_bit(), put_cabac_terminate(), put_codebook_header(), put_codeword(), put_floor_header(), put_frame_header(), put_huffman_table(), put_ics_info(), put_main_header(), put_marker(), put_num(), put_pack_header(), put_pce(), put_primary_audio_header(), put_residue_header(), put_runcode(), put_subframe(), put_subframe_samples(), put_swf_line_edge(), put_swf_matrix(), put_swf_rect(), put_system_header(), put_vc2_ue_uint(), put_xsub_rle(), quantize_and_encode_band_cost_template(), ra144_encode_frame(), ra144_encode_subblock(), rpza_encode_stream(), s302m_encode2_frame(), save_bits(), sbc_pack_frame(), scalable_channel_layout_config(), send_mode_a(), send_mode_b(), set_sr_golomb_flac(), set_te_golomb(), set_ue_golomb(), set_ue_golomb_long(), set_ur_golomb(), set_ur_golomb_jpegls(), svq1_encode_frame(), svq1_encode_plane(), svq1_write_header(), swf_write_header(), tag_tree_code(), tta_encode_frame(), update_extradata(), vorbis_encode_frame(), vp9_raw_reorder_make_output(), vvcc_write(), wavpack_encode_sample(), write_block_data(), write_decoding_params(), write_element(), write_element_header(), write_filter_params(), write_frame(), write_frame_footer(), write_frame_header(), write_header(), write_huff_codes(), write_major_sync(), write_matrix_params(), write_parameter_block(), write_ptl(), write_ptl_layer(), write_restart_header(), write_streaminfo(), write_subframes(), write_substr(), write_utf8(), and writeCode().
|
static |
put n least significant bits of a number num
Definition at line 236 of file j2kenc.c.
Referenced by encode_packet(), and putnumpasses().
|
static |
|
static |
code the value stored in node
Definition at line 254 of file j2kenc.c.
Referenced by encode_packet().
|
static |
|
static |
Definition at line 301 of file j2kenc.c.
Referenced by encode_frame().
|
static |
Definition at line 330 of file j2kenc.c.
Referenced by encode_frame().
|
static |
Definition at line 362 of file j2kenc.c.
Referenced by encode_frame().
|
static |
Definition at line 388 of file j2kenc.c.
Referenced by encode_frame().
|
static |
Definition at line 407 of file j2kenc.c.
Referenced by encode_frame().
|
static |
Definition at line 426 of file j2kenc.c.
Referenced by init_tiles().
|
static |
compute the sizes of tiles, resolution levels, bands, etc.
allocate memory for them divide the input image into tile-components
Definition at line 456 of file j2kenc.c.
Referenced by j2kenc_init().
|
static |
Definition at line 553 of file j2kenc.c.
Referenced by j2kenc_init().
|
static |
Definition at line 583 of file j2kenc.c.
Referenced by j2kenc_init().
|
static |
Definition at line 602 of file j2kenc.c.
Referenced by encode_clnpass(), and encode_sigpass().
|
static |
Definition at line 609 of file j2kenc.c.
Referenced by encode_refpass().
|
static |
Definition at line 616 of file j2kenc.c.
Referenced by encode_cblk().
|
static |
Definition at line 638 of file j2kenc.c.
Referenced by encode_cblk().
|
static |
Definition at line 652 of file j2kenc.c.
Referenced by encode_cblk().
|
static |
Definition at line 707 of file j2kenc.c.
Referenced by encode_tile().
|
static |
Definition at line 769 of file j2kenc.c.
Referenced by encode_packet().
|
static |
Definition at line 784 of file j2kenc.c.
Referenced by encode_packets().
|
static |
Definition at line 940 of file j2kenc.c.
Referenced by encode_tile(), and makelayers().
|
static |
Definition at line 1186 of file j2kenc.c.
Referenced by makelayers().
|
static |
Definition at line 1269 of file j2kenc.c.
Referenced by encode_tile().
|
static |
Definition at line 1352 of file j2kenc.c.
Referenced by truncpasses().
|
static |
Definition at line 1370 of file j2kenc.c.
Referenced by encode_tile().
|
static |
Definition at line 1405 of file j2kenc.c.
Referenced by encode_frame().
|
static |
Definition at line 1496 of file j2kenc.c.
Referenced by j2kenc_destroy().
|
static |
Definition at line 1516 of file j2kenc.c.
Referenced by encode_frame().
|
static |
Definition at line 1526 of file j2kenc.c.
Referenced by encode_frame().
|
static |
|
static |
Definition at line 1670 of file j2kenc.c.
Referenced by j2kenc_init().
|
static |
|
static |
|
static |
Definition at line 90 of file j2kenc.c.
Referenced by getnmsedec_ref(), and init_luts().
|
static |
Definition at line 91 of file j2kenc.c.
Referenced by getnmsedec_ref(), and init_luts().
|
static |
Definition at line 92 of file j2kenc.c.
Referenced by getnmsedec_sig(), and init_luts().
|
static |
Definition at line 93 of file j2kenc.c.
Referenced by getnmsedec_sig(), and init_luts().
|
static |
Definition at line 95 of file j2kenc.c.
Referenced by init_quantization(), and truncpasses().
|
static |
|
static |