25 int plane_index,
int bits)
37 if (
s->slice_coding_mode == 1) {
39 for (x = 0; x <
w; x++) {
41 for (i=0; i<
bits; i++) {
50 for (x = 0; x <
w; x++) {
70 if (context == 0 && run_mode == 0)
74 if (run_count == 0 && run_mode == 1) {
77 if (x + run_count <= w)
90 while (run_count > 1 && w-x > 1) {
96 while (run_count > 1 && w-x > 1) {
115 ff_dlog(
s->avctx,
"count:%d index:%d, mode:%d, x:%d pos:%d\n",
120 diff = -(unsigned)diff;
132 int lbd =
s->avctx->bits_per_raw_sample <= 8;
133 int bits =
s->avctx->bits_per_raw_sample > 0 ?
s->avctx->bits_per_raw_sample : 8;
137 for (x = 0; x < 4; x++) {
138 sample[x][0] =
RENAME(
s->sample_buffer) + x * 2 * (
w + 6) + 3;
139 sample[x][1] =
RENAME(
s->sample_buffer) + (x * 2 + 1) * (
w + 6) + 3;
144 memset(
RENAME(
s->sample_buffer), 0, 8 * (
w + 6) *
sizeof(*
RENAME(
s->sample_buffer)));
146 for (y = 0; y <
h; y++) {
151 sample[p][0] = sample[p][1];
154 sample[p][1][-1]= sample[p][0][0 ];
155 sample[p][0][
w]= sample[p][0][
w-1];
156 if (lbd &&
s->slice_coding_mode == 0)
157 ret =
RENAME(decode_line)(
s,
w, sample[p], (p + 1)/2, 9);
159 ret =
RENAME(decode_line)(
s,
w, sample[p], (p + 1)/2, bits + (
s->slice_coding_mode != 1));
163 for (x = 0; x <
w; x++) {
164 int g = sample[0][1][x];
165 int b = sample[1][1][x];
166 int r = sample[2][1][x];
167 int a = sample[3][1][x];
169 if (
s->slice_coding_mode != 1) {
172 g -= (b *
s->slice_rct_by_coef + r *
s->slice_rct_ry_coef) >> 2;
178 *((uint32_t*)(
src[0] + x*4 +
stride[0]*y)) = b + ((
unsigned)g<<8) + ((
unsigned)r<<16) + ((
unsigned)a<<24);
180 *((uint16_t*)(
src[0] + x*2 +
stride[0]*y)) = g;
181 *((uint16_t*)(
src[1] + x*2 +
stride[1]*y)) = b;
182 *((uint16_t*)(
src[2] + x*2 +
stride[2]*y)) = r;
184 *((uint16_t*)(
src[3] + x*2 +
stride[3]*y)) = a;
186 *((uint16_t*)(
src[0] + x*2 +
stride[0]*y)) = b;
187 *((uint16_t*)(
src[1] + x*2 +
stride[1]*y)) = g;
188 *((uint16_t*)(
src[2] + x*2 +
stride[2]*y)) = r;
const uint8_t ff_log2_run[41]
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
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)
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
static av_always_inline void predict(PredictorState *ps, float *coef, int output_enable)
static int is_input_end(FFV1Context *s)
static int get_rac(RangeCoder *c, uint8_t *const state)
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static int get_bits_count(const GetBitContext *s)
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)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option keep it simple and lowercase description are in without and describe what they for example set the foo of the bar offset is the offset of the field in your local context