FFmpeg
Loading...
Searching...
No Matches
sw_rgb.c File Reference
#include <string.h>
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem_internal.h"
#include "libavutil/pixdesc.h"
#include "libswscale/rgb2rgb.h"
#include "libswscale/swscale.h"
#include "libswscale/swscale_internal.h"
#include "checkasm.h"

Go to the source code of this file.

Macros

#define randomize_buffers(buf, size)
 
#define MAX_STRIDE   128
 
#define MAX_HEIGHT   128
 
#define NUM_LINES   5
 
#define MAX_LINE_SIZE   1920
 
#define BUFSIZE   (NUM_LINES * MAX_LINE_SIZE)
 
#define MAX_LINE_SIZE   1920
 
#define INPUT_SIZE   512
 
#define LARGEST_FILTER   16
 
#define RGB24_BENCH_WIDTH   (1920 * 3)
 
#define RGB32_BENCH_WIDTH   (1920 * 4)
 
#define RGB32_DST_SIZE   (RGB32_BENCH_WIDTH * 3 / 4 + 8)
 
#define RGB24TO32_BENCH_WIDTH   (1920 * 3)
 
#define RGB24TO32_DST_SIZE   (RGB24TO32_BENCH_WIDTH * 4 / 3 + 8)
 

Functions

static void check_shuffle_bytes (void *func, const char *report)
 
static void check_interleaved_to_planar (void *func, const char *report, int odd_tail)
 
static int cmp_off_by_n (const uint8_t *ref, const uint8_t *test, size_t n, int accuracy)
 
static void check_rgb24toyv12 (SwsContext *sws)
 
static void check_interleave_bytes (void)
 
static void check_deinterleave_bytes (void)
 
static void check_rgb_to_y (SwsContext *sws)
 
static void check_rgb_to_uv (SwsContext *sws)
 
static void check_rgba_to_a (SwsContext *sws)
 
static void check_yuv2packed1 (void)
 
static void check_yuv2packed2 (void)
 
static void check_yuv2packedX (void)
 
void checkasm_check_sw_rgb (void)
 

Variables

static const uint8_t width [] = {12, 16, 20, 32, 36, 128}
 
struct { 
 
   uint8_t   w 
 
   uint8_t   h 
 
planes [] 
 
static const int input_sizes [] = {8, 128, 1080, MAX_LINE_SIZE}
 
static enum AVPixelFormat rgb_formats []
 
static const int packed_rgb_fmts []
 

Macro Definition Documentation

◆ randomize_buffers

#define randomize_buffers ( buf,
size )
Value:
do { \
int j; \
for (j = 0; j < size; j+=4) \
AV_WN32(buf + j, rnd()); \
} while (0)
#define rnd
Definition checkasm.h:136
#define AV_WN32(p, v)
int size

Definition at line 33 of file sw_rgb.c.

Referenced by check_deinterleave_bytes(), check_interleave_bytes(), check_interleaved_to_planar(), check_rgb24toyv12(), check_rgb_to_uv(), check_rgb_to_y(), check_rgba_to_a(), check_shuffle_bytes(), check_yuv2packed1(), check_yuv2packed2(), check_yuv2packedX(), and checkasm_check_sw_rgb().

◆ MAX_STRIDE

#define MAX_STRIDE   128

Definition at line 46 of file sw_rgb.c.

◆ MAX_HEIGHT

#define MAX_HEIGHT   128

Definition at line 47 of file sw_rgb.c.

◆ NUM_LINES

#define NUM_LINES   5

Definition at line 121 of file sw_rgb.c.

◆ MAX_LINE_SIZE [1/2]

#define MAX_LINE_SIZE   1920

Definition at line 122 of file sw_rgb.c.

◆ BUFSIZE

#define BUFSIZE   (NUM_LINES * MAX_LINE_SIZE)

Definition at line 123 of file sw_rgb.c.

◆ MAX_LINE_SIZE [2/2]

#define MAX_LINE_SIZE   1920

Definition at line 122 of file sw_rgb.c.

◆ INPUT_SIZE

#define INPUT_SIZE   512

Definition at line 539 of file sw_rgb.c.

◆ LARGEST_FILTER

#define LARGEST_FILTER   16

◆ RGB24_BENCH_WIDTH

#define RGB24_BENCH_WIDTH   (1920 * 3)

Referenced by checkasm_check_sw_rgb().

◆ RGB32_BENCH_WIDTH

#define RGB32_BENCH_WIDTH   (1920 * 4)

