MCPcopy Create free account
hub / github.com/IENT/YUView / allocateNewDecoder

Method allocateNewDecoder

YUViewLib/src/decoder/decoderLibde265.cpp:247–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247void decoderLibde265::allocateNewDecoder()
248{
249 if (this->decoder != nullptr)
250 return;
251 if (this->decoderState == DecoderState::Error)
252 return;
253
254 DEBUG_LIBDE265("decoderLibde265::allocateNewDecoder - decodeSignal %d", this->decodeSignal);
255
256 // Create new decoder object
257 this->decoder = this->lib.de265_new_decoder();
258 if (!this->decoder)
259 {
260 this->decoderState = DecoderState::Error;
261 setError("Error allocating decoder (de265_new_decoder)");
262 return;
263 }
264
265 // Set some decoder parameters
266 this->lib.de265_set_parameter_bool(this->decoder, DE265_DECODER_PARAM_BOOL_SEI_CHECK_HASH, false);
267 this->lib.de265_set_parameter_bool(
268 this->decoder, DE265_DECODER_PARAM_SUPPRESS_FAULTY_PICTURES, false);
269
270 this->lib.de265_set_parameter_bool(this->decoder, DE265_DECODER_PARAM_DISABLE_DEBLOCKING, false);
271 this->lib.de265_set_parameter_bool(this->decoder, DE265_DECODER_PARAM_DISABLE_SAO, false);
272
273 // Set retrieval of the right component
274 if (this->nrSignals > 0)
275 {
276 if (this->decodeSignal == 1)
277 this->lib.de265_internals_set_parameter_bool(
278 this->decoder, DE265_INTERNALS_DECODER_PARAM_SAVE_PREDICTION, true);
279 else if (decodeSignal == 2)
280 this->lib.de265_internals_set_parameter_bool(
281 this->decoder, DE265_INTERNALS_DECODER_PARAM_SAVE_RESIDUAL, true);
282 else if (decodeSignal == 3)
283 this->lib.de265_internals_set_parameter_bool(
284 this->decoder, DE265_INTERNALS_DECODER_PARAM_SAVE_TR_COEFF, true);
285 }
286
287 // You could disable SSE acceleration ... not really recommended
288 // de265_set_parameter_int(decoder, DE265_DECODER_PARAM_ACCELERATION_CODE,
289 // de265_acceleration_SCALAR);
290
291 this->lib.de265_disable_logging();
292 // Verbosity level (0...3(highest))
293 this->lib.de265_set_verbosity(0);
294 // The highest temporal ID to decode. Set this to very high (all) by default.
295 this->lib.de265_set_limit_TID(this->decoder, 100);
296
297 // Set the number of decoder threads. Libde265 can use wavefronts to utilize these.
298 // TODO: We should add a setting for this maybe?
299 auto err = this->lib.de265_start_worker_threads(this->decoder, 8);
300 if (err != DE265_OK)
301 return setError("Error starting libde265 worker threads (de265_start_worker_threads)");
302
303 // The decoder is ready to receive data
304 decoderBase::resetDecoder();

Callers 2

decoderLibde265Method · 0.95
resetDecoderMethod · 0.95

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected