Go to the documentation of this file.
54 int tid, wt, maxtab,
i, j;
72 s->maxval,
s->t1,
s->t2,
s->t3,
s->reset);
94 else if ((5 + wt*(
s->maxval+1)) < 65535)
97 maxtab = 65530/wt - 1;
100 av_log(
s->avctx,
AV_LOG_DEBUG,
"LSE palette %d tid:%d wt:%d maxtab:%d\n",
id, tid, wt, maxtab);
106 maxtab =
FFMIN(maxtab, (
len - 5) / wt +
s->palette_index);
108 if (
s->palette_index > maxtab)
113 uint32_t *pal = (uint32_t *)
s->picture_ptr->data[1];
116 if (
s->avctx->bits_per_raw_sample > 0 &&
s->avctx->bits_per_raw_sample < 8) {
117 maxtab =
FFMIN(maxtab, (1<<
s->avctx->bits_per_raw_sample)-1);
118 shift = 8 -
s->avctx->bits_per_raw_sample;
121 s->picture_ptr->format =
123 for (
i=
s->palette_index;
i<=maxtab;
i++) {
126 for (j=0; j<wt; j++) {
127 pal[k] |=
get_bits(&
s->gb, 8) << (8*(wt-j-1));
130 s->palette_index =
i;
140 ff_dlog(
s->avctx,
"ID=%i, T=%i,%i,%i\n",
id,
s->t1,
s->t2,
s->t3);
152 for (k = 0; (
state->N[Q] << k) <
state->A[Q]; k++)
180 int RItype,
int limit_add)
183 int Q = 365 + RItype;
189 for (k = 0; (
state->N[Q] << k) <
temp; k++)
201 if (!k && (RItype ||
ret) && (2 *
state->B[Q] <
state->N[Q]))
226 void *last,
void *dst,
int last2,
int w,
260 for (
i = 0;
i <
r;
i++) {
279 for (
i = 0;
i <
r;
i++) {
292 RItype = (
FFABS(Ra - Rb) <=
state->near) ? 1 : 0;
298 if (
state->near && RItype) {
333 if (pred < -state->near)
349 int point_transform,
int ilv)
355 int decoded_height = 0;
361 cur =
s->picture_ptr->data[0];
370 state->bpp = (
s->bits < 2) ? 2 :
s->bits;
371 state->maxval =
s->maxval;
380 shift = point_transform + (8 -
s->bits);
382 shift = point_transform + (16 -
s->bits);
391 "JPEG-LS params: %ix%i NEAR=%i MV=%i T(%i,%i,%i) "
392 "RESET=%i, LIMIT=%i, qbpp=%i, RANGE=%i\n",
397 ilv, point_transform,
s->bits,
s->cur_scan);
404 if (
s->cur_scan >
s->nb_components) {
408 stride = (
s->nb_components > 1) ? 3 : 1;
409 off = av_clip(
s->cur_scan - 1, 0,
stride - 1);
412 for (
i = 0;
i <
s->height;
i++) {
419 t = *((uint16_t *)last);
424 cur +=
s->picture_ptr->linesize[0];
426 if (
s->restart_interval && !--
s->restart_count) {
432 }
else if (ilv == 1) {
434 int Rc[3] = { 0, 0, 0 };
435 stride = (
s->nb_components > 1) ? 3 : 1;
436 memset(cur, 0,
s->picture_ptr->linesize[0]);
438 for (
i = 0;
i <
s->height;
i++) {
440 for (j = 0; j <
stride; j++) {
447 if (
s->restart_interval && !--
s->restart_count) {
455 cur +=
s->picture_ptr->linesize[0];
458 }
else if (ilv == 2) {
468 if (
s->xfrm &&
s->nb_components == 3) {
471 w =
s->width *
s->nb_components;
476 for (
i = 0;
i <
s->height;
i++) {
479 for (
x = off;
x <
w;
x += 3) {
485 for (
x = off;
x <
w;
x += 3) {
491 for (
x = off;
x <
w;
x += 3) {
499 for (
x = off;
x <
w;
x += 3) {
500 int r =
src[
x+0] - (( 359 * (
src[
x+2]-128) + 490) >> 8);
501 int g =
src[
x+0] - (( 88 * (
src[
x+1]-128) - 183 * (
src[
x+2]-128) + 30) >> 8);
502 int b =
src[
x+0] + ((454 * (
src[
x+1]-128) + 574) >> 8);
503 src[
x+0] = av_clip_uint8(
r);
504 src[
x+1] = av_clip_uint8(
g);
505 src[
x+2] = av_clip_uint8(
b);
509 src +=
s->picture_ptr->linesize[0];
518 w =
s->width *
s->nb_components;
523 for (
i = 0;
i < decoded_height;
i++) {
526 src +=
s->picture_ptr->linesize[0];
529 uint16_t *
src = (uint16_t *)
s->picture_ptr->data[0];
531 for (
i = 0;
i < decoded_height;
i++) {
532 for (
x = 0;
x <
w;
x++)
534 src +=
s->picture_ptr->linesize[0] / 2;
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
static av_cold int init(AVCodecContext *avctx)
static unsigned int show_bits_long(GetBitContext *s, int n)
Show 0-32 bits.
static int get_bits_left(GetBitContext *gb)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static void comp(unsigned char *dst, ptrdiff_t dst_stride, unsigned char *src, ptrdiff_t src_stride, int add)
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static av_cold int end(AVCodecContext *avctx)
static int ls_get_code_regular(GetBitContext *gb, JLSState *state, int Q)
Get context-dependent Golomb code, decode it and update context.
#define FF_DEBUG_PICT_INFO
static void skip_bits(GetBitContext *s, int n)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo x
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int esc_len)
read unsigned golomb rice code (jpegls).
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transform, int ilv)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static int ls_decode_line(JLSState *state, MJpegDecodeContext *s, void *last, void *dst, int last2, int w, int stride, int comp, int bits)
Decode one line of image.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
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 context
static void ff_jpegls_downscale_state(JLSState *state, int Q)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
const uint8_t ff_log2_run[41]
static unsigned int get_bits1(GetBitContext *s)
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
int ff_jpegls_decode_lse(MJpegDecodeContext *s)
Decode LSE block with initialization parameters.
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
static int ff_jpegls_quantize(JLSState *s, int v)
Calculate quantized gradient value, used for context determination.
int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
#define i(width, name, range_min, range_max)
void ff_jpegls_init_state(JLSState *state)
Calculate initial JPEG-LS parameters.
static int ff_jpegls_update_state_regular(JLSState *state, int Q, int err)
const char * name
Name of the codec implementation.
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
static const float pred[4]
static int ls_get_code_runterm(GetBitContext *gb, JLSState *state, int RItype, int limit_add)
Get Golomb code, decode it and update state for run termination.
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo ug o o w
static const uint8_t * align_get_bits(GetBitContext *s)
void ff_jpegls_reset_coding_parameters(JLSState *s, int reset_all)
Calculate JPEG-LS codec values.
static int shift(int a, int b)
#define avpriv_request_sample(...)
const VDPAUPixFmtMap * map
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
AVCodec ff_jpegls_decoder