Referenced by checkasm_check_sw_rgb().

◆ RGB32_DST_SIZE

#define RGB32_DST_SIZE   (RGB32_BENCH_WIDTH * 3 / 4 + 8)

Referenced by checkasm_check_sw_rgb().

◆ RGB24TO32_BENCH_WIDTH

#define RGB24TO32_BENCH_WIDTH   (1920 * 3)

Referenced by checkasm_check_sw_rgb().

◆ RGB24TO32_DST_SIZE

#define RGB24TO32_DST_SIZE   (RGB24TO32_BENCH_WIDTH * 4 / 3 + 8)

Referenced by checkasm_check_sw_rgb().

Function Documentation

◆ check_shuffle_bytes()

static void check_shuffle_bytes ( void * func,
const char * report )
static

Definition at line 49 of file sw_rgb.c.

Referenced by checkasm_check_sw_rgb().

◆ check_interleaved_to_planar()

static void check_interleaved_to_planar ( void * func,
const char * report,
int odd_tail )
static

Definition at line 75 of file sw_rgb.c.

Referenced by checkasm_check_sw_rgb().

◆ cmp_off_by_n()

static int cmp_off_by_n ( const uint8_t * ref,
const uint8_t * test,
size_t n,
int accuracy )
static

Definition at line 125 of file sw_rgb.c.

Referenced by check_rgb24toyv12().

◆ check_rgb24toyv12()

static void check_rgb24toyv12 ( SwsContext * sws)
static

Definition at line 134 of file sw_rgb.c.

Referenced by checkasm_check_sw_rgb().

◆ check_interleave_bytes()

static void check_interleave_bytes ( void )
static

Definition at line 208 of file sw_rgb.c.

Referenced by checkasm_check_sw_rgb().

◆ check_deinterleave_bytes()

static void check_deinterleave_bytes ( void )
static

Definition at line 276 of file sw_rgb.c.

Referenced by checkasm_check_sw_rgb().

◆ check_rgb_to_y()

static void check_rgb_to_y ( SwsContext * sws)
static

Definition at line 361 of file sw_rgb.c.

Referenced by checkasm_check_sw_rgb().

◆ check_rgb_to_uv()

static void check_rgb_to_uv ( SwsContext * sws)
static

Definition at line 406 of file sw_rgb.c.

Referenced by checkasm_check_sw_rgb().

◆ check_rgba_to_a()

static void check_rgba_to_a ( SwsContext * sws)
static

Definition at line 460 of file sw_rgb.c.

Referenced by checkasm_check_sw_rgb().

◆ check_yuv2packed1()

static void check_yuv2packed1 ( void )
static

Definition at line 541 of file sw_rgb.c.

Referenced by checkasm_check_sw_rgb().

◆ check_yuv2packed2()

static void check_yuv2packed2 ( void )
static

Definition at line 621 of file sw_rgb.c.

Referenced by checkasm_check_sw_rgb().

◆ check_yuv2packedX()

static void check_yuv2packedX ( void )
static

Definition at line 702 of file sw_rgb.c.

Referenced by checkasm_check_sw_rgb().

◆ checkasm_check_sw_rgb()

void checkasm_check_sw_rgb ( void )

Definition at line 808 of file sw_rgb.c.

Variable Documentation

◆ width

const uint8_t width[] = {12, 16, 20, 32, 36, 128}
static

Definition at line 40 of file sw_rgb.c.

◆ w

uint8_t w

Definition at line 41 of file sw_rgb.c.

◆ h

uint8_t h

Definition at line 41 of file sw_rgb.c.

◆ [struct]

const struct { ... } planes[]
Initial value:
= {
{12,16}, {16,16}, {20,23}, {32,18}, {8,128}, {128,128},
{1,1}, {1,4}, {3,8}, {13,16}, {21,9}, {63,7}, {127,5}
}

◆ input_sizes

◆ rgb_formats

enum AVPixelFormat rgb_formats[]
static
Initial value:
= {
}
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition pixfmt.h:75
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition pixfmt.h:99
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition pixfmt.h:102
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition pixfmt.h:101
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition pixfmt.h:100
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition pixfmt.h:76

Definition at line 352 of file sw_rgb.c.

Referenced by check_rgb_to_uv(), check_rgb_to_y(), and check_rgba_to_a().

◆ packed_rgb_fmts

const int packed_rgb_fmts[]
static

Definition at line 504 of file sw_rgb.c.