Skip to content

Commit

Permalink
change encode function name
Browse files Browse the repository at this point in the history
  • Loading branch information
jsorg71 committed Feb 12, 2016
1 parent 96a96fa commit 845ee8c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
8 changes: 7 additions & 1 deletion include/rfxcodec_encode.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ rfxcodec_encode(void *handle, char *cdata, int *cdata_bytes,
char *buf, int width, int height, int stride_bytes,
const struct rfx_rect *region, int num_region,
const struct rfx_tile *tiles, int num_tiles,
const char *quants, int num_quants, int flags);
const char *quants, int num_quants);
int
rfxcodec_encode_ex(void *handle, char *cdata, int *cdata_bytes,
char *buf, int width, int height, int stride_bytes,
const struct rfx_rect *region, int num_region,
const struct rfx_tile *tiles, int num_tiles,
const char *quants, int num_quants, int flags);

#endif
24 changes: 19 additions & 5 deletions src/rfxencode.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,11 @@ rfxcodec_encode_destroy(void * handle)

/******************************************************************************/
int
rfxcodec_encode(void *handle, char *cdata, int *cdata_bytes,
char *buf, int width, int height, int stride_bytes,
const struct rfx_rect *regions, int num_regions,
const struct rfx_tile *tiles, int num_tiles,
const char *quants, int num_quants, int flags)
rfxcodec_encode_ex(void *handle, char *cdata, int *cdata_bytes,
char *buf, int width, int height, int stride_bytes,
const struct rfx_rect *regions, int num_regions,
const struct rfx_tile *tiles, int num_tiles,
const char *quants, int num_quants, int flags)
{
struct rfxencode *enc;
STREAM s;
Expand Down Expand Up @@ -327,3 +327,17 @@ rfxcodec_encode(void *handle, char *cdata, int *cdata_bytes,
*cdata_bytes = (int) (s.p - s.data);
return 0;
}

/******************************************************************************/
int
rfxcodec_encode(void *handle, char *cdata, int *cdata_bytes,
char *buf, int width, int height, int stride_bytes,
const struct rfx_rect *regions, int num_regions,
const struct rfx_tile *tiles, int num_tiles,
const char *quants, int num_quants)
{
return rfxcodec_encode_ex(handle, cdata, cdata_bytes, buf, width, height,
stride_bytes, regions, num_regions, tiles,
num_tiles, quants, num_quants, 0);
}

12 changes: 6 additions & 6 deletions tests/rfxcodectest.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ speed_random(int count, const char *quants)
//flags = RFX_FLAGS_ALPHAV1;
for (index = 0; index < count; index++)
{
error = rfxcodec_encode(han, cdata, &cdata_bytes, buf, 64, 64, 64 * 4,
regions, num_regions, tiles, num_tiles,
quants, num_quants, flags);
error = rfxcodec_encode_ex(han, cdata, &cdata_bytes, buf, 64, 64, 64 * 4,
regions, num_regions, tiles, num_tiles,
quants, num_quants, flags);
if (error != 0)
{
break;
Expand Down Expand Up @@ -288,9 +288,9 @@ encode_file(char *data, int width, int height, char *cdata, int *cdata_bytes,
regions[0].cy = height;
num_regions = 1;

error = rfxcodec_encode(han, cdata, cdata_bytes, data, width, height, width * 4,
regions, num_regions, tiles, num_tiles,
quants, num_quants, 0);
error = rfxcodec_encode_ex(han, cdata, cdata_bytes, data, width, height, width * 4,
regions, num_regions, tiles, num_tiles,
quants, num_quants, 0);
if (error != 0)
{
printf("encode_file: rfxcodec_encode failed error %d\n", error);
Expand Down

0 comments on commit 845ee8c

Please sign in to comment.