Lines Matching defs:avctx

130 static int hap_parse_frame_header(AVCodecContext *avctx)
132 HapContext *ctx = avctx->priv_data;
143 if ((avctx->codec_tag == MKTAG('H','a','p','1') && (section_type & 0x0F) != HAP_FMT_RGBDXT1) ||
144 (avctx->codec_tag == MKTAG('H','a','p','5') && (section_type & 0x0F) != HAP_FMT_RGBADXT5) ||
145 (avctx->codec_tag == MKTAG('H','a','p','Y') && (section_type & 0x0F) != HAP_FMT_YCOCGDXT5) ||
146 (avctx->codec_tag == MKTAG('H','a','p','A') && (section_type & 0x0F) != HAP_FMT_RGTC1) ||
147 ((avctx->codec_tag == MKTAG('H','a','p','M') && (section_type & 0x0F) != HAP_FMT_RGTC1) &&
149 av_log(avctx, AV_LOG_ERROR,
217 av_log(avctx, AV_LOG_DEBUG, "%s compressor\n", compressorstr);
222 static int decompress_chunks_thread(AVCodecContext *avctx, void *arg,
225 HapContext *ctx = avctx->priv_data;
240 av_log(avctx, AV_LOG_ERROR, "Snappy uncompress error\n");
250 static int hap_decode(AVCodecContext *avctx, AVFrame *frame,
253 HapContext *ctx = avctx->priv_data;
267 av_log(avctx, AV_LOG_ERROR, "Invalid section type in 2 textures mode %#04x.\n", section_type);
274 ret = ff_thread_get_buffer(avctx, frame, 0);
282 ret = hap_parse_frame_header(avctx);
286 if (ctx->tex_size != (avctx->coded_width / TEXTURE_BLOCK_W)
287 *(avctx->coded_height / TEXTURE_BLOCK_H)
289 av_log(avctx, AV_LOG_ERROR, "uncompressed size mismatches\n");
301 if (tex_size < (avctx->coded_width / TEXTURE_BLOCK_W)
302 *(avctx->coded_height / TEXTURE_BLOCK_H)
304 av_log(avctx, AV_LOG_ERROR, "Insufficient data\n");
313 avctx->execute2(avctx, decompress_chunks_thread, NULL,
326 avctx->execute2(avctx, ff_texturedsp_decompress_thread, &ctx->dec[t], NULL, ctx->dec[t].slice_count);
337 static av_cold int hap_init(AVCodecContext *avctx)
339 HapContext *ctx = avctx->priv_data;
341 int ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
344 av_log(avctx, AV_LOG_ERROR, "Invalid video size %dx%d.\n",
345 avctx->width, avctx->height);
350 avctx->coded_width = FFALIGN(avctx->width, TEXTURE_BLOCK_W);
351 avctx->coded_height = FFALIGN(avctx->height, TEXTURE_BLOCK_H);
357 ctx->dec[0].slice_count = av_clip(avctx->thread_count, 1,
358 avctx->coded_height / TEXTURE_BLOCK_H);
360 switch (avctx->codec_tag) {
365 avctx->pix_fmt = AV_PIX_FMT_RGB0;
371 avctx->pix_fmt = AV_PIX_FMT_RGBA;
377 avctx->pix_fmt = AV_PIX_FMT_RGB0;
384 avctx->pix_fmt = AV_PIX_FMT_GRAY8;
394 avctx->pix_fmt = AV_PIX_FMT_RGBA;
401 av_log(avctx, AV_LOG_DEBUG, "%s texture\n", texture_name);
406 static av_cold int hap_close(AVCodecContext *avctx)
408 HapContext *ctx = avctx->priv_data;