FFmpeg  4.3
Data Structures | Macros | Enumerations | Functions | Variables
g2meet.c File Reference
#include <inttypes.h>
#include <zlib.h>
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "blockdsp.h"
#include "bytestream.h"
#include "elsdec.h"
#include "get_bits.h"
#include "idctdsp.h"
#include "internal.h"
#include "jpegtables.h"
#include "mjpeg.h"

Go to the source code of this file.

Data Structures

struct  ePICPixListElem
 
struct  ePICPixHashElem
 
struct  ePICPixHash
 
struct  ePICContext
 
struct  JPGContext
 
struct  G2MContext
 

Macros

#define EPIC_PIX_STACK_SIZE   1024
 
#define EPIC_PIX_STACK_MAX   (EPIC_PIX_STACK_SIZE - 1)
 
#define EPIC_HASH_SIZE   256
 
#define LOAD_NEIGHBOURS(x)
 
#define UPDATE_NEIGHBOURS(x)
 
#define R_shift   16
 
#define G_shift   8
 
#define B_shift   0
 
#define TOSIGNED(val)   (((val) >> 1) ^ -((val) & 1))
 
#define APPLY_ALPHA(src, new, alpha)   src = (src * (256 - alpha) + new * alpha) >> 8
 

Enumerations

enum  ChunkType {
  DISPLAY_INFO = 0xC8, TILE_DATA, CURSOR_POS, CURSOR_SHAPE,
  CHUNK_CC, CHUNK_CD, CHUNK_TYPE_DATA = 0x4424, CHUNK_TYPE_ASF_HEADER = 0x4824,
  CHUNK_TYPE_END = 0x4524, CHUNK_TYPE_STREAM_CHANGE = 0x4324
}
 
enum  Compression { COMPR_EPIC_J_B = 2, COMPR_KEMPF_J_B }
 

Functions

static av_cold int build_vlc (VLC *vlc, const uint8_t *bits_table, const uint8_t *val_table, int nb_codes, int is_ac)
 
static av_cold int jpg_init (AVCodecContext *avctx, JPGContext *c)
 
static av_cold void jpg_free_context (JPGContext *ctx)
 
static void jpg_unescape (const uint8_t *src, int src_size, uint8_t *dst, int *dst_size)
 
static int jpg_decode_block (JPGContext *c, GetBitContext *gb, int plane, int16_t *block)
 
static void yuv2rgb (uint8_t *out, int ridx, int Y, int U, int V)
 
static int jpg_decode_data (JPGContext *c, int width, int height, const uint8_t *src, int src_size, uint8_t *dst, int dst_stride, const uint8_t *mask, int mask_stride, int num_mbs, int swapuv)
 
static int djb2_hash (uint32_t key)
 
static void epic_hash_init (ePICPixHash *hash)
 
static ePICPixHashElemepic_hash_find (const ePICPixHash *hash, uint32_t key)
 
static ePICPixHashElemepic_hash_add (ePICPixHash *hash, uint32_t key)
 
static int epic_add_pixel_to_cache (ePICPixHash *hash, uint32_t key, uint32_t pix)
 
static int epic_cache_entries_for_pixel (const ePICPixHash *hash, uint32_t pix)
 
static void epic_free_pixel_cache (ePICPixHash *hash)
 
static int is_pixel_on_stack (const ePICContext *dc, uint32_t pix)
 
static int epic_decode_component_pred (ePICContext *dc, int N, int W, int NW)
 
static uint32_t epic_decode_pixel_pred (ePICContext *dc, int x, int y, const uint32_t *curr_row, const uint32_t *above_row)
 
static int epic_predict_pixel (ePICContext *dc, uint8_t *rung, uint32_t *pPix, uint32_t pix)
 
static int epic_handle_edges (ePICContext *dc, int x, int y, const uint32_t *curr_row, const uint32_t *above_row, uint32_t *pPix)
 
