From patchwork Fri Oct 21 13:31:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 1097 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.133 with SMTP id o127csp1070619vsd; Fri, 21 Oct 2016 06:31:58 -0700 (PDT) X-Received: by 10.194.229.7 with SMTP id sm7mr800242wjc.150.1477056718763; Fri, 21 Oct 2016 06:31:58 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id o196si3760545wmg.8.2016.10.21.06.31.58; Fri, 21 Oct 2016 06:31:58 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AF2CF68925F; Fri, 21 Oct 2016 16:31:52 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe01-1.mx.upcmail.net (vie01a-dmta-pe01-1.mx.upcmail.net [62.179.121.154]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B20206898C1 for ; Fri, 21 Oct 2016 16:31:45 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe01.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1bxZvI-0003wZ-C4 for ffmpeg-devel@ffmpeg.org; Fri, 21 Oct 2016 15:31:48 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id yDXn1t00C0S5wYM01DXobh; Fri, 21 Oct 2016 15:31:48 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 21 Oct 2016 15:31:40 +0200 Message-Id: <20161021133146.11956-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.10.1 Subject: [FFmpeg-devel] [PATCH 1/7] avcodec/svq1enc: Clear MMX state after svq1_encode_plane() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" svq1_encode_plane() uses SIMD and we call libc memory allocation functions after it Signed-off-by: Michael Niedermayer --- libavcodec/svq1enc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index cb7c4a1..d78ede7 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -641,15 +641,17 @@ FF_ENABLE_DEPRECATION_WARNINGS ff_side_data_set_encoder_stats(pkt, pict->quality, NULL, 0, s->pict_type); svq1_write_header(s, s->pict_type); - for (i = 0; i < 3; i++) - if (svq1_encode_plane(s, i, + for (i = 0; i < 3; i++) { + int ret = svq1_encode_plane(s, i, pict->data[i], s->last_picture->data[i], s->current_picture->data[i], s->frame_width / (i ? 4 : 1), s->frame_height / (i ? 4 : 1), pict->linesize[i], - s->current_picture->linesize[i]) < 0) { + s->current_picture->linesize[i]); + emms_c(); + if (ret < 0) { int j; for (j = 0; j < i; j++) { av_freep(&s->motion_val8[j]); @@ -658,6 +660,7 @@ FF_ENABLE_DEPRECATION_WARNINGS av_freep(&s->scratchbuf); return -1; } + } // avpriv_align_put_bits(&s->pb); while (put_bits_count(&s->pb) & 31)