FFmpeg  4.3
Macros | Functions | Variables
cbs_jpeg.c File Reference
#include "cbs.h"
#include "cbs_internal.h"
#include "cbs_jpeg.h"
#include "cbs_jpeg_syntax_template.c"

Go to the source code of this file.

Macros

#define HEADER(name)
 
#define CHECK(call)
 
#define SUBSCRIPTS(subs, ...)   (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL)
 
#define u(width, name, range_min, range_max)   xu(width, name, range_min, range_max, 0, )
 
#define us(width, name, sub, range_min, range_max)   xu(width, name, range_min, range_max, 1, sub)
 
#define READ
 
#define READWRITE   read
 
#define RWContext   GetBitContext
 
#define FUNC(name)   cbs_jpeg_read_ ## name
 
#define xu(width, name, range_min, range_max, subs, ...)
 
#define WRITE
 
#define READWRITE   write
 
#define RWContext   PutBitContext
 
#define FUNC(name)   cbs_jpeg_write_ ## name
 
#define xu(width, name, range_min, range_max, subs, ...)
 
#define SEGMENT(marker, type, func, free)
 
#define SEGMENT(marker, func)
 

Functions

static void cbs_jpeg_free_application_data (void *opaque, uint8_t *content)
 
static void cbs_jpeg_free_comment (void *opaque, uint8_t *content)
 
static void cbs_jpeg_free_scan (void *opaque, uint8_t *content)
 
static int cbs_jpeg_split_fragment (CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
 
static int cbs_jpeg_read_unit (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
 
static int cbs_jpeg_write_scan (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
 
static int cbs_jpeg_write_segment (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
 
static int cbs_jpeg_write_unit (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
 
static int cbs_jpeg_assemble_fragment (CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
 

Variables

const CodedBitstreamType ff_cbs_type_jpeg
 

Macro Definition Documentation

◆ HEADER

#define HEADER (   name)
Value:
do { \
ff_cbs_trace_header(ctx, name); \
} while (0)

Definition at line 24 of file cbs_jpeg.c.

◆ CHECK

#define CHECK (   call)
Value:
do { \
err = (call); \
if (err < 0) \
return err; \
} while (0)

Definition at line 28 of file cbs_jpeg.c.

◆ SUBSCRIPTS

#define SUBSCRIPTS (   subs,
  ... 
)    (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL)

Definition at line 34 of file cbs_jpeg.c.

◆ u

#define u (   width,
  name,
  range_min,
  range_max 
)    xu(width, name, range_min, range_max, 0, )

Definition at line 36 of file cbs_jpeg.c.

◆ us

#define us (   width,
  name,
  sub,
  range_min,
  range_max 
)    xu(width, name, range_min, range_max, 1, sub)

Definition at line 38 of file cbs_jpeg.c.

◆ READ

#define READ

Definition at line 42 of file cbs_jpeg.c.

◆ READWRITE [1/2]

#define READWRITE   read

Definition at line 64 of file cbs_jpeg.c.

◆ RWContext [1/2]

#define RWContext   GetBitContext

Definition at line 65 of file cbs_jpeg.c.

◆ FUNC [1/2]

#define FUNC (   name)    cbs_jpeg_read_ ## name

Definition at line 66 of file cbs_jpeg.c.

◆ xu [1/2]

#define xu (   width,
  name,
  range_min,
  range_max,
  subs,
  ... 
)
Value:
do { \
uint32_t value; \
SUBSCRIPTS(subs, __VA_ARGS__), \
&value, range_min, range_max)); \
current->name = value; \
} while (0)

Definition at line 68 of file cbs_jpeg.c.

◆ WRITE

#define WRITE

Definition at line 63 of file cbs_jpeg.c.

◆ READWRITE [2/2]

#define READWRITE   write

Definition at line 64 of file cbs_jpeg.c.

◆ RWContext [2/2]

#define RWContext   PutBitContext

Definition at line 65 of file cbs_jpeg.c.

◆ FUNC [2/2]

#define FUNC (   name)    cbs_jpeg_write_ ## name

Definition at line 66 of file cbs_jpeg.c.

◆ xu [2/2]

#define xu (   width,
  name,
  range_min,
  range_max,
  subs,
  ... 
)
Value:
do { \
uint32_t value = current->name; \
SUBSCRIPTS(subs, __VA_ARGS__), \
value, range_min, range_max)); \
} while (0)

Definition at line 68 of file cbs_jpeg.c.

◆ SEGMENT [1/2]

#define SEGMENT (   marker,
  type,
  func,
  free 
)
Value:
case JPEG_MARKER_ ## marker: \
{ \
sizeof(type), free); \
if (err < 0) \
return err; \
err = cbs_jpeg_read_ ## func(ctx, &gbc, unit->content); \
if (err < 0) \
return err; \
} \
break

