mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Some optimizations (#880)
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
// Boblight
|
||||
#include <boblightserver/BoblightServer.h>
|
||||
|
||||
|
||||
Hyperion::Hyperion(const quint8& instance)
|
||||
: QObject()
|
||||
, _instIndex(instance)
|
||||
|
@@ -60,8 +60,7 @@ void ImageResampler::processImage(const uint8_t * data, int width, int height, i
|
||||
// calculate the output size
|
||||
int outputWidth = (width - _cropLeft - cropRight - (_horizontalDecimation >> 1) + _horizontalDecimation - 1) / _horizontalDecimation;
|
||||
int outputHeight = (height - _cropTop - cropBottom - (_verticalDecimation >> 1) + _verticalDecimation - 1) / _verticalDecimation;
|
||||
if ((outputImage.height() != unsigned(outputHeight)) && (outputImage.width() != unsigned(outputWidth)))
|
||||
outputImage.resize(outputWidth, outputHeight);
|
||||
outputImage.resize(outputWidth, outputHeight);
|
||||
|
||||
for (int yDest = 0, ySource = _cropTop + (_verticalDecimation >> 1); yDest < outputHeight; ySource += _verticalDecimation, ++yDest)
|
||||
{
|
||||
@@ -71,7 +70,7 @@ void ImageResampler::processImage(const uint8_t * data, int width, int height, i
|
||||
|
||||
switch (pixelFormat)
|
||||
{
|
||||
case PixelFormat::UYVY:
|
||||
case PixelFormat::UYVY:
|
||||
{
|
||||
int index = lineLength * ySource + (xSource << 1);
|
||||
uint8_t y = data[index+1];
|
||||
@@ -123,7 +122,7 @@ void ImageResampler::processImage(const uint8_t * data, int width, int height, i
|
||||
break;
|
||||
#ifdef HAVE_JPEG_DECODER
|
||||
case PixelFormat::MJPEG:
|
||||
break;
|
||||
break;
|
||||
#endif
|
||||
case PixelFormat::NO_CHANGE:
|
||||
Error(Logger::getInstance("ImageResampler"), "Invalid pixel format given");
|
||||
|
Reference in New Issue
Block a user