25 int plane_index,
int bits)
46 if (
s->slice_coding_mode == 1) {
47 for (x = 0; x < w; x++) {
50 for (i =
bits-1; i>=0; i--) {
58 for (x = 0; x < w; x++) {
102 ff_dlog(
s->avctx,
"count:%d index:%d, mode:%d, x:%d pos:%d\n",
103 run_count, run_index, run_mode, x,
126 int w,
int h,
const int stride[3])
129 const int ring_size =
s->context_model ? 3 : 2;
131 int lbd =
s->bits_per_raw_sample <= 8;
132 int packed = !
src[1];
133 int bits =
s->bits_per_raw_sample > 0 ?
s->bits_per_raw_sample : 8;
139 (w + 6) *
sizeof(*
RENAME(
s->sample_buffer)));
141 for (y = 0; y <
h; y++) {
144 sample[p][i]=
RENAME(
s->sample_buffer) + p*ring_size*(w+6) + ((h+i-y)%
ring_size)*(w+6) + 3;
146 for (x = 0; x < w; x++) {
149 unsigned v = *((
const uint32_t*)(
src[0] + x*4 +
stride[0]*y));
152 r = (v >> 16) & 0xFF;
155 const uint16_t *p = ((
const uint16_t*)(
src[0] + x*6 +
stride[0]*y));
159 }
else if (
sizeof(
TYPE) == 4) {
160 g = *((
const uint16_t *)(
src[0] + x*2 +
stride[0]*y));
161 b = *((
const uint16_t *)(
src[1] + x*2 +
stride[1]*y));
162 r = *((
const uint16_t *)(
src[2] + x*2 +
stride[2]*y));
164 b = *((
const uint16_t *)(
src[0] + x*2 +
stride[0]*y));
165 g = *((
const uint16_t *)(
src[1] + x*2 +
stride[1]*y));
166 r = *((
const uint16_t *)(
src[2] + x*2 +
stride[2]*y));
169 if (
s->slice_coding_mode != 1) {
172 g += (b *
s->slice_rct_by_coef + r *
s->slice_rct_ry_coef) >> 2;
182 for (p = 0; p < 3 +
s->transparency; p++) {
184 sample[p][0][-1] = sample[p][1][0 ];
185 sample[p][1][ w] = sample[p][1][w-1];
186 if (lbd &&
s->slice_coding_mode == 0)
187 ret =
RENAME(encode_line)(
s, w, sample[p], (p + 1) / 2, 9);
189 ret =
RENAME(encode_line)(
s, w, sample[p], (p + 1) / 2, bits + (
s->slice_coding_mode != 1));
static av_always_inline int fold(int diff, int bits)
const uint8_t ff_log2_run[41]
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
static av_always_inline av_flatten void put_symbol_inline(RangeCoder *c, uint8_t *state, int v, int is_signed, uint64_t rc_stat[256][2], uint64_t rc_stat2[32][2])
static int ring_size(RingBuffer *ring)
static av_always_inline void predict(PredictorState *ps, float *coef, int output_enable)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static const uint8_t offset[127][2]
static int put_bits_count(PutBitContext *s)
#define AV_CODEC_FLAG_PASS1
Use internal 2pass ratecontrol in first pass mode.
static void put_vlc_symbol(PutBitContext *pb, VlcState *const state, int v, int bits)
GLint GLenum GLboolean GLsizei stride
uint8_t(* state)[CONTEXT_SIZE]
static av_always_inline int diff(const uint32_t a, const uint32_t b)