25 int plane_index,
int bits)
34 if (
s->slice_coding_mode == 1) {
36 for (x = 0; x < w; x++) {
38 for (i=0; i<
bits; i++) {
47 for (x = 0; x < w; x++) {
48 int diff, context, sign;
62 if (context == 0 && run_mode == 0)
66 if (run_count == 0 && run_mode == 1) {
69 if (x + run_count <= w)
94 ff_dlog(
s->avctx,
"count:%d index:%d, mode:%d, x:%d pos:%d\n",
110 int lbd =
s->avctx->bits_per_raw_sample <= 8;
111 int bits =
s->avctx->bits_per_raw_sample > 0 ?
s->avctx->bits_per_raw_sample : 8;
114 for (x = 0; x < 4; x++) {
115 sample[x][0] =
RENAME(
s->sample_buffer) + x * 2 * (w + 6) + 3;
116 sample[x][1] =
RENAME(
s->sample_buffer) + (x * 2 + 1) * (w + 6) + 3;
121 memset(
RENAME(
s->sample_buffer), 0, 8 * (w + 6) *
sizeof(*
RENAME(
s->sample_buffer)));
123 for (y = 0; y <
h; y++) {
124 for (p = 0; p < 3 +
s->transparency; p++) {
127 sample[p][0] = sample[p][1];
130 sample[p][1][-1]= sample[p][0][0 ];
131 sample[p][0][ w]= sample[p][0][w-1];
132 if (lbd &&
s->slice_coding_mode == 0)
133 RENAME(decode_line)(
s, w, sample[p], (p + 1)/2, 9);
135 RENAME(decode_line)(
s, w, sample[p], (p + 1)/2, bits + (
s->slice_coding_mode != 1));
137 for (x = 0; x < w; x++) {
138 int g = sample[0][1][x];
139 int b = sample[1][1][x];
140 int r = sample[2][1][x];
141 int a = sample[3][1][x];
143 if (
s->slice_coding_mode != 1) {
146 g -= (b *
s->slice_rct_by_coef + r *
s->slice_rct_ry_coef) >> 2;
152 *((uint32_t*)(
src[0] + x*4 +
stride[0]*y)) = b + (g<<8) + (r<<16) + (a<<24);
153 else if (
sizeof(
TYPE) == 4) {
154 *((uint16_t*)(
src[0] + x*2 +
stride[0]*y)) = g;
155 *((uint16_t*)(
src[1] + x*2 +
stride[1]*y)) = b;
156 *((uint16_t*)(
src[2] + x*2 +
stride[2]*y)) = r;
158 *((uint16_t*)(
src[0] + x*2 +
stride[0]*y)) = b;
159 *((uint16_t*)(
src[1] + x*2 +
stride[1]*y)) = g;
160 *((uint16_t*)(
src[2] + x*2 +
stride[2]*y)) = r;
const uint8_t ff_log2_run[41]
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static av_flatten int get_symbol_inline(RangeCoder *c, uint8_t *state, int is_signed)
static av_always_inline void predict(PredictorState *ps, float *coef, int output_enable)
static int get_rac(RangeCoder *c, uint8_t *const state)
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
static int get_bits_count(const GetBitContext *s)
static const uint8_t offset[127][2]
static int get_vlc_symbol(GetBitContext *gb, VlcState *const state, int bits)
int context_count[MAX_QUANT_TABLES]
static unsigned int get_bits1(GetBitContext *s)
GLint GLenum GLboolean GLsizei stride
uint8_t(* state)[CONTEXT_SIZE]
static av_always_inline int diff(const uint32_t a, const uint32_t b)