◆ SEGMENT [2/2]

#define SEGMENT (   marker,
  func 
)
Value:
case JPEG_MARKER_ ## marker: \
err = cbs_jpeg_write_ ## func(ctx, pbc, unit->content); \
break;

Function Documentation

◆ cbs_jpeg_free_application_data()

static void cbs_jpeg_free_application_data ( void opaque,
uint8_t content 
)
static

Definition at line 85 of file cbs_jpeg.c.

Referenced by cbs_jpeg_read_unit().

◆ cbs_jpeg_free_comment()

static void cbs_jpeg_free_comment ( void opaque,
uint8_t content 
)
static

Definition at line 92 of file cbs_jpeg.c.

Referenced by cbs_jpeg_read_unit().

◆ cbs_jpeg_free_scan()

static void cbs_jpeg_free_scan ( void opaque,
uint8_t content 
)
static

Definition at line 99 of file cbs_jpeg.c.

Referenced by cbs_jpeg_read_unit().

◆ cbs_jpeg_split_fragment()

static int cbs_jpeg_split_fragment ( CodedBitstreamContext ctx,
CodedBitstreamFragment frag,
int  header 
)
static

Definition at line 106 of file cbs_jpeg.c.

◆ cbs_jpeg_read_unit()

static int cbs_jpeg_read_unit ( CodedBitstreamContext ctx,
CodedBitstreamUnit unit 
)
static

Definition at line 242 of file cbs_jpeg.c.

◆ cbs_jpeg_write_scan()

static int cbs_jpeg_write_scan ( CodedBitstreamContext ctx,
CodedBitstreamUnit unit,
PutBitContext pbc 
)
static

Definition at line 327 of file cbs_jpeg.c.

Referenced by cbs_jpeg_write_unit().

◆ cbs_jpeg_write_segment()

static int cbs_jpeg_write_segment ( CodedBitstreamContext ctx,
CodedBitstreamUnit unit,
PutBitContext pbc 
)
static

Definition at line 353 of file cbs_jpeg.c.

Referenced by cbs_jpeg_write_unit().

◆ cbs_jpeg_write_unit()

static int cbs_jpeg_write_unit ( CodedBitstreamContext ctx,
CodedBitstreamUnit unit,
PutBitContext pbc 
)
static

Definition at line 382 of file cbs_jpeg.c.

◆ cbs_jpeg_assemble_fragment()

static int cbs_jpeg_assemble_fragment ( CodedBitstreamContext ctx,
CodedBitstreamFragment frag 
)
static

Definition at line 392 of file cbs_jpeg.c.

Variable Documentation

◆ ff_cbs_type_jpeg

const CodedBitstreamType ff_cbs_type_jpeg
Initial value:
= {
.codec_id = AV_CODEC_ID_MJPEG,
.split_fragment = &cbs_jpeg_split_fragment,
.read_unit = &cbs_jpeg_read_unit,
.write_unit = &cbs_jpeg_write_unit,
.assemble_fragment = &cbs_jpeg_assemble_fragment,
}

Definition at line 460 of file cbs_jpeg.c.

func
int(* func)(AVBPrint *dst, const char *in, const char *arg)
Definition: jacosubdec.c:67
name
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 name
Definition: writing_filters.txt:88
rw
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 rw
Definition: fate.txt:150
ff_cbs_write_unsigned
int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, int width, const char *name, const int *subscripts, uint32_t value, uint32_t range_min, uint32_t range_max)
Definition: cbs.c:528
type
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 type
Definition: writing_filters.txt:86
width
#define width
cbs_jpeg_assemble_fragment
static int cbs_jpeg_assemble_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Definition: cbs_jpeg.c:392
ctx
AVFormatContext * ctx
Definition: movenc.c:48
cbs_jpeg_read_unit
static int cbs_jpeg_read_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Definition: cbs_jpeg.c:242
SUBSCRIPTS
#define SUBSCRIPTS(subs,...)
Definition: cbs_jpeg.c:34
AV_CODEC_ID_MJPEG
@ AV_CODEC_ID_MJPEG
Definition: codec_id.h:56
value
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 value
Definition: writing_filters.txt:86
ff_cbs_read_unsigned
int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, int width, const char *name, const int *subscripts, uint32_t *write_to, uint32_t range_min, uint32_t range_max)
Definition: cbs.c:485
cbs_jpeg_split_fragment
static int cbs_jpeg_split_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
Definition: cbs_jpeg.c:106
cbs_jpeg_write_unit
static int cbs_jpeg_write_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
Definition: cbs_jpeg.c:382
ff_cbs_alloc_unit_content
int ff_cbs_alloc_unit_content(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, size_t size, void(*free)(void *opaque, uint8_t *data))
Definition: cbs.c:644