static int epic_decode_run_length (ePICContext *dc, int x, int y, int tile_width, const uint32_t *curr_row, const uint32_t *above_row, const uint32_t *above2_row, uint32_t *pPix, int *pRun)
 
static int epic_predict_pixel2 (ePICContext *dc, uint8_t *rung, uint32_t *pPix, uint32_t pix)
 
static int epic_predict_from_NW_NE (ePICContext *dc, int x, int y, int run, int tile_width, const uint32_t *curr_row, const uint32_t *above_row, uint32_t *pPix)
 
static int epic_decode_from_cache (ePICContext *dc, uint32_t W, uint32_t *pPix)
 
static int epic_decode_tile (ePICContext *dc, uint8_t *out, int tile_height, int tile_width, int stride)
 
static int epic_jb_decode_tile (G2MContext *c, int tile_x, int tile_y, const uint8_t *src, size_t src_size, AVCodecContext *avctx)
 
static int kempf_restore_buf (const uint8_t *src, int len, uint8_t *dst, int stride, const uint8_t *jpeg_tile, int tile_stride, int width, int height, const uint8_t *pal, int npal, int tidx)
 
static int kempf_decode_tile (G2MContext *c, int tile_x, int tile_y, const uint8_t *src, int src_size)
 
static int g2m_init_buffers (G2MContext *c)
 
static int g2m_load_cursor (AVCodecContext *avctx, G2MContext *c, GetByteContext *gb)
 
static void g2m_paint_cursor (G2MContext *c, uint8_t *dst, int stride)
 
static int g2m_decode_frame (AVCodecContext *avctx, void *data, int *got_picture_ptr, AVPacket *avpkt)
 
static av_cold int g2m_decode_init (AVCodecContext *avctx)
 
static av_cold int g2m_decode_end (AVCodecContext *avctx)
 

Variables

static const uint8_t luma_quant [64]
 
static const uint8_t chroma_quant [64]
 
AVCodec ff_g2m_decoder
 

Detailed Description

Go2Webinar / Go2Meeting decoder

Definition in file g2meet.c.

Macro Definition Documentation

◆ EPIC_PIX_STACK_SIZE

#define EPIC_PIX_STACK_SIZE   1024

Definition at line 44 of file g2meet.c.

◆ EPIC_PIX_STACK_MAX

#define EPIC_PIX_STACK_MAX   (EPIC_PIX_STACK_SIZE - 1)

Definition at line 45 of file g2meet.c.

◆ EPIC_HASH_SIZE

#define EPIC_HASH_SIZE   256

Definition at line 94 of file g2meet.c.

◆ LOAD_NEIGHBOURS

#define LOAD_NEIGHBOURS (   x)
Value:
W = curr_row[(x) - 1]; \
N = above_row[(x)]; \
WW = curr_row[(x) - 2]; \
NW = above_row[(x) - 1]; \
NE = above_row[(x) + 1]; \
NN = above2_row[(x)]; \
NNW = above2_row[(x) - 1]; \
NWW = above_row[(x) - 2]; \
NNE = above2_row[(x) + 1]

Definition at line 370 of file g2meet.c.

◆ UPDATE_NEIGHBOURS

#define UPDATE_NEIGHBOURS (   x)
Value:
NNW = NN; \
NN = NNE; \
NWW = NW; \
NW = N; \
N = NE; \
NE = above_row[(x) + 1]; \
NNE = above2_row[(x) + 1]

Definition at line 381 of file g2meet.c.

◆ R_shift

#define R_shift   16

Definition at line 390 of file g2meet.c.

◆ G_shift

#define G_shift   8

Definition at line 391 of file g2meet.c.

◆ B_shift

#define B_shift   0

Definition at line 392 of file g2meet.c.

◆ TOSIGNED

#define TOSIGNED (   val)    (((val) >> 1) ^ -((val) & 1))

