mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 12:40:23 +00:00
Remove video_frame.c
This commit is contained in:
parent
279a90a01b
commit
a0e1413ecc
@ -210,7 +210,6 @@ OBJ += frontend/frontend.o \
|
|||||||
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler_filter.o \
|
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler_filter.o \
|
||||||
gfx/font_driver.o \
|
gfx/font_driver.o \
|
||||||
gfx/video_filter.o \
|
gfx/video_filter.o \
|
||||||
gfx/video_frame.o \
|
|
||||||
audio/audio_resampler_driver.o \
|
audio/audio_resampler_driver.o \
|
||||||
audio/audio_dsp_filter.o \
|
audio/audio_dsp_filter.o \
|
||||||
audio/drivers_resampler/sinc_resampler.o \
|
audio/drivers_resampler/sinc_resampler.o \
|
||||||
|
@ -1,201 +0,0 @@
|
|||||||
/* RetroArch - A frontend for libretro.
|
|
||||||
* Copyright (C) 2011-2016 - Daniel De Matteis
|
|
||||||
*
|
|
||||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
||||||
* of the GNU General Public License as published by the Free Software Found-
|
|
||||||
* ation, either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
||||||
* PURPOSE. See the GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
||||||
* If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <gfx/scaler/scaler.h>
|
|
||||||
|
|
||||||
#include <libretro.h>
|
|
||||||
|
|
||||||
#include "video_frame.h"
|
|
||||||
|
|
||||||
void video_frame_convert_rgb16_to_rgb32(
|
|
||||||
void *data,
|
|
||||||
void *output,
|
|
||||||
const void *input,
|
|
||||||
int width, int height,
|
|
||||||
int in_pitch)
|
|
||||||
{
|
|
||||||
struct scaler_ctx *scaler = (struct scaler_ctx*)data;
|
|
||||||
|
|
||||||
if (width != scaler->in_width || height != scaler->in_height)
|
|
||||||
{
|
|
||||||
scaler->in_width = width;
|
|
||||||
scaler->in_height = height;
|
|
||||||
scaler->out_width = width;
|
|
||||||
scaler->out_height = height;
|
|
||||||
scaler->in_fmt = SCALER_FMT_RGB565;
|
|
||||||
scaler->out_fmt = SCALER_FMT_ARGB8888;
|
|
||||||
scaler->scaler_type = SCALER_TYPE_POINT;
|
|
||||||
scaler_ctx_gen_filter(scaler);
|
|
||||||
}
|
|
||||||
|
|
||||||
scaler->in_stride = in_pitch;
|
|
||||||
scaler->out_stride = width * sizeof(uint32_t);
|
|
||||||
|
|
||||||
scaler_ctx_scale(scaler, output, input);
|
|
||||||
}
|
|
||||||
|
|
||||||
void video_frame_scale(
|
|
||||||
void *data,
|
|
||||||
void *output,
|
|
||||||
const void *input,
|
|
||||||
enum scaler_pix_fmt format,
|
|
||||||
unsigned scaler_width,
|
|
||||||
unsigned scaler_height,
|
|
||||||
unsigned scaler_pitch,
|
|
||||||
unsigned width,
|
|
||||||
unsigned height,
|
|
||||||
unsigned pitch)
|
|
||||||
{
|
|
||||||
struct scaler_ctx *scaler = (struct scaler_ctx*)data;
|
|
||||||
|
|
||||||
if (
|
|
||||||
width != (unsigned)scaler->in_width
|
|
||||||
|| height != (unsigned)scaler->in_height
|
|
||||||
|| format != scaler->in_fmt
|
|
||||||
|| pitch != (unsigned)scaler->in_stride
|
|
||||||
)
|
|
||||||
{
|
|
||||||
scaler->in_fmt = format;
|
|
||||||
scaler->in_width = width;
|
|
||||||
scaler->in_height = height;
|
|
||||||
scaler->in_stride = pitch;
|
|
||||||
|
|
||||||
scaler->out_width = scaler_width;
|
|
||||||
scaler->out_height = scaler_height;
|
|
||||||
scaler->out_stride = scaler_pitch;
|
|
||||||
|
|
||||||
scaler_ctx_gen_filter(scaler);
|
|
||||||
}
|
|
||||||
|
|
||||||
scaler_ctx_scale(scaler, output, input);
|
|
||||||
}
|
|
||||||
|
|
||||||
void video_frame_record_scale(
|
|
||||||
void *data,
|
|
||||||
void *output,
|
|
||||||
const void *input,
|
|
||||||
unsigned scaler_width,
|
|
||||||
unsigned scaler_height,
|
|
||||||
unsigned scaler_pitch,
|
|
||||||
unsigned width,
|
|
||||||
unsigned height,
|
|
||||||
unsigned pitch,
|
|
||||||
bool bilinear)
|
|
||||||
{
|
|
||||||
struct scaler_ctx *scaler = (struct scaler_ctx*)data;
|
|
||||||
|
|
||||||
if (
|
|
||||||
width != (unsigned)scaler->in_width
|
|
||||||
|| height != (unsigned)scaler->in_height
|
|
||||||
)
|
|
||||||
{
|
|
||||||
scaler->in_width = width;
|
|
||||||
scaler->in_height = height;
|
|
||||||
scaler->in_stride = pitch;
|
|
||||||
|
|
||||||
scaler->scaler_type = bilinear ?
|
|
||||||
SCALER_TYPE_BILINEAR : SCALER_TYPE_POINT;
|
|
||||||
|
|
||||||
scaler->out_width = scaler_width;
|
|
||||||
scaler->out_height = scaler_height;
|
|
||||||
scaler->out_stride = scaler_pitch;
|
|
||||||
|
|
||||||
scaler_ctx_gen_filter(scaler);
|
|
||||||
}
|
|
||||||
|
|
||||||
scaler_ctx_scale(scaler, output, input);
|
|
||||||
}
|
|
||||||
|
|
||||||
void video_frame_convert_argb8888_to_abgr8888(
|
|
||||||
void *data,
|
|
||||||
void *output, const void *input,
|
|
||||||
int width, int height, int in_pitch)
|
|
||||||
{
|
|
||||||
struct scaler_ctx *scaler = (struct scaler_ctx*)data;
|
|
||||||
|
|
||||||
if (width != scaler->in_width || height != scaler->in_height)
|
|
||||||
{
|
|
||||||
scaler->in_width = width;
|
|
||||||
scaler->in_height = height;
|
|
||||||
scaler->out_width = width;
|
|
||||||
scaler->out_height = height;
|
|
||||||
scaler->in_fmt = SCALER_FMT_ARGB8888;
|
|
||||||
scaler->out_fmt = SCALER_FMT_ABGR8888;
|
|
||||||
scaler->scaler_type = SCALER_TYPE_POINT;
|
|
||||||
scaler_ctx_gen_filter(scaler);
|
|
||||||
}
|
|
||||||
|
|
||||||
scaler->in_stride = in_pitch;
|
|
||||||
scaler->out_stride = width * sizeof(uint32_t);
|
|
||||||
scaler_ctx_scale(scaler, output, input);
|
|
||||||
}
|
|
||||||
|
|
||||||
void video_frame_convert_to_bgr24(
|
|
||||||
void *data,
|
|
||||||
void *output, const void *input,
|
|
||||||
int width, int height, int in_pitch)
|
|
||||||
{
|
|
||||||
struct scaler_ctx *scaler = (struct scaler_ctx*)data;
|
|
||||||
|
|
||||||
scaler->in_width = width;
|
|
||||||
scaler->in_height = height;
|
|
||||||
scaler->out_width = width;
|
|
||||||
scaler->out_height = height;
|
|
||||||
scaler->out_fmt = SCALER_FMT_BGR24;
|
|
||||||
scaler->scaler_type = SCALER_TYPE_POINT;
|
|
||||||
scaler_ctx_gen_filter(scaler);
|
|
||||||
|
|
||||||
scaler->in_stride = in_pitch;
|
|
||||||
scaler->out_stride = width * 3;
|
|
||||||
|
|
||||||
scaler_ctx_scale(scaler, output, input);
|
|
||||||
}
|
|
||||||
|
|
||||||
void video_frame_convert_rgba_to_bgr(
|
|
||||||
const void *src_data,
|
|
||||||
void *dst_data,
|
|
||||||
unsigned width)
|
|
||||||
{
|
|
||||||
unsigned x;
|
|
||||||
uint8_t *dst = (uint8_t*)dst_data;
|
|
||||||
const uint8_t *src = (const uint8_t*)src_data;
|
|
||||||
|
|
||||||
for (x = 0; x < width; x++, dst += 3, src += 4)
|
|
||||||
{
|
|
||||||
dst[0] = src[2];
|
|
||||||
dst[1] = src[1];
|
|
||||||
dst[2] = src[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool video_pixel_frame_scale(
|
|
||||||
void *scaler_data,
|
|
||||||
void *output, const void *data,
|
|
||||||
unsigned width, unsigned height,
|
|
||||||
size_t pitch)
|
|
||||||
{
|
|
||||||
struct scaler_ctx *scaler = (struct scaler_ctx*)scaler_data;
|
|
||||||
|
|
||||||
scaler->in_width = width;
|
|
||||||
scaler->in_height = height;
|
|
||||||
scaler->out_width = width;
|
|
||||||
scaler->out_height = height;
|
|
||||||
scaler->in_stride = pitch;
|
|
||||||
scaler->out_stride = width * sizeof(uint16_t);
|
|
||||||
|
|
||||||
scaler_ctx_scale(scaler, output, data);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
@ -18,18 +18,41 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <retro_common_api.h>
|
#include <retro_common_api.h>
|
||||||
|
#include <retro_inline.h>
|
||||||
|
|
||||||
|
#include <gfx/scaler/scaler.h>
|
||||||
|
|
||||||
|
#include <libretro.h>
|
||||||
|
|
||||||
RETRO_BEGIN_DECLS
|
RETRO_BEGIN_DECLS
|
||||||
|
|
||||||
void video_frame_convert_rgb16_to_rgb32(
|
static INLINE void video_frame_convert_rgb16_to_rgb32(
|
||||||
void *data,
|
struct scaler_ctx *scaler,
|
||||||
void *output,
|
void *output,
|
||||||
const void *input,
|
const void *input,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
int in_pitch);
|
int in_pitch)
|
||||||
|
{
|
||||||
|
if (width != scaler->in_width || height != scaler->in_height)
|
||||||
|
{
|
||||||
|
scaler->in_width = width;
|
||||||
|
scaler->in_height = height;
|
||||||
|
scaler->out_width = width;
|
||||||
|
scaler->out_height = height;
|
||||||
|
scaler->in_fmt = SCALER_FMT_RGB565;
|
||||||
|
scaler->out_fmt = SCALER_FMT_ARGB8888;
|
||||||
|
scaler->scaler_type = SCALER_TYPE_POINT;
|
||||||
|
scaler_ctx_gen_filter(scaler);
|
||||||
|
}
|
||||||
|
|
||||||
void video_frame_scale(
|
scaler->in_stride = in_pitch;
|
||||||
void *data,
|
scaler->out_stride = width * sizeof(uint32_t);
|
||||||
|
|
||||||
|
scaler_ctx_scale(scaler, output, input);
|
||||||
|
}
|
||||||
|
|
||||||
|
static INLINE void video_frame_scale(
|
||||||
|
struct scaler_ctx *scaler,
|
||||||
void *output,
|
void *output,
|
||||||
const void *input,
|
const void *input,
|
||||||
enum scaler_pix_fmt format,
|
enum scaler_pix_fmt format,
|
||||||
@ -38,10 +61,32 @@ void video_frame_scale(
|
|||||||
unsigned scaler_pitch,
|
unsigned scaler_pitch,
|
||||||
unsigned width,
|
unsigned width,
|
||||||
unsigned height,
|
unsigned height,
|
||||||
unsigned pitch);
|
unsigned pitch)
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
width != (unsigned)scaler->in_width
|
||||||
|
|| height != (unsigned)scaler->in_height
|
||||||
|
|| format != scaler->in_fmt
|
||||||
|
|| pitch != (unsigned)scaler->in_stride
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scaler->in_fmt = format;
|
||||||
|
scaler->in_width = width;
|
||||||
|
scaler->in_height = height;
|
||||||
|
scaler->in_stride = pitch;
|
||||||
|
|
||||||
void video_frame_record_scale(
|
scaler->out_width = scaler_width;
|
||||||
void *data,
|
scaler->out_height = scaler_height;
|
||||||
|
scaler->out_stride = scaler_pitch;
|
||||||
|
|
||||||
|
scaler_ctx_gen_filter(scaler);
|
||||||
|
}
|
||||||
|
|
||||||
|
scaler_ctx_scale(scaler, output, input);
|
||||||
|
}
|
||||||
|
|
||||||
|
static INLINE void video_frame_record_scale(
|
||||||
|
struct scaler_ctx *scaler,
|
||||||
void *output,
|
void *output,
|
||||||
const void *input,
|
const void *input,
|
||||||
unsigned scaler_width,
|
unsigned scaler_width,
|
||||||
@ -50,29 +95,106 @@ void video_frame_record_scale(
|
|||||||
unsigned width,
|
unsigned width,
|
||||||
unsigned height,
|
unsigned height,
|
||||||
unsigned pitch,
|
unsigned pitch,
|
||||||
bool bilinear);
|
bool bilinear)
|
||||||
|
{
|
||||||
|
if (
|
||||||
|
width != (unsigned)scaler->in_width
|
||||||
|
|| height != (unsigned)scaler->in_height
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scaler->in_width = width;
|
||||||
|
scaler->in_height = height;
|
||||||
|
scaler->in_stride = pitch;
|
||||||
|
|
||||||
void video_frame_convert_argb8888_to_abgr8888(
|
scaler->scaler_type = bilinear ?
|
||||||
void *data,
|
SCALER_TYPE_BILINEAR : SCALER_TYPE_POINT;
|
||||||
|
|
||||||
|
scaler->out_width = scaler_width;
|
||||||
|
scaler->out_height = scaler_height;
|
||||||
|
scaler->out_stride = scaler_pitch;
|
||||||
|
|
||||||
|
scaler_ctx_gen_filter(scaler);
|
||||||
|
}
|
||||||
|
|
||||||
|
scaler_ctx_scale(scaler, output, input);
|
||||||
|
}
|
||||||
|
|
||||||
|
static INLINE void video_frame_convert_argb8888_to_abgr8888(
|
||||||
|
struct scaler_ctx *scaler,
|
||||||
void *output, const void *input,
|
void *output, const void *input,
|
||||||
int width, int height, int in_pitch);
|
int width, int height, int in_pitch)
|
||||||
|
{
|
||||||
|
if (width != scaler->in_width || height != scaler->in_height)
|
||||||
|
{
|
||||||
|
scaler->in_width = width;
|
||||||
|
scaler->in_height = height;
|
||||||
|
scaler->out_width = width;
|
||||||
|
scaler->out_height = height;
|
||||||
|
scaler->in_fmt = SCALER_FMT_ARGB8888;
|
||||||
|
scaler->out_fmt = SCALER_FMT_ABGR8888;
|
||||||
|
scaler->scaler_type = SCALER_TYPE_POINT;
|
||||||
|
scaler_ctx_gen_filter(scaler);
|
||||||
|
}
|
||||||
|
|
||||||
void video_frame_convert_to_bgr24(
|
scaler->in_stride = in_pitch;
|
||||||
void *data,
|
scaler->out_stride = width * sizeof(uint32_t);
|
||||||
|
scaler_ctx_scale(scaler, output, input);
|
||||||
|
}
|
||||||
|
|
||||||
|
static INLINE void video_frame_convert_to_bgr24(
|
||||||
|
struct scaler_ctx *scaler,
|
||||||
void *output, const void *input,
|
void *output, const void *input,
|
||||||
int width, int height, int in_pitch);
|
int width, int height, int in_pitch)
|
||||||
|
{
|
||||||
|
scaler->in_width = width;
|
||||||
|
scaler->in_height = height;
|
||||||
|
scaler->out_width = width;
|
||||||
|
scaler->out_height = height;
|
||||||
|
scaler->out_fmt = SCALER_FMT_BGR24;
|
||||||
|
scaler->scaler_type = SCALER_TYPE_POINT;
|
||||||
|
|
||||||
void video_frame_convert_rgba_to_bgr(
|
scaler_ctx_gen_filter(scaler);
|
||||||
|
|
||||||
|
scaler->in_stride = in_pitch;
|
||||||
|
scaler->out_stride = width * 3;
|
||||||
|
|
||||||
|
scaler_ctx_scale(scaler, output, input);
|
||||||
|
}
|
||||||
|
|
||||||
|
static INLINE void video_frame_convert_rgba_to_bgr(
|
||||||
const void *src_data,
|
const void *src_data,
|
||||||
void *dst_data,
|
void *dst_data,
|
||||||
unsigned width);
|
unsigned width)
|
||||||
|
{
|
||||||
|
unsigned x;
|
||||||
|
uint8_t *dst = (uint8_t*)dst_data;
|
||||||
|
const uint8_t *src = (const uint8_t*)src_data;
|
||||||
|
|
||||||
bool video_pixel_frame_scale(
|
for (x = 0; x < width; x++, dst += 3, src += 4)
|
||||||
void *scaler_data,
|
{
|
||||||
void *output,
|
dst[0] = src[2];
|
||||||
const void *data,
|
dst[1] = src[1];
|
||||||
|
dst[2] = src[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static INLINE bool video_pixel_frame_scale(
|
||||||
|
struct scaler_ctx *scaler,
|
||||||
|
void *output, const void *data,
|
||||||
unsigned width, unsigned height,
|
unsigned width, unsigned height,
|
||||||
size_t pitch);
|
size_t pitch)
|
||||||
|
{
|
||||||
|
scaler->in_width = width;
|
||||||
|
scaler->in_height = height;
|
||||||
|
scaler->out_width = width;
|
||||||
|
scaler->out_height = height;
|
||||||
|
scaler->in_stride = pitch;
|
||||||
|
scaler->out_stride = width * sizeof(uint16_t);
|
||||||
|
|
||||||
|
scaler_ctx_scale(scaler, output, data);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
RETRO_END_DECLS
|
RETRO_END_DECLS
|
||||||
|
|
||||||
|
@ -680,7 +680,6 @@ DYNAMIC
|
|||||||
#include "../libretro-common/dynamic/dylib.c"
|
#include "../libretro-common/dynamic/dylib.c"
|
||||||
#include "../dynamic.c"
|
#include "../dynamic.c"
|
||||||
#include "../gfx/video_filter.c"
|
#include "../gfx/video_filter.c"
|
||||||
#include "../gfx/video_frame.c"
|
|
||||||
#include "../audio/audio_dsp_filter.c"
|
#include "../audio/audio_dsp_filter.c"
|
||||||
|
|
||||||
/*============================================================
|
/*============================================================
|
||||||
|
Loading…
x
Reference in New Issue
Block a user