Skip to content

Commit

Permalink
move yuv functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jsorg71 committed Nov 18, 2017
1 parent e1bcd8e commit 8b53199
Show file tree
Hide file tree
Showing 6 changed files with 547 additions and 411 deletions.
6 changes: 4 additions & 2 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ noinst_HEADERS = \
rfxencode_rlgr3.h \
rfxencode_tile.h \
rfxencode_diff_rlgr1.h \
rfxencode_diff_rlgr3.h
rfxencode_diff_rlgr3.h \
rfxencode_rgb_to_yuv.h

lib_LTLIBRARIES = librfxencode.la

librfxencode_la_SOURCES = $(noinst_HEADERS) rfxencode.c \
rfxencode_compose.c rfxencode_tile.c rfxencode_dwt.c \
rfxencode_quantization.c rfxencode_differential.c \
rfxencode_rlgr1.c rfxencode_rlgr3.c rfxencode_alpha.c \
rfxencode_diff_rlgr1.c rfxencode_diff_rlgr3.c
rfxencode_diff_rlgr1.c rfxencode_diff_rlgr3.c \
rfxencode_rgb_to_yuv.c
7 changes: 5 additions & 2 deletions src/rfxencode.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "rfxencode_dwt.h"
#include "rfxencode_diff_rlgr1.h"
#include "rfxencode_diff_rlgr3.h"
#include "rfxencode_rgb_to_yuv.h"

#ifdef RFX_USE_ACCEL_X86
#include "x86/funcs_x86.h"
Expand All @@ -59,7 +60,7 @@ rfxcodec_encode_create_ex(int width, int height, int format, int flags,
int dx;

enc = (struct rfxencode *) calloc(1, sizeof(struct rfxencode));
if (enc == 0)
if (enc == NULL)
{
return 1;
}
Expand Down Expand Up @@ -153,6 +154,8 @@ rfxcodec_encode_create_ex(int width, int height, int format, int flags,
return 2;
}
enc->format = format;
enc->rfx_encode_rgb_to_yuv = rfx_encode_rgb_to_yuv;
enc->rfx_encode_argb_to_yuva = rfx_encode_argb_to_yuva;
/* assign encoding functions */
if (flags & RFX_FLAGS_NOACCEL)
{
Expand Down Expand Up @@ -294,7 +297,7 @@ rfxcodec_encode_destroy(void *handle)
struct rfxencode *enc;

enc = (struct rfxencode *) handle;
if (enc == 0)
if (enc == NULL)
{
return 0;
}
Expand Down
10 changes: 10 additions & 0 deletions src/rfxencode.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@

struct rfxencode;

typedef int (*rfx_encode_rgb_to_yuv_proc)(struct rfxencode *enc,
const char *rgb_data,
int width, int height,
int stride_bytes);
typedef int (*rfx_encode_argb_to_yuva_proc)(struct rfxencode *enc,
const char *argb_data,
int width, int height,
int stride_bytes);
typedef int (*rfx_encode_proc)(struct rfxencode *enc, const char *qtable,
const uint8 *data,
uint8 *buffer, int buffer_size, int *size);
Expand Down Expand Up @@ -51,6 +59,8 @@ struct rfxencode
sint16 *dwt_buffer1;
sint16 *dwt_buffer2;
rfx_encode_proc rfx_encode;
rfx_encode_rgb_to_yuv_proc rfx_encode_rgb_to_yuv;
rfx_encode_argb_to_yuva_proc rfx_encode_argb_to_yuva;

int got_sse2;
int got_sse3;
Expand Down
Loading

0 comments on commit 8b53199

Please sign in to comment.