Lines Matching refs:dec
104 const VP8Decoder* const dec = (VP8Decoder*)idec->dec_; in NeedCompressedAlpha() local
105 assert(dec != NULL); // Must be true as idec->state_ != STATE_WEBP_HEADER. in NeedCompressedAlpha()
106 return (dec->alpha_data_ != NULL) && !dec->is_alpha_decoded_; in NeedCompressedAlpha()
120 VP8Decoder* const dec = (VP8Decoder*)idec->dec_; in DoRemap() local
121 const int last_part = dec->num_parts_ - 1; in DoRemap()
125 VP8RemapBitReader(dec->parts_ + p, offset); in DoRemap()
130 VP8RemapBitReader(&dec->br_, offset); in DoRemap()
134 dec->parts_[last_part].buf_end_ = mem->buf_ + mem->end_; in DoRemap()
136 ALPHDecoder* const alph_dec = dec->alph_dec_; in DoRemap()
137 dec->alpha_data_ += offset; in DoRemap()
142 assert(dec->alpha_data_size_ >= ALPHA_HEADER_LEN); in DoRemap()
144 dec->alpha_data_ + ALPHA_HEADER_LEN, in DoRemap()
145 dec->alpha_data_size_ - ALPHA_HEADER_LEN); in DoRemap()
152 VP8LDecoder* const dec = (VP8LDecoder*)idec->dec_; in DoRemap() local
153 VP8LBitReaderSetBuffer(&dec->br_, new_base, MemDataSize(mem)); in DoRemap()
162 VP8Decoder* const dec = (VP8Decoder*)idec->dec_; in AppendToMemBuffer() local
167 need_compressed_alpha ? dec->alpha_data_ : old_start; in AppendToMemBuffer()
259 static void SaveContext(const VP8Decoder* dec, const VP8BitReader* token_br, in SaveContext() argument
261 context->left_ = dec->mb_info_[-1]; in SaveContext()
262 context->info_ = dec->mb_info_[dec->mb_x_]; in SaveContext()
266 static void RestoreContext(const MBContext* context, VP8Decoder* const dec, in RestoreContext() argument
268 dec->mb_info_[-1] = context->left_; in RestoreContext()
269 dec->mb_info_[dec->mb_x_] = context->info_; in RestoreContext()
317 VP8Decoder* const dec = VP8New(); in DecodeWebPHeaders() local
318 if (dec == NULL) { in DecodeWebPHeaders()
321 idec->dec_ = dec; in DecodeWebPHeaders()
322 dec->alpha_data_ = headers.alpha_data; in DecodeWebPHeaders()
323 dec->alpha_data_size_ = headers.alpha_data_size; in DecodeWebPHeaders()
326 VP8LDecoder* const dec = VP8LNew(); in DecodeWebPHeaders() local
327 if (dec == NULL) { in DecodeWebPHeaders()
330 idec->dec_ = dec; in DecodeWebPHeaders()
361 VP8Decoder* const dec = (VP8Decoder*)idec->dec_; in CopyParts0Data() local
362 VP8BitReader* const br = &dec->br_; in CopyParts0Data()
387 VP8Decoder* const dec = (VP8Decoder*)idec->dec_; in DecodePartition0() local
397 if (!VP8GetHeaders(dec, io)) { in DecodePartition0()
398 const VP8StatusCode status = dec->status_; in DecodePartition0()
408 dec->status_ = WebPAllocateDecBuffer(io->width, io->height, params->options, in DecodePartition0()
410 if (dec->status_ != VP8_STATUS_OK) { in DecodePartition0()
411 return IDecError(idec, dec->status_); in DecodePartition0()
414 dec->mt_method_ = VP8GetThreadMethod(params->options, NULL, in DecodePartition0()
416 VP8InitDithering(params->options, dec); in DecodePartition0()
422 if (VP8EnterCritical(dec, io) != VP8_STATUS_OK) { in DecodePartition0()
423 return IDecError(idec, dec->status_); in DecodePartition0()
430 if (!VP8InitFrame(dec, io)) { in DecodePartition0()
431 return IDecError(idec, dec->status_); in DecodePartition0()
438 VP8Decoder* const dec = (VP8Decoder*)idec->dec_; in DecodeRemaining() local
441 assert(dec->ready_); in DecodeRemaining()
442 for (; dec->mb_y_ < dec->mb_h_; ++dec->mb_y_) { in DecodeRemaining()
443 if (idec->last_mb_y_ != dec->mb_y_) { in DecodeRemaining()
444 if (!VP8ParseIntraModeRow(&dec->br_, dec)) { in DecodeRemaining()
450 idec->last_mb_y_ = dec->mb_y_; in DecodeRemaining()
452 for (; dec->mb_x_ < dec->mb_w_; ++dec->mb_x_) { in DecodeRemaining()
454 &dec->parts_[dec->mb_y_ & (dec->num_parts_ - 1)]; in DecodeRemaining()
456 SaveContext(dec, token_br, &context); in DecodeRemaining()
457 if (!VP8DecodeMB(dec, token_br)) { in DecodeRemaining()
459 if (dec->num_parts_ == 1 && MemDataSize(&idec->mem_) > MAX_MB_SIZE) { in DecodeRemaining()
462 RestoreContext(&context, dec, token_br); in DecodeRemaining()
466 if (dec->num_parts_ == 1) { in DecodeRemaining()
471 VP8InitScanline(dec); // Prepare for next scanline in DecodeRemaining()
474 if (!VP8ProcessRow(dec, io)) { in DecodeRemaining()
479 if (!VP8ExitCritical(dec, io)) { in DecodeRemaining()
482 dec->ready_ = 0; in DecodeRemaining()
496 VP8LDecoder* const dec = (VP8LDecoder*)idec->dec_; in DecodeVP8LHeader() local
506 if (!VP8LDecodeHeader(dec, io)) { in DecodeVP8LHeader()
507 return ErrorStatusLossless(idec, dec->status_); in DecodeVP8LHeader()
510 dec->status_ = WebPAllocateDecBuffer(io->width, io->height, params->options, in DecodeVP8LHeader()
512 if (dec->status_ != VP8_STATUS_OK) { in DecodeVP8LHeader()
513 return IDecError(idec, dec->status_); in DecodeVP8LHeader()
521 VP8LDecoder* const dec = (VP8LDecoder*)idec->dec_; in DecodeVP8LData() local
531 if (!VP8LDecodeImage(dec)) { in DecodeVP8LData()
532 return ErrorStatusLossless(idec, dec->status_); in DecodeVP8LData()