render: ensure correct yuv range handling

This commit is contained in:
itsmattkc
2022-07-20 23:16:08 -07:00
parent 5ea97f7a64
commit 187568324a
10 changed files with 96 additions and 176 deletions
+1
View File
@@ -548,6 +548,7 @@ ExportParams ExportDialog::GenerateParams() const
params.set_color_transform(video_tab_->CurrentOCIOColorSpace());
params.set_video_pix_fmt(video_tab_->pix_fmt());
params.set_video_color_range(video_tab_->yuv_range());
params.set_video_is_image_sequence(video_tab_->IsImageSequenceSet());
}
@@ -31,6 +31,12 @@ ExportAdvancedVideoDialog::ExportAdvancedVideoDialog(const QList<QString> &pix_f
pixel_layout->addWidget(pixel_format_combobox_, row, 1);
row++;
pixel_layout->addWidget(new QLabel(tr("YUV Color Range:")), row, 0);
yuv_color_range_combobox_ = new QComboBox();
yuv_color_range_combobox_->addItems({tr("MPEG (16-235)"), tr("JPEG (0-255)")});
pixel_layout->addWidget(yuv_color_range_combobox_, row, 1);
}
{
@@ -4,6 +4,7 @@
#include <QComboBox>
#include <QDialog>
#include "codec/encoder.h"
#include "widget/slider/integerslider.h"
namespace olive {
@@ -35,11 +36,23 @@ public:
pixel_format_combobox_->setCurrentText(s);
}
EncodingParams::YUVRange yuv_range() const
{
return static_cast<EncodingParams::YUVRange>(yuv_color_range_combobox_->currentIndex());
}
void set_yuv_range(EncodingParams::YUVRange i)
{
yuv_color_range_combobox_->setCurrentIndex(i);
}
private:
IntegerSlider* thread_slider_;
QComboBox* pixel_format_combobox_;
QComboBox* yuv_color_range_combobox_;
};
}
+4 -1
View File
@@ -36,7 +36,8 @@ namespace olive {
ExportVideoTab::ExportVideoTab(ColorManager* color_manager, QWidget *parent) :
QWidget(parent),
color_manager_(color_manager),
threads_(0)
threads_(0),
yuv_range_(EncodingParams::kYUVDefault)
{
QVBoxLayout* outer_layout = new QVBoxLayout(this);
@@ -211,10 +212,12 @@ void ExportVideoTab::OpenAdvancedDialog()
d.set_threads(threads_);
d.set_pix_fmt(pix_fmt_);
d.set_yuv_range(yuv_range_);
if (d.exec() == QDialog::Accepted) {
threads_ = d.threads();
pix_fmt_ = d.pix_fmt();
yuv_range_ = d.yuv_range();
}
}
+8 -1
View File
@@ -133,10 +133,16 @@ public:
return threads_;
}
const QString& pix_fmt() const {
const QString& pix_fmt() const
{
return pix_fmt_;
}
EncodingParams::YUVRange yuv_range() const
{
return yuv_range_;
}
public slots:
void VideoCodecChanged();
@@ -177,6 +183,7 @@ private:
int threads_;
QString pix_fmt_;
EncodingParams::YUVRange yuv_range_;
ExportFormat::Format format_;