@@ -74,6 +74,7 @@ H264Section::H264Section(int default_crf, QWidget *parent) :
7474
7575 // These items must correspond to the CompressionMethod enum
7676 compression_box->addItem (tr (" Constant Rate Factor" ));
77+ compression_box->addItem (tr (" Lossless" ));
7778 compression_box->addItem (tr (" Target Bit Rate" ));
7879 compression_box->addItem (tr (" Target File Size" ));
7980
@@ -87,6 +88,9 @@ H264Section::H264Section(int default_crf, QWidget *parent) :
8788 crf_section_ = new H264CRFSection (default_crf);
8889 compression_method_stack_->addWidget (crf_section_);
8990
91+ lossless_section_ = new H264LosslessSection ();
92+ compression_method_stack_->addWidget (lossless_section_);
93+
9094 bitrate_section_ = new H264BitRateSection ();
9195 compression_method_stack_->addWidget (bitrate_section_);
9296
@@ -114,6 +118,10 @@ void H264Section::AddOpts(EncodingParams *params)
114118 // Simply set CRF value
115119 params->set_video_option (QStringLiteral (" crf" ), QString::number (crf_section_->GetValue ()));
116120
121+ } else if (method == kLossless ) {
122+
123+ params->set_video_option (QStringLiteral (" qp" ), QString::number (0 ));
124+
117125 } else {
118126
119127 int64_t target_rate, max_rate, min_rate;
@@ -237,6 +245,17 @@ H264BitRateSection::H264BitRateSection(QWidget *parent) :
237245 max_rate_->SetValue (32.0 );
238246}
239247
248+ H264LosslessSection::H264LosslessSection (QWidget *parent) :
249+ QWidget (parent)
250+ {
251+ QGridLayout* layout = new QGridLayout (this );
252+ layout->setMargin (0 );
253+
254+ int row = 0 ;
255+
256+ layout->addWidget (new QLabel (tr (" For true lossless, verify the pixel format before exporting" )), row, 0 );
257+ }
258+
240259int64_t H264BitRateSection::GetTargetBitRate () const
241260{
242261 return qRound64 (target_rate_->GetValue () * 1000000.0 );
0 commit comments