Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
1f239513
Commit
1f239513
authored
Nov 28, 2003
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/codec/ffmpeg/*: fixed the code to disable cpu features.
parent
93187b32
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
29 deletions
+23
-29
modules/codec/ffmpeg/encoder.c
modules/codec/ffmpeg/encoder.c
+12
-15
modules/codec/ffmpeg/ffmpeg.c
modules/codec/ffmpeg/ffmpeg.c
+11
-14
No files found.
modules/codec/ffmpeg/encoder.c
View file @
1f239513
...
...
@@ -2,7 +2,7 @@
* encoder.c: video and audio encoder using the ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: encoder.c,v 1.1
1 2003/11/28 10:36:58 massiot
Exp $
* $Id: encoder.c,v 1.1
2 2003/11/28 23:40:09 gbazin
Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
...
...
@@ -31,6 +31,7 @@
#include <vlc/decoder.h>
/* ffmpeg header */
#define HAVE_MMX
#ifdef HAVE_FFMPEG_AVCODEC_H
# include <ffmpeg/avcodec.h>
#else
...
...
@@ -140,28 +141,24 @@ int E_(OpenEncoder)( vlc_object_t *p_this )
p_sys
->
p_context
=
p_context
=
avcodec_alloc_context
();
/* Set CPU capabilities */
#ifdef HAVE_MMX
p_context
->
dsp_mask
=
0
;
if
(
p_enc
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_MMX
)
if
(
!
(
p_enc
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_MMX
)
)
{
p_context
->
dsp_mask
&
=
FF_MM_MMX
;
p_context
->
dsp_mask
|
=
FF_MM_MMX
;
}
if
(
p_enc
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
if
(
!
(
p_enc
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
)
{
p_context
->
dsp_mask
&
=
FF_MM_MMXEXT
;
p_context
->
dsp_mask
|
=
FF_MM_MMXEXT
;
}
if
(
p_enc
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_3DNOW
)
if
(
!
(
p_enc
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_3DNOW
)
)
{
p_context
->
dsp_mask
&
=
FF_MM_3DNOW
;
p_context
->
dsp_mask
|
=
FF_MM_3DNOW
;
}
if
(
p_enc
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_SSE
)
if
(
!
(
p_enc
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_SSE
)
)
{
p_context
->
dsp_mask
&
=
FF_MM_SSE
;
p_context
->
dsp_mask
&=
FF_MM_SSE2
;
/* FIXME */
p_context
->
dsp_mask
|
=
FF_MM_SSE
;
p_context
->
dsp_mask
|=
FF_MM_SSE2
;
}
/* Hack to make sure everything can be disabled **/
p_context
->
dsp_mask
&=
(
FF_MM_FORCE
>>
1
);
#endif
/* Make sure we get extradata filled by the encoder */
p_context
->
extradata_size
=
0
;
...
...
@@ -297,7 +294,7 @@ static block_t *EncodeVideo( encoder_t *p_enc, picture_t *p_pict )
encoder_sys_t
*
p_sys
=
p_enc
->
p_sys
;
AVFrame
frame
;
int
i_out
,
i_plane
;
vlc_bool_t
b_hurry_up
;
vlc_bool_t
b_hurry_up
=
0
;
for
(
i_plane
=
0
;
i_plane
<
p_pict
->
i_planes
;
i_plane
++
)
{
...
...
modules/codec/ffmpeg/ffmpeg.c
View file @
1f239513
...
...
@@ -2,7 +2,7 @@
* ffmpeg.c: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ffmpeg.c,v 1.6
2 2003/11/28 16:09:07 fenrir
Exp $
* $Id: ffmpeg.c,v 1.6
3 2003/11/28 23:40:09 gbazin
Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
...
...
@@ -29,6 +29,7 @@
#include <vlc/decoder.h>
/* ffmpeg header */
#define HAVE_MMX
#ifdef HAVE_FFMPEG_AVCODEC_H
# include <ffmpeg/avcodec.h>
#else
...
...
@@ -144,28 +145,24 @@ static int OpenDecoder( vlc_object_t *p_this )
p_context
=
avcodec_alloc_context
();
/* Set CPU capabilities */
#ifdef HAVE_MMX
p_context
->
dsp_mask
=
0
;
if
(
p_dec
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_MMX
)
if
(
!
(
p_dec
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_MMX
)
)
{
p_context
->
dsp_mask
&
=
FF_MM_MMX
;
p_context
->
dsp_mask
|
=
FF_MM_MMX
;
}
if
(
p_dec
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
if
(
!
(
p_dec
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
)
{
p_context
->
dsp_mask
&
=
FF_MM_MMXEXT
;
p_context
->
dsp_mask
|
=
FF_MM_MMXEXT
;
}
if
(
p_dec
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_3DNOW
)
if
(
!
(
p_dec
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_3DNOW
)
)
{
p_context
->
dsp_mask
&
=
FF_MM_3DNOW
;
p_context
->
dsp_mask
|
=
FF_MM_3DNOW
;
}
if
(
p_enc
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_SSE
)
if
(
!
(
p_dec
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_SSE
)
)
{
p_context
->
dsp_mask
&
=
FF_MM_SSE
;
p_context
->
dsp_mask
&=
FF_MM_SSE2
;
/* FIXME */
p_context
->
dsp_mask
|
=
FF_MM_SSE
;
p_context
->
dsp_mask
|=
FF_MM_SSE2
;
}
/* Hack to make sure everything can be disabled **/
p_context
->
dsp_mask
&=
(
FF_MM_FORCE
>>
1
);
#endif
switch
(
i_cat
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment