Lines Matching defs:avctx
56 static int compress_texture(AVCodecContext *avctx, uint8_t *out, int out_length, const AVFrame *f)
58 HapContext *ctx = avctx->priv_data;
66 avctx->execute2(avctx, ff_texturedsp_compress_thread, &ctx->enc, NULL, ctx->enc.slice_count);
89 static int hap_compress_frame(AVCodecContext *avctx, uint8_t *dst)
91 HapContext *ctx = avctx->priv_data;
115 av_log(avctx, AV_LOG_ERROR, "Snappy compress error.\n");
121 av_log(avctx, AV_LOG_VERBOSE,
191 static int hap_encode(AVCodecContext *avctx, AVPacket *pkt,
194 HapContext *ctx = avctx->priv_data;
200 ret = ff_alloc_packet(avctx, pkt, pktsize);
206 ret = compress_texture(avctx, pkt->data + header_length, pkt->size - header_length, frame);
214 ret = compress_texture(avctx, ctx->tex_buf, ctx->tex_size, frame);
219 final_data_size = hap_compress_frame(avctx, pkt->data + header_length);
232 static av_cold int hap_init(AVCodecContext *avctx)
234 HapContext *ctx = avctx->priv_data;
236 int ret = av_image_check_size(avctx->width, avctx->height, 0, avctx);
239 av_log(avctx, AV_LOG_ERROR, "Invalid video size %dx%d.\n",
240 avctx->width, avctx->height);
244 if (avctx->width % 4 || avctx->height % 4) {
245 av_log(avctx, AV_LOG_ERROR, "Video size %dx%d is not multiple of 4.\n",
246 avctx->width, avctx->height);
255 avctx->codec_tag = MKTAG('H', 'a', 'p', '1');
256 avctx->bits_per_coded_sample = 24;
261 avctx->codec_tag = MKTAG('H', 'a', 'p', '5');
262 avctx->bits_per_coded_sample = 32;
267 avctx->codec_tag = MKTAG('H', 'a', 'p', 'Y');
268 avctx->bits_per_coded_sample = 24;
272 av_log(avctx, AV_LOG_ERROR, "Invalid format %02X\n", ctx->opt_tex_fmt);
276 ctx->enc.slice_count = av_clip(avctx->thread_count, 1, avctx->height / TEXTURE_BLOCK_H);
280 ctx->tex_size = avctx->width / TEXTURE_BLOCK_W *
281 avctx->height / TEXTURE_BLOCK_H * ctx->enc.tex_ratio;
305 av_log(avctx, AV_LOG_ERROR, "Invalid compresor %02X\n", ctx->opt_compressor);
309 av_log(avctx, AV_LOG_INFO, "%d chunks requested but %d used.\n",
319 static av_cold int hap_close(AVCodecContext *avctx)
321 HapContext *ctx = avctx->priv_data;