| 158 | } |
| 159 | |
| 160 | bool ImageGenericDecoder::processImpl(Entry& sample, int tid) noexcept { |
| 161 | try { |
| 162 | sample.should_copy = allocateTempBuffers(sample, tid); |
| 163 | auto decode_ret = |
| 164 | sample.processor->instance_->decode(sample.getImageDesc(), sample.code_stream->getCodeStreamDesc(), curr_params_, tid); |
| 165 | assert(sample.status != NVIMGCODEC_PROCESSING_STATUS_UNKNOWN); |
| 166 | bool decode_success = decode_ret && sample.status == NVIMGCODEC_PROCESSING_STATUS_SUCCESS; |
| 167 | |
| 168 | if (sample.should_copy && decode_success) { |
| 169 | nvtx3::scoped_range marker{"copyToOutputBuffer #" + std::to_string(sample.sample_idx)}; |
| 170 | copyToOutputBuffer(sample.orig_image_info, sample.image_info, tid); |
| 171 | } |
| 172 | return decode_success; |
| 173 | } catch (const std::exception& e) { |
| 174 | NVIMGCODEC_LOG_ERROR(logger_, "Exception during decode: " << e.what()); |
| 175 | sample.status = NVIMGCODEC_PROCESSING_STATUS_FAIL; |
| 176 | return false; |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | bool ImageGenericDecoder::processBatchImpl(ProcessorEntry& processor) noexcept { |
| 181 | try { |
no test coverage detected