• 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

68     AVCodecContext *avctx = v;
69 ThreadContext *c = avctx->internal->frame_thread_encoder;
93 ret = avcodec_encode_video2(avctx, pkt, frame, &got_packet);
113 avcodec_close(avctx);
115 av_freep(&avctx);
119 int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){
124 if( !(avctx->thread_type & FF_THREAD_FRAME)
125 || !(avctx->codec->capabilities & CODEC_CAP_INTRA_ONLY))
128 if( !avctx->thread_count
129 && avctx->codec_id == AV_CODEC_ID_MJPEG
130 && !(avctx->flags & CODEC_FLAG_QSCALE)) {
131 av_log(avctx, AV_LOG_DEBUG,
134 avctx->thread_count = 1;
136 if( avctx->thread_count > 1
137 && avctx->codec_id == AV_CODEC_ID_MJPEG
138 && !(avctx->flags & CODEC_FLAG_QSCALE))
139 av_log(avctx, AV_LOG_WARNING,
143 if (avctx->codec_id == AV_CODEC_ID_HUFFYUV ||
144 avctx->codec_id == AV_CODEC_ID_FFVHUFF) {
146 if (avctx->context_model > 0 || (avctx->flags & CODEC_FLAG_PASS1)) {
147 av_log(avctx, AV_LOG_WARNING,
149 avctx->thread_count = 1;
153 if(!avctx->thread_count) {
154 avctx->thread_count = av_cpu_count();
155 avctx->thread_count = FFMIN(avctx->thread_count, MAX_THREADS);
158 if(avctx->thread_count <= 1)
161 if(avctx->thread_count > MAX_THREADS)
164 av_assert0(!avctx->internal->frame_thread_encoder);
165 c = avctx->internal->frame_thread_encoder = av_mallocz(sizeof(ThreadContext));
169 c->parent_avctx = avctx;
181 for(i=0; i<avctx->thread_count ; i++){
184 AVCodecContext *thread_avctx = avcodec_alloc_context3(avctx->codec);
188 *thread_avctx = *avctx;
191 memcpy(thread_avctx->priv_data, avctx->priv_data, avctx->codec->priv_data_size);
197 if(avcodec_open2(thread_avctx, avctx->codec, &tmp) < 0) {
209 avctx->active_thread_type = FF_THREAD_FRAME;
213 avctx->thread_count = i;
214 av_log(avctx, AV_LOG_ERROR, "ff_frame_thread_encoder_init failed\n");
215 ff_frame_thread_encoder_free(avctx);
219 void ff_frame_thread_encoder_free(AVCodecContext *avctx){
221 ThreadContext *c= avctx->internal->frame_thread_encoder;
228 for (i=0; i<avctx->thread_count; i++) {
238 av_freep(&avctx->internal->frame_thread_encoder);
241 int ff_thread_video_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet_ptr){
242 ThreadContext *c = avctx->internal->frame_thread_encoder;
249 if(!(avctx->flags & CODEC_FLAG_INPUT_PRESERVED)){
262 avctx->pix_fmt, avctx->width, avctx->height);
275 if(!c->finished_tasks[c->finished_task_index].outdata && (c->task_index - c->finished_task_index) % BUFFER_SIZE <= avctx->thread_count)