• Home
  • Raw
  • Download

Lines Matching refs:dec

64                                WebPAnimDecoder* const dec) {  in ApplyDecoderOptions()  argument
66 WebPDecoderConfig* config = &dec->config_; in ApplyDecoderOptions()
74 dec->blend_func_ = (mode == MODE_RGBA || mode == MODE_BGRA) in ApplyDecoderOptions()
89 WebPAnimDecoder* dec = NULL; in WebPAnimDecoderNewInternal() local
96 dec = (WebPAnimDecoder*)WebPSafeCalloc(1ULL, sizeof(*dec)); in WebPAnimDecoderNewInternal()
97 if (dec == NULL) goto Error; in WebPAnimDecoderNewInternal()
104 if (!ApplyDecoderOptions(&options, dec)) goto Error; in WebPAnimDecoderNewInternal()
106 dec->demux_ = WebPDemux(webp_data); in WebPAnimDecoderNewInternal()
107 if (dec->demux_ == NULL) goto Error; in WebPAnimDecoderNewInternal()
109 dec->info_.canvas_width = WebPDemuxGetI(dec->demux_, WEBP_FF_CANVAS_WIDTH); in WebPAnimDecoderNewInternal()
110 dec->info_.canvas_height = WebPDemuxGetI(dec->demux_, WEBP_FF_CANVAS_HEIGHT); in WebPAnimDecoderNewInternal()
111 dec->info_.loop_count = WebPDemuxGetI(dec->demux_, WEBP_FF_LOOP_COUNT); in WebPAnimDecoderNewInternal()
112 dec->info_.bgcolor = WebPDemuxGetI(dec->demux_, WEBP_FF_BACKGROUND_COLOR); in WebPAnimDecoderNewInternal()
113 dec->info_.frame_count = WebPDemuxGetI(dec->demux_, WEBP_FF_FRAME_COUNT); in WebPAnimDecoderNewInternal()
116 dec->curr_frame_ = (uint8_t*)WebPSafeCalloc( in WebPAnimDecoderNewInternal()
117 dec->info_.canvas_width * NUM_CHANNELS, dec->info_.canvas_height); in WebPAnimDecoderNewInternal()
118 if (dec->curr_frame_ == NULL) goto Error; in WebPAnimDecoderNewInternal()
119 dec->prev_frame_disposed_ = (uint8_t*)WebPSafeCalloc( in WebPAnimDecoderNewInternal()
120 dec->info_.canvas_width * NUM_CHANNELS, dec->info_.canvas_height); in WebPAnimDecoderNewInternal()
121 if (dec->prev_frame_disposed_ == NULL) goto Error; in WebPAnimDecoderNewInternal()
123 WebPAnimDecoderReset(dec); in WebPAnimDecoderNewInternal()
124 return dec; in WebPAnimDecoderNewInternal()
127 WebPAnimDecoderDelete(dec); in WebPAnimDecoderNewInternal()
131 int WebPAnimDecoderGetInfo(const WebPAnimDecoder* dec, WebPAnimInfo* info) { in WebPAnimDecoderGetInfo() argument
132 if (dec == NULL || info == NULL) return 0; in WebPAnimDecoderGetInfo()
133 *info = dec->info_; in WebPAnimDecoderGetInfo()
309 int WebPAnimDecoderGetNext(WebPAnimDecoder* dec, in WebPAnimDecoderGetNext() argument
318 if (dec == NULL || buf_ptr == NULL || timestamp_ptr == NULL) return 0; in WebPAnimDecoderGetNext()
319 if (!WebPAnimDecoderHasMoreFrames(dec)) return 0; in WebPAnimDecoderGetNext()
321 width = dec->info_.canvas_width; in WebPAnimDecoderGetNext()
322 height = dec->info_.canvas_height; in WebPAnimDecoderGetNext()
323 blend_row = dec->blend_func_; in WebPAnimDecoderGetNext()
326 if (!WebPDemuxGetFrame(dec->demux_, dec->next_frame_, &iter)) { in WebPAnimDecoderGetNext()
329 timestamp = dec->prev_frame_timestamp_ + iter.duration; in WebPAnimDecoderGetNext()
332 is_key_frame = IsKeyFrame(&iter, &dec->prev_iter_, in WebPAnimDecoderGetNext()
333 dec->prev_frame_was_keyframe_, width, height); in WebPAnimDecoderGetNext()
335 if (!ZeroFillCanvas(dec->curr_frame_, width, height)) { in WebPAnimDecoderGetNext()
339 if (!CopyCanvas(dec->prev_frame_disposed_, dec->curr_frame_, in WebPAnimDecoderGetNext()
351 WebPDecoderConfig* const config = &dec->config_; in WebPAnimDecoderGetNext()
355 buf->rgba = dec->curr_frame_ + out_offset; in WebPAnimDecoderGetNext()
368 if (dec->prev_iter_.dispose_method == WEBP_MUX_DISPOSE_NONE) { in WebPAnimDecoderGetNext()
374 blend_row((uint32_t*)dec->curr_frame_ + offset, in WebPAnimDecoderGetNext()
375 (uint32_t*)dec->prev_frame_disposed_ + offset, iter.width); in WebPAnimDecoderGetNext()
379 assert(dec->prev_iter_.dispose_method == WEBP_MUX_DISPOSE_BACKGROUND); in WebPAnimDecoderGetNext()
387 FindBlendRangeAtRow(&iter, &dec->prev_iter_, canvas_y, &left1, &width1, in WebPAnimDecoderGetNext()
391 blend_row((uint32_t*)dec->curr_frame_ + offset1, in WebPAnimDecoderGetNext()
392 (uint32_t*)dec->prev_frame_disposed_ + offset1, width1); in WebPAnimDecoderGetNext()
396 blend_row((uint32_t*)dec->curr_frame_ + offset2, in WebPAnimDecoderGetNext()
397 (uint32_t*)dec->prev_frame_disposed_ + offset2, width2); in WebPAnimDecoderGetNext()
404 dec->prev_frame_timestamp_ = timestamp; in WebPAnimDecoderGetNext()
405 WebPDemuxReleaseIterator(&dec->prev_iter_); in WebPAnimDecoderGetNext()
406 dec->prev_iter_ = iter; in WebPAnimDecoderGetNext()
407 dec->prev_frame_was_keyframe_ = is_key_frame; in WebPAnimDecoderGetNext()
408 CopyCanvas(dec->curr_frame_, dec->prev_frame_disposed_, width, height); in WebPAnimDecoderGetNext()
409 if (dec->prev_iter_.dispose_method == WEBP_MUX_DISPOSE_BACKGROUND) { in WebPAnimDecoderGetNext()
410 ZeroFillFrameRect(dec->prev_frame_disposed_, width * NUM_CHANNELS, in WebPAnimDecoderGetNext()
411 dec->prev_iter_.x_offset, dec->prev_iter_.y_offset, in WebPAnimDecoderGetNext()
412 dec->prev_iter_.width, dec->prev_iter_.height); in WebPAnimDecoderGetNext()
414 ++dec->next_frame_; in WebPAnimDecoderGetNext()
417 *buf_ptr = dec->curr_frame_; in WebPAnimDecoderGetNext()
426 int WebPAnimDecoderHasMoreFrames(const WebPAnimDecoder* dec) { in WebPAnimDecoderHasMoreFrames() argument
427 if (dec == NULL) return 0; in WebPAnimDecoderHasMoreFrames()
428 return (dec->next_frame_ <= (int)dec->info_.frame_count); in WebPAnimDecoderHasMoreFrames()
431 void WebPAnimDecoderReset(WebPAnimDecoder* dec) { in WebPAnimDecoderReset() argument
432 if (dec != NULL) { in WebPAnimDecoderReset()
433 dec->prev_frame_timestamp_ = 0; in WebPAnimDecoderReset()
434 WebPDemuxReleaseIterator(&dec->prev_iter_); in WebPAnimDecoderReset()
435 memset(&dec->prev_iter_, 0, sizeof(dec->prev_iter_)); in WebPAnimDecoderReset()
436 dec->prev_frame_was_keyframe_ = 0; in WebPAnimDecoderReset()
437 dec->next_frame_ = 1; in WebPAnimDecoderReset()
441 const WebPDemuxer* WebPAnimDecoderGetDemuxer(const WebPAnimDecoder* dec) { in WebPAnimDecoderGetDemuxer() argument
442 if (dec == NULL) return NULL; in WebPAnimDecoderGetDemuxer()
443 return dec->demux_; in WebPAnimDecoderGetDemuxer()
446 void WebPAnimDecoderDelete(WebPAnimDecoder* dec) { in WebPAnimDecoderDelete() argument
447 if (dec != NULL) { in WebPAnimDecoderDelete()
448 WebPDemuxReleaseIterator(&dec->prev_iter_); in WebPAnimDecoderDelete()
449 WebPDemuxDelete(dec->demux_); in WebPAnimDecoderDelete()
450 WebPSafeFree(dec->curr_frame_); in WebPAnimDecoderDelete()
451 WebPSafeFree(dec->prev_frame_disposed_); in WebPAnimDecoderDelete()
452 WebPSafeFree(dec); in WebPAnimDecoderDelete()