• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/minidlna/ffmpeg-2.3.4/libavcodec/

Lines Matching refs:avctx

235 static void encode_ac_coeffs(AVCodecContext *avctx, PutBitContext *pb,
284 static int encode_slice_plane(AVCodecContext *avctx, int mb_count,
288 ProresContext* ctx = avctx->priv_data;
311 encode_ac_coeffs(avctx, &pb, blocks, blocks_per_slice, qmat);
317 static av_always_inline unsigned encode_slice_data(AVCodecContext *avctx,
323 ProresContext* ctx = avctx->priv_data;
325 *y_data_size = encode_slice_plane(avctx, mb_count, dest_y, luma_stride,
328 if (!(avctx->flags & CODEC_FLAG_GRAY)) {
329 *u_data_size = encode_slice_plane(avctx, mb_count, dest_u,
333 *v_data_size = encode_slice_plane(avctx, mb_count, dest_v,
372 static int encode_slice(AVCodecContext *avctx, const AVFrame *pic, int mb_x,
380 ProresContext* ctx = avctx->priv_data;
381 int tgt_bits = (mb_count * bitrate_table[avctx->profile]) >> 2;
395 luma_stride, avctx->width, avctx->height,
398 chroma_stride, avctx->width >> 1, avctx->height,
401 chroma_stride, avctx->width >> 1, avctx->height,
404 encode_slice_data(avctx, ctx->fill_y, ctx->fill_u, ctx->fill_v,
409 slice_size = encode_slice_data(avctx, dest_y, dest_u, dest_v,
414 if (slice_size > high_bytes && *qp < qp_end_table[avctx->profile]) {
417 slice_size = encode_slice_data(avctx, dest_y, dest_u, dest_v,
421 } while (slice_size > high_bytes && *qp < qp_end_table[avctx->profile]);
423 > qp_start_table[avctx->profile]) {
426 slice_size = encode_slice_data(avctx, dest_y, dest_u, dest_v,
430 } while (slice_size < low_bytes && *qp > qp_start_table[avctx->profile]);
442 static int prores_encode_picture(AVCodecContext *avctx, const AVFrame *pic,
445 int mb_width = (avctx->width + 15) >> 4;
446 int mb_height = (avctx->height + 15) >> 4;
458 qp = qp_start_table[avctx->profile];
469 unsafe_bot = (avctx->height & 0xf) && (mb_y == mb_height - 1);
470 unsafe_right = (avctx->width & 0xf) && (mb_x + slice_mb_count == mb_width);
472 sl_size = encode_slice(avctx, pic, mb_x, mb_y, slice_mb_count,
490 static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
496 int frame_size = FFALIGN(avctx->width, 16) * FFALIGN(avctx->height, 16)*16 + 500 + FF_MIN_BUFFER_SIZE; //FIXME choose tighter limit
499 if ((ret = ff_alloc_packet2(avctx, pkt, frame_size + FF_MIN_BUFFER_SIZE)) < 0)
503 pic_size = prores_encode_picture(avctx, pict, buf + header_size + 8,
512 bytestream_put_be16(&buf, avctx->width);
513 bytestream_put_be16(&buf, avctx->height);
523 bytestream_put_buffer(&buf, QMAT_LUMA[avctx->profile], 64);
524 bytestream_put_buffer(&buf, QMAT_CHROMA[avctx->profile], 64);
540 static av_cold int prores_encode_init(AVCodecContext *avctx)
543 ProresContext* ctx = avctx->priv_data;
545 if (avctx->pix_fmt != AV_PIX_FMT_YUV422P10) {
546 av_log(avctx, AV_LOG_ERROR, "need YUV422P10\n");
549 avctx->bits_per_raw_sample = 10;
551 if (avctx->width & 0x1) {
552 av_log(avctx, AV_LOG_ERROR,
557 if (avctx->width > 65534 || avctx->height > 65535) {
558 av_log(avctx, AV_LOG_ERROR,
563 if ((avctx->height & 0xf) || (avctx->width & 0xf)) {
571 if (avctx->profile == FF_PROFILE_UNKNOWN) {
572 avctx->profile = FF_PROFILE_PRORES_STANDARD;
573 av_log(avctx, AV_LOG_INFO,
576 } else if (avctx->profile < FF_PROFILE_PRORES_PROXY
577 || avctx->profile > FF_PROFILE_PRORES_HQ) {
579 avctx,
582 avctx->profile);
586 ff_fdctdsp_init(&ctx->fdsp, avctx);
588 avctx->codec_tag = AV_RL32((const uint8_t*)profiles[avctx->profile].name);
591 scale_mat(QMAT_LUMA[avctx->profile] , ctx->qmat_luma[i - 1] , i);
592 scale_mat(QMAT_CHROMA[avctx->profile], ctx->qmat_chroma[i - 1], i);
595 avctx->coded_frame = av_frame_alloc();
596 avctx->coded_frame->key_frame = 1;
597 avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
602 static av_cold int prores_encode_close(AVCodecContext *avctx)
604 ProresContext* ctx = avctx->priv_data;
605 av_freep(&avctx->coded_frame);