Definition at line 509 of file g2meet.c.

◆ APPLY_ALPHA

#define APPLY_ALPHA (   src,
  new,
  alpha 
)    src = (src * (256 - alpha) + new * alpha) >> 8

Definition at line 1341 of file g2meet.c.

Enumeration Type Documentation

◆ ChunkType

enum ChunkType
Enumerator
DISPLAY_INFO 
TILE_DATA 
CURSOR_POS 
CURSOR_SHAPE 
CHUNK_CC 
CHUNK_CD 
CHUNK_TYPE_DATA 
CHUNK_TYPE_ASF_HEADER 
CHUNK_TYPE_END 
CHUNK_TYPE_STREAM_CHANGE 

Definition at line 47 of file g2meet.c.

◆ Compression

Enumerator
COMPR_EPIC_J_B 
COMPR_KEMPF_J_B 

Definition at line 56 of file g2meet.c.

Function Documentation

◆ build_vlc()

static av_cold int build_vlc ( VLC vlc,
const uint8_t bits_table,
const uint8_t val_table,
int  nb_codes,
int  is_ac 
)
static

Definition at line 161 of file g2meet.c.

Referenced by jpg_init().

◆ jpg_init()

static av_cold int jpg_init ( AVCodecContext avctx,
JPGContext c 
)
static

Definition at line 182 of file g2meet.c.

Referenced by g2m_decode_init().

◆ jpg_free_context()

static av_cold void jpg_free_context ( JPGContext ctx)
static

Definition at line 211 of file g2meet.c.

Referenced by g2m_decode_end(), and g2m_decode_init().

◆ jpg_unescape()

static void jpg_unescape ( const uint8_t src,
int  src_size,
uint8_t dst,
int dst_size 
)
static

Definition at line 223 of file g2meet.c.

Referenced by jpg_decode_data().

◆ jpg_decode_block()

static int jpg_decode_block ( JPGContext c,
GetBitContext gb,
int  plane,
int16_t *  block 
)
static

Definition at line 240 of file g2meet.c.

Referenced by jpg_decode_data().

◆ yuv2rgb()

static void yuv2rgb ( uint8_t out,
int  ridx,
int  Y,
int  U,
int  V 
)
inlinestatic

Definition at line 280 of file g2meet.c.

Referenced by create_filtergraph(), jpg_decode_data(), and tonemap_opencl_init().

◆ jpg_decode_data()

static int jpg_decode_data ( JPGContext c,
int  width,
int  height,
const uint8_t src,
int  src_size,
uint8_t dst,
int  dst_stride,
const uint8_t mask,
int  mask_stride,
int  num_mbs,
int  swapuv 
)
static

Definition at line 287 of file g2meet.c.

Referenced by epic_jb_decode_tile(), and kempf_decode_tile().

◆ djb2_hash()

static int djb2_hash ( uint32_t  key)
static

Definition at line 395 of file g2meet.c.

Referenced by epic_hash_add(), and epic_hash_find().

◆ epic_hash_init()

static void epic_hash_init ( ePICPixHash hash)
static

Definition at line 407 of file g2meet.c.

Referenced by epic_jb_decode_tile().

◆ epic_hash_find()

static ePICPixHashElem* epic_hash_find ( const ePICPixHash hash,
uint32_t  key 
)
static

◆ epic_hash_add()

static ePICPixHashElem* epic_hash_add ( ePICPixHash hash,
uint32_t  key 
)
static

Definition at line 424 of file g2meet.c.

Referenced by epic_add_pixel_to_cache().

◆ epic_add_pixel_to_cache()

static int epic_add_pixel_to_cache ( ePICPixHash hash,
uint32_t  key,
uint32_t  pix 
)
static

Definition at line 447 of file g2meet.c.

Referenced by epic_decode_tile().

◆ epic_cache_entries_for_pixel()

static int epic_cache_entries_for_pixel ( const ePICPixHash hash,
uint32_t  pix 
)
inlinestatic

