Decode_Status VaapiDecoderVP8::decodePicture() { Decode_Status status = DECODE_SUCCESS; if (!allocNewPicture()) return DECODE_FAIL; if (!ensureQuantMatrix(m_currentPicture)) { ERROR("failed to reset quantizer matrix"); return DECODE_FAIL; } if (!ensureProbabilityTable(m_currentPicture)) { ERROR("failed to reset probability table"); return DECODE_FAIL; } if (!fillPictureParam(m_currentPicture)) { ERROR("failed to fill picture parameters"); return DECODE_FAIL; } VaapiSliceVP8 *slice; slice = new VaapiSliceVP8(m_VADisplay, m_VAContext, #if __PLATFORM_BYT__ // PSB requires slice_data_offset normalize to 0 and macroblock_offset normalized to [0,7] m_frameHdr.rangedecoder_state.buffer, m_frameSize - (m_frameHdr.rangedecoder_state.buffer - m_buffer)); #else m_buffer, m_frameSize); #endif m_currentPicture->addSlice(slice); if (!fillSliceParam(slice)) { ERROR("failed to fill slice parameters"); return DECODE_FAIL; } if (!m_currentPicture->decodePicture()) return DECODE_FAIL; DEBUG("VaapiDecoderVP8::decodePicture success"); return status; }
Decode_Status VaapiDecoderVP8::decodePicture() { Decode_Status status = DECODE_SUCCESS; if (!allocNewPicture()) return DECODE_FAIL; if (!ensureQuantMatrix(m_currentPicture)) { ERROR("failed to reset quantizer matrix"); return DECODE_FAIL; } if (!ensureProbabilityTable(m_currentPicture)) { ERROR("failed to reset probability table"); return DECODE_FAIL; } if (!fillPictureParam(m_currentPicture)) { ERROR("failed to fill picture parameters"); return DECODE_FAIL; } VASliceParameterBufferVP8* sliceParam = NULL; const void* sliceData = m_buffer;; uint32_t sliceSize = m_frameSize; #if __PSB_VP8_INTERFACE_WORK_AROUND__ sliceData = m_frameHdr.rangedecoder_state.buffer, sliceSize = m_frameSize - (m_frameHdr.rangedecoder_state.buffer - m_buffer); #endif if (!m_currentPicture->newSlice(sliceParam, sliceData, sliceSize)) return DECODE_FAIL; if (!fillSliceParam(sliceParam)) return DECODE_FAIL; if (!m_currentPicture->decode()) return DECODE_FAIL; DEBUG("VaapiDecoderVP8::decodePicture success"); return status; }
Decode_Status VaapiDecoderVP8::decodePicture() { Decode_Status status = DECODE_SUCCESS; if (!allocNewPicture()) return DECODE_FAIL; if (!ensureQuantMatrix(m_currentPicture)) { ERROR("failed to reset quantizer matrix"); return DECODE_FAIL; } if (!ensureProbabilityTable(m_currentPicture)) { ERROR("failed to reset probability table"); return DECODE_FAIL; } if (!fillPictureParam(m_currentPicture)) { ERROR("failed to fill picture parameters"); return DECODE_FAIL; } VASliceParameterBufferVP8* sliceParam = NULL; const void* sliceData = m_buffer + m_frameHdr.data_chunk_size; uint32_t sliceSize = m_frameSize - m_frameHdr.data_chunk_size; if (!m_currentPicture->newSlice(sliceParam, sliceData, sliceSize)) return DECODE_FAIL; if (!fillSliceParam(sliceParam)) return DECODE_FAIL; if (!m_currentPicture->decode()) return DECODE_FAIL; DEBUG("VaapiDecoderVP8::decodePicture success"); return status; }