summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/aviio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util/aviio.c')
-rw-r--r--src/lib/util/aviio.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/lib/util/aviio.c b/src/lib/util/aviio.c
index 09dfa527036..0fd2997c1bc 100644
--- a/src/lib/util/aviio.c
+++ b/src/lib/util/aviio.c
@@ -250,15 +250,15 @@ static avi_error soundbuf_write_chunk(avi_file *file, UINT32 framenum);
static avi_error soundbuf_flush(avi_file *file, int only_flush_full);
/* RGB helpers */
-static avi_error rgb32_compress_to_rgb(avi_stream *stream, const bitmap_t *bitmap, UINT8 *data, UINT32 numbytes);
+static avi_error rgb32_compress_to_rgb(avi_stream *stream, const bitmap_t &bitmap, UINT8 *data, UINT32 numbytes);
/* YUY helpers */
-static avi_error yuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, UINT32 numbytes, bitmap_t *bitmap);
-static avi_error yuy16_compress_to_yuy(avi_stream *stream, const bitmap_t *bitmap, UINT8 *data, UINT32 numbytes);
+static avi_error yuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, UINT32 numbytes, bitmap_t &bitmap);
+static avi_error yuy16_compress_to_yuy(avi_stream *stream, const bitmap_t &bitmap, UINT8 *data, UINT32 numbytes);
/* HuffYUV helpers */
static avi_error huffyuv_extract_tables(avi_stream *stream, const UINT8 *chunkdata, UINT32 size);
-static avi_error huffyuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, UINT32 numbytes, bitmap_t *bitmap);
+static avi_error huffyuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, UINT32 numbytes, bitmap_t &bitmap);
/* debugging */
static void printf_chunk_recursive(avi_file *file, avi_chunk *chunk, int indent);
@@ -793,7 +793,7 @@ UINT32 avi_first_sample_in_frame(avi_file *file, UINT32 framenum)
converting to YUY16 format
-------------------------------------------------*/
-avi_error avi_read_video_frame_yuy16(avi_file *file, UINT32 framenum, bitmap_t *bitmap)
+avi_error avi_read_video_frame_yuy16(avi_file *file, UINT32 framenum, bitmap_t &bitmap)
{
avi_error avierr = AVIERR_NONE;
UINT32 bytes_read, chunkid;
@@ -814,7 +814,7 @@ avi_error avi_read_video_frame_yuy16(avi_file *file, UINT32 framenum, bitmap_t *
return AVIERR_INVALID_FRAME;
/* we only support YUY-style bitmaps (16bpp) */
- if (bitmap->format() != BITMAP_FORMAT_YUY16 || bitmap->width() < stream->width || bitmap->height() < stream->height)
+ if (bitmap.format() != BITMAP_FORMAT_YUY16 || bitmap.width() < stream->width || bitmap.height() < stream->height)
return AVIERR_INVALID_BITMAP;
/* expand the tempbuffer to hold the data if necessary */
@@ -957,7 +957,7 @@ avi_error avi_read_sound_samples(avi_file *file, int channel, UINT32 firstsample
of video in YUY16 format
-------------------------------------------------*/
-avi_error avi_append_video_frame_yuy16(avi_file *file, const bitmap_t *bitmap)
+avi_error avi_append_video_frame_yuy16(avi_file *file, const bitmap_t &bitmap)
{
avi_stream *stream = get_video_stream(file);
avi_error avierr;
@@ -968,7 +968,7 @@ avi_error avi_append_video_frame_yuy16(avi_file *file, const bitmap_t *bitmap)
return AVIERR_UNSUPPORTED_VIDEO_FORMAT;
/* double check bitmap format */
- if (bitmap->format() != BITMAP_FORMAT_YUY16)
+ if (bitmap.format() != BITMAP_FORMAT_YUY16)
return AVIERR_INVALID_BITMAP;
/* write out any sound data first */
@@ -1003,7 +1003,7 @@ avi_error avi_append_video_frame_yuy16(avi_file *file, const bitmap_t *bitmap)
of video in RGB32 format
-------------------------------------------------*/
-avi_error avi_append_video_frame_rgb32(avi_file *file, const bitmap_t *bitmap)
+avi_error avi_append_video_frame_rgb32(avi_file *file, const bitmap_t &bitmap)
{
avi_stream *stream = get_video_stream(file);
avi_error avierr;
@@ -1018,7 +1018,7 @@ avi_error avi_append_video_frame_rgb32(avi_file *file, const bitmap_t *bitmap)
return AVIERR_UNSUPPORTED_VIDEO_FORMAT;
/* double check bitmap format */
- if (bitmap->format() != BITMAP_FORMAT_RGB32)
+ if (bitmap.format() != BITMAP_FORMAT_RGB32)
return AVIERR_INVALID_BITMAP;
/* write out any sound data first */
@@ -2343,17 +2343,17 @@ static avi_error soundbuf_flush(avi_file *file, int only_flush_full)
bitmap to an RGB encoded frame
-------------------------------------------------*/
-static avi_error rgb32_compress_to_rgb(avi_stream *stream, const bitmap_t *bitmap, UINT8 *data, UINT32 numbytes)
+static avi_error rgb32_compress_to_rgb(avi_stream *stream, const bitmap_t &bitmap, UINT8 *data, UINT32 numbytes)
{
- int height = MIN(stream->height, bitmap->height());
- int width = MIN(stream->width, bitmap->width());
+ int height = MIN(stream->height, bitmap.height());
+ int width = MIN(stream->width, bitmap.width());
UINT8 *dataend = data + numbytes;
int x, y;
/* compressed video */
for (y = 0; y < height; y++)
{
- const UINT32 *source = &bitmap->pix32(y);
+ const UINT32 *source = &bitmap.pix32(y);
UINT8 *dest = data + (stream->height - 1 - y) * stream->width * 3;
for (x = 0; x < width && dest < dataend; x++)
@@ -2394,7 +2394,7 @@ static avi_error rgb32_compress_to_rgb(avi_stream *stream, const bitmap_t *bitma
encoded frame to a YUY16 bitmap
-------------------------------------------------*/
-static avi_error yuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, UINT32 numbytes, bitmap_t *bitmap)
+static avi_error yuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, UINT32 numbytes, bitmap_t &bitmap)
{
const UINT16 *dataend = (const UINT16 *)(data + numbytes);
int x, y;
@@ -2403,7 +2403,7 @@ static avi_error yuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data,
for (y = 0; y < stream->height; y++)
{
const UINT16 *source = (const UINT16 *)data + y * stream->width;
- UINT16 *dest = &bitmap->pix16(y);
+ UINT16 *dest = &bitmap.pix16(y);
/* switch off the compression */
switch (stream->format)
@@ -2433,7 +2433,7 @@ static avi_error yuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data,
bitmap to a YUV encoded frame
-------------------------------------------------*/
-static avi_error yuy16_compress_to_yuy(avi_stream *stream, const bitmap_t *bitmap, UINT8 *data, UINT32 numbytes)
+static avi_error yuy16_compress_to_yuy(avi_stream *stream, const bitmap_t &bitmap, UINT8 *data, UINT32 numbytes)
{
const UINT16 *dataend = (const UINT16 *)(data + numbytes);
int x, y;
@@ -2441,7 +2441,7 @@ static avi_error yuy16_compress_to_yuy(avi_stream *stream, const bitmap_t *bitma
/* compressed video */
for (y = 0; y < stream->height; y++)
{
- const UINT16 *source = &bitmap->pix16(y);
+ const UINT16 *source = &bitmap.pix16(y);
UINT16 *dest = (UINT16 *)data + y * stream->width;
/* switch off the compression */
@@ -2611,7 +2611,7 @@ error:
HuffYUV-encoded frame to a YUY16 bitmap
-------------------------------------------------*/
-static avi_error huffyuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, UINT32 numbytes, bitmap_t *bitmap)
+static avi_error huffyuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *data, UINT32 numbytes, bitmap_t &bitmap)
{
huffyuv_data *huffyuv = stream->huffyuv;
int prevlines = (stream->height > 288) ? 2 : 1;
@@ -2625,7 +2625,7 @@ static avi_error huffyuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *da
/* compressed video */
for (y = 0; y < stream->height; y++)
{
- UINT16 *dest = &bitmap->pix16(y);
+ UINT16 *dest = &bitmap.pix16(y);
/* handle the first four bytes independently */
x = 0;
@@ -2713,8 +2713,8 @@ static avi_error huffyuv_decompress_to_yuy16(avi_stream *stream, const UINT8 *da
lastprevy = lastprevcb = lastprevcr = 0;
for (y = 0; y < stream->height; y++)
{
- UINT16 *prevrow = &bitmap->pix16(y - prevlines);
- UINT16 *dest = &bitmap->pix16(y);
+ UINT16 *prevrow = &bitmap.pix16(y - prevlines);
+ UINT16 *dest = &bitmap.pix16(y);
/* handle the first four bytes independently */
x = 0;