Definition at line 468 of file g2meet.c.

Referenced by epic_decode_tile().

◆ epic_free_pixel_cache()

static void epic_free_pixel_cache ( ePICPixHash hash)
static

Definition at line 479 of file g2meet.c.

Referenced by epic_jb_decode_tile().

◆ is_pixel_on_stack()

static int is_pixel_on_stack ( const ePICContext dc,
uint32_t  pix 
)
inlinestatic

◆ epic_decode_component_pred()

static int epic_decode_component_pred ( ePICContext dc,
int  N,
int  W,
int  NW 
)
inlinestatic

Definition at line 511 of file g2meet.c.

Referenced by epic_decode_pixel_pred().

◆ epic_decode_pixel_pred()

static uint32_t epic_decode_pixel_pred ( ePICContext dc,
int  x,
int  y,
const uint32_t *  curr_row,
const uint32_t *  above_row 
)
static

Definition at line 518 of file g2meet.c.

Referenced by epic_decode_tile().

◆ epic_predict_pixel()

static int epic_predict_pixel ( ePICContext dc,
uint8_t rung,
uint32_t *  pPix,
uint32_t  pix 
)
static

Definition at line 570 of file g2meet.c.

Referenced by epic_handle_edges().

◆ epic_handle_edges()

static int epic_handle_edges ( ePICContext dc,
int  x,
int  y,
const uint32_t *  curr_row,
const uint32_t *  above_row,
uint32_t *  pPix 
)
static

Definition at line 581 of file g2meet.c.

Referenced by epic_decode_tile().

◆ epic_decode_run_length()

static int epic_decode_run_length ( ePICContext dc,
int  x,
int  y,
int  tile_width,
const uint32_t *  curr_row,
const uint32_t *  above_row,
const uint32_t *  above2_row,
uint32_t *  pPix,
int pRun 
)
static

Definition at line 612 of file g2meet.c.

Referenced by epic_decode_tile().

◆ epic_predict_pixel2()

static int epic_predict_pixel2 ( ePICContext dc,
uint8_t rung,
uint32_t *  pPix,
uint32_t  pix 
)
static

Definition at line 747 of file g2meet.c.

Referenced by epic_predict_from_NW_NE().

◆ epic_predict_from_NW_NE()

static int epic_predict_from_NW_NE ( ePICContext dc,
int  x,
int  y,
int  run,
int  tile_width,
const uint32_t *  curr_row,
const uint32_t *  above_row,
uint32_t *  pPix 
)
static

Definition at line 758 of file g2meet.c.

Referenced by epic_decode_tile().

◆ epic_decode_from_cache()

static int epic_decode_from_cache ( ePICContext dc,
uint32_t  W,
uint32_t *  pPix 
)
static

Definition at line 786 of file g2meet.c.

Referenced by epic_decode_tile().

◆ epic_decode_tile()

static int epic_decode_tile ( ePICContext dc,
uint8_t out,
int  tile_height,
int  tile_width,
int  stride 
)
static

Definition at line 815 of file g2meet.c.

Referenced by epic_jb_decode_tile().

◆ epic_jb_decode_tile()

static int epic_jb_decode_tile ( G2MContext c,
int  tile_x,
int  tile_y,
const uint8_t src,
size_t  src_size,
AVCodecContext avctx 
)
static

Definition at line 881 of file g2meet.c.

Referenced by g2m_decode_frame().

◆ kempf_restore_buf()

static int kempf_restore_buf ( const uint8_t src,
int  len,
uint8_t dst,
int  stride,
const uint8_t jpeg_tile,
int  tile_stride,
int  width,
int  height,
const uint8_t pal,
int  npal,
int  tidx 
)
static

Definition at line 1032 of file g2meet.c.

Referenced by kempf_decode_tile().

◆ kempf_decode_tile()

