Video Filter:

- Upgrade xBRZ to v1.4.
- Add 6xBRZ pixel scaler.
This commit is contained in:
rogerman 2016-03-04 19:32:06 +00:00
parent 6b5aff79ad
commit 313dd2932f
5 changed files with 451 additions and 451 deletions

View File

@ -51,3 +51,4 @@ void Render2xBRZ(SSurface Src, SSurface Dst);
void Render3xBRZ(SSurface Src, SSurface Dst); void Render3xBRZ(SSurface Src, SSurface Dst);
void Render4xBRZ(SSurface Src, SSurface Dst); void Render4xBRZ(SSurface Src, SSurface Dst);
void Render5xBRZ(SSurface Src, SSurface Dst); void Render5xBRZ(SSurface Src, SSurface Dst);
void Render6xBRZ(SSurface Src, SSurface Dst);

View File

@ -50,7 +50,8 @@ const VideoFilterAttributes VideoFilterAttributesList[] = {
{VideoFilterTypeID_4xBRZ, "4xBRZ", &Render4xBRZ, 4, 1, 0}, {VideoFilterTypeID_4xBRZ, "4xBRZ", &Render4xBRZ, 4, 1, 0},
{VideoFilterTypeID_5xBRZ, "5xBRZ", &Render5xBRZ, 5, 1, 0}, {VideoFilterTypeID_5xBRZ, "5xBRZ", &Render5xBRZ, 5, 1, 0},
{VideoFilterTypeID_HQ3X, "HQ3x", &RenderHQ3X, 3, 1, 0}, {VideoFilterTypeID_HQ3X, "HQ3x", &RenderHQ3X, 3, 1, 0},
{VideoFilterTypeID_HQ3XS, "HQ3xS", &RenderHQ3XS, 3, 1, 0} }; {VideoFilterTypeID_HQ3XS, "HQ3xS", &RenderHQ3XS, 3, 1, 0},
{VideoFilterTypeID_6xBRZ, "6xBRZ", &Render6xBRZ, 6, 1, 0} };
// Parameters for Scanline filter // Parameters for Scanline filter
int scanline_filter_a = 0; int scanline_filter_a = 0;

View File

@ -72,6 +72,7 @@ enum VideoFilterTypeID
VideoFilterTypeID_5xBRZ, VideoFilterTypeID_5xBRZ,
VideoFilterTypeID_HQ3X, VideoFilterTypeID_HQ3X,
VideoFilterTypeID_HQ3XS, VideoFilterTypeID_HQ3XS,
VideoFilterTypeID_6xBRZ,
VideoFilterTypeIDCount // Make sure this one is always last VideoFilterTypeIDCount // Make sure this one is always last
}; };

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
// **************************************************************************** // ****************************************************************************
// * This file is part of the HqMAME project. It is distributed under * // * This file is part of the HqMAME project. It is distributed under *
// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * // * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 *
// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved *
// * * // * *
// * Additionally and as a special exception, the author gives permission * // * Additionally and as a special exception, the author gives permission *
@ -13,6 +13,8 @@
// * do so, delete this exception statement from your version. * // * do so, delete this exception statement from your version. *
// **************************************************************************** // ****************************************************************************
// 2016-03-04 (rogerman): Update to XBRZ 1.4.
//
// 2014-11-18 (rogerman): Update to XBRZ 1.1. // 2014-11-18 (rogerman): Update to XBRZ 1.1.
// //
// 2014-02-06 (rogerman): Modified for use in DeSmuME by removing C++11 code. // 2014-02-06 (rogerman): Modified for use in DeSmuME by removing C++11 code.
@ -40,16 +42,18 @@ namespace xbrz
using a modified approach of xBR: using a modified approach of xBR:
http://board.byuu.org/viewtopic.php?f=10&t=2248 http://board.byuu.org/viewtopic.php?f=10&t=2248
- new rule set preserving small image features - new rule set preserving small image features
- highly optimized for performance
- support alpha channel - support alpha channel
- support multithreading - support multithreading
- support 64-bit architectures - support 64-bit architectures
- support processing image slices - support processing image slices
- support scaling up to 6xBRZ
*/ */
enum ColorFormat //from high bits -> low bits, 8 bit per channel enum ColorFormat //from high bits -> low bits, 8 bit per channel
{ {
ColorFormatARGB, //including alpha channel, BGRA byte order on little-endian machines
ColorFormatRGB, //8 bit for each red, green, blue, upper 8 bits unused ColorFormatRGB, //8 bit for each red, green, blue, upper 8 bits unused
ColorFormatARGB, //including alpha channel, BGRA byte order on little-endian machines
}; };
/* /*
@ -61,25 +65,25 @@ enum ColorFormat //from high bits -> low bits, 8 bit per channel
in the target image data if you are using multiple threads for processing each enlarged slice! in the target image data if you are using multiple threads for processing each enlarged slice!
THREAD-SAFETY: - parts of the same image may be scaled by multiple threads as long as the [yFirst, yLast) ranges do not overlap! THREAD-SAFETY: - parts of the same image may be scaled by multiple threads as long as the [yFirst, yLast) ranges do not overlap!
- there is a minor inefficiency for the first row of a slice, so avoid processing single rows only - there is a minor inefficiency for the first row of a slice, so avoid processing single rows only; suggestion: process 8-16 rows at least
*/ */
struct ScalerCfg struct ScalerCfg
{ {
ScalerCfg() : ScalerCfg() :
luminanceWeight_(1), luminanceWeight(1),
equalColorTolerance_(30), equalColorTolerance(30),
dominantDirectionThreshold(3.6), dominantDirectionThreshold(3.6),
steepDirectionThreshold(2.2), steepDirectionThreshold(2.2),
newTestAttribute_(0) {} newTestAttribute_(0) {}
double luminanceWeight_; double luminanceWeight;
double equalColorTolerance_; double equalColorTolerance;
double dominantDirectionThreshold; double dominantDirectionThreshold;
double steepDirectionThreshold; double steepDirectionThreshold;
double newTestAttribute_; //unused; test new parameters double newTestAttribute_; //unused; test new parameters
}; };
void scale(size_t factor, //valid range: 2 - 5 void scale(size_t factor, //valid range: 2 - 6
const uint32_t* src, uint32_t* trg, int srcWidth, int srcHeight, const uint32_t* src, uint32_t* trg, int srcWidth, int srcHeight,
ColorFormat colFmt, ColorFormat colFmt,
const ScalerCfg& cfg = ScalerCfg(), const ScalerCfg& cfg = ScalerCfg(),