25 int plane_index,
int bits)
30 int run_index =
s->run_index;
34 if (
s->slice_coding_mode == 1) {
36 if (
c->bytestream_end -
c->bytestream < (
w *
bits + 7LL)>>3) {
41 for (x = 0; x <
w; x++) {
53 if (
c->bytestream_end -
c->bytestream <
w * 35) {
64 for (x = 0; x <
w; x++) {
108 ff_dlog(
s->avctx,
"count:%d index:%d, mode:%d, x:%d pos:%d\n",
109 run_count, run_index, run_mode, x,
126 s->run_index = run_index;
135 const int ring_size =
s->context_model ? 3 : 2;
137 int lbd =
s->bits_per_raw_sample <= 8;
138 int packed = !
src[1];
139 int bits =
s->bits_per_raw_sample > 0 ?
s->bits_per_raw_sample : 8;
141 int transparency =
s->transparency;
142 int packed_size = (3 + transparency)*2;
150 (
w + 6) *
sizeof(*
RENAME(
s->sample_buffer)));
152 for (y = 0; y <
h; y++) {
157 for (x = 0; x <
w; x++) {
160 unsigned v = *((
const uint32_t*)(
src[0] + x*4 +
stride[0]*y));
163 r = (v >> 16) & 0xFF;
166 const uint16_t *p = ((
const uint16_t*)(
src[0] + x*packed_size +
stride[0]*y));
172 }
else if (
sizeof(
TYPE) == 4 || transparency) {
173 g = *((
const uint16_t *)(
src[0] + x*2 +
stride[0]*y));
174 b = *((
const uint16_t *)(
src[1] + x*2 +
stride[1]*y));
175 r = *((
const uint16_t *)(
src[2] + x*2 +
stride[2]*y));
177 a = *((
const uint16_t *)(
src[3] + x*2 +
stride[3]*y));
179 b = *((
const uint16_t *)(
src[0] + x*2 +
stride[0]*y));
180 g = *((
const uint16_t *)(
src[1] + x*2 +
stride[1]*y));
181 r = *((
const uint16_t *)(
src[2] + x*2 +
stride[2]*y));
184 if (
s->slice_coding_mode != 1) {
187 g += (
b *
s->slice_rct_by_coef +
r *
s->slice_rct_ry_coef) >> 2;
197 for (p = 0; p < 3 + transparency; p++) {
201 if (lbd &&
s->slice_coding_mode == 0)
static int ring_size(RingBuffer *ring)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
const uint8_t ff_log2_run[41]
static av_always_inline int fold(int diff, int bits)
static int RENAME() get_context(PlaneContext *p, TYPE *src, TYPE *last, TYPE *last2)
static void put_vlc_symbol(PutBitContext *pb, VlcState *const state, int v, int bits)
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 RENAME() encode_rgb_frame(FFV1Context *s, const uint8_t *src[4], int w, int h, const int stride[4])
static av_always_inline int RENAME() encode_line(FFV1Context *s, int w, TYPE *const sample[3], int plane_index, int bits)
#define AV_CODEC_FLAG_PASS1
Use internal 2pass ratecontrol in first pass mode.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
static av_always_inline void predict(PredictorState *ps, float *coef, int output_enable)
static int put_bits_count(PutBitContext *s)
uint8_t(* state)[CONTEXT_SIZE]
static av_always_inline int diff(const uint32_t a, const uint32_t b)
static const uint8_t offset[127][2]