static int kempf_decode_tile ( G2MContext c,
int  tile_x,
int  tile_y,
const uint8_t src,
int  src_size 
)
static

Definition at line 1067 of file g2meet.c.

Referenced by g2m_decode_frame().

◆ g2m_init_buffers()

static int g2m_init_buffers ( G2MContext c)
static

Definition at line 1178 of file g2meet.c.

Referenced by g2m_decode_frame().

◆ g2m_load_cursor()

static int g2m_load_cursor ( AVCodecContext avctx,
G2MContext c,
GetByteContext gb 
)
static

Definition at line 1222 of file g2meet.c.

Referenced by g2m_decode_frame().

◆ g2m_paint_cursor()

static void g2m_paint_cursor ( G2MContext c,
uint8_t dst,
int  stride 
)
static

Definition at line 1344 of file g2meet.c.

Referenced by g2m_decode_frame().

◆ g2m_decode_frame()

static int g2m_decode_frame ( AVCodecContext avctx,
void data,
int got_picture_ptr,
AVPacket avpkt 
)
static

Definition at line 1393 of file g2meet.c.

◆ g2m_decode_init()

static av_cold int g2m_decode_init ( AVCodecContext avctx)
static

Definition at line 1607 of file g2meet.c.

◆ g2m_decode_end()

static av_cold int g2m_decode_end ( AVCodecContext avctx)
static

Definition at line 1627 of file g2meet.c.

Variable Documentation

◆ luma_quant

const uint8_t luma_quant[64]
static
Initial value:
= {
8, 6, 5, 8, 12, 20, 26, 31,
6, 6, 7, 10, 13, 29, 30, 28,
7, 7, 8, 12, 20, 29, 35, 28,
7, 9, 11, 15, 26, 44, 40, 31,
9, 11, 19, 28, 34, 55, 52, 39,
12, 18, 28, 32, 41, 52, 57, 46,
25, 32, 39, 44, 52, 61, 60, 51,
36, 46, 48, 49, 56, 50, 52, 50
}

Definition at line 61 of file g2meet.c.

Referenced by jpg_decode_block().

◆ chroma_quant

const uint8_t chroma_quant[64]
static
Initial value:
= {
9, 9, 12, 24, 50, 50, 50, 50,
9, 11, 13, 33, 50, 50, 50, 50,
12, 13, 28, 50, 50, 50, 50, 50,
24, 33, 50, 50, 50, 50, 50, 50,
50, 50, 50, 50, 50, 50, 50, 50,
50, 50, 50, 50, 50, 50, 50, 50,
50, 50, 50, 50, 50, 50, 50, 50,
50, 50, 50, 50, 50, 50, 50, 50,
}

Definition at line 72 of file g2meet.c.

Referenced by jpg_decode_block().

◆ ff_g2m_decoder

AVCodec ff_g2m_decoder
Initial value:
= {
.name = "g2m",
.long_name = NULL_IF_CONFIG_SMALL("Go2Meeting"),
.priv_data_size = sizeof(G2MContext),
.close = g2m_decode_end,
.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
}

Definition at line 1645 of file g2meet.c.

FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:40
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
W
@ W
Definition: vf_addroi.c:26
g2m_decode_init
static av_cold int g2m_decode_init(AVCodecContext *avctx)
Definition: g2meet.c:1607
x
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
Definition: fate.txt:150
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
g2m_decode_end
static av_cold int g2m_decode_end(AVCodecContext *avctx)
Definition: g2meet.c:1627
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:50
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:186
N
#define N
Definition: af_mcompand.c:54
G2MContext
Definition: g2meet.c:131
g2m_decode_frame
static int g2m_decode_frame(AVCodecContext *avctx, void *data, int *got_picture_ptr, AVPacket *avpkt)
Definition: g2meet.c:1393
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_CODEC_ID_G2M
@ AV_CODEC_ID_G2M
Definition: codec_id.h:220