Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
5c0e385a
Commit
5c0e385a
authored
Apr 05, 2007
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various compile fixes for modules/codec/xvmc
parent
f4e4859f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
47 deletions
+52
-47
modules/codec/xvmc/accel_xvmc.h
modules/codec/xvmc/accel_xvmc.h
+0
-1
modules/codec/xvmc/decode.c
modules/codec/xvmc/decode.c
+6
-2
modules/codec/xvmc/header.c
modules/codec/xvmc/header.c
+5
-4
modules/codec/xvmc/mpeg2.h
modules/codec/xvmc/mpeg2.h
+1
-1
modules/codec/xvmc/slice_xvmc_vld.c
modules/codec/xvmc/slice_xvmc_vld.c
+15
-17
modules/codec/xvmc/xxmc.c
modules/codec/xvmc/xxmc.c
+25
-22
No files found.
modules/codec/xvmc/accel_xvmc.h
View file @
5c0e385a
...
...
@@ -39,7 +39,6 @@
extern
"C"
{
#endif
typedef
struct
vlc_macroblock_s
{
short
*
blockptr
;
/* pointer to current dct block */
...
...
modules/codec/xvmc/decode.c
View file @
5c0e385a
...
...
@@ -21,6 +21,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <vlc/vlc.h>
#include <vlc_vout.h>
#include "xxmc-config.h"
#include <string.h>
/* memcmp/memset, try to remove */
...
...
@@ -30,6 +33,7 @@
#include "mpeg2.h"
#include "attributes.h"
#include "mpeg2_internal.h"
#include "xvmc_vld.h"
static
int
mpeg2_accels
=
0
;
...
...
@@ -173,7 +177,7 @@ mpeg2_state_t mpeg2_parse( mpeg2dec_t * mpeg2dec )
while
(
1
)
{
while
(
(
unsignedint
)
(
mpeg2dec
->
code
-
mpeg2dec
->
first_decode_slice
)
while
(
(
unsigned
int
)
(
mpeg2dec
->
code
-
mpeg2dec
->
first_decode_slice
)
<
mpeg2dec
->
nb_decode_slices
)
{
size_buffer
=
mpeg2dec
->
buf_end
-
mpeg2dec
->
buf_start
;
...
...
@@ -203,7 +207,7 @@ mpeg2_state_t mpeg2_parse( mpeg2dec_t * mpeg2dec )
}
}
mpeg2dec
->
bytes_since_tag
+=
copied
;
mpeg2_xxmc_slice
(
&
(
mpeg2dec
->
decoder
)
,
NULL
,
mpeg2_xxmc_slice
(
mpeg2dec
,
NULL
,
mpeg2dec
->
code
,
mpeg2dec
->
chunk_start
,
mpeg2dec
->
chunk_size
);
mpeg2dec
->
prev_code
=
mpeg2dec
->
code
;
...
...
modules/codec/xvmc/header.c
View file @
5c0e385a
...
...
@@ -22,11 +22,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
"xxmc-config.h"
#include
<vlc/vlc.h>
#include <inttypes.h>
#include <stdlib.h>
/* defines NULL */
#include <string.h>
/* memcmp */
#include <stdlib.h>
/* defines NULL */
#include <string.h>
/* memcmp */
#include "xxmc-config.h"
#include "mpeg2.h"
#include "attributes.h"
...
...
@@ -660,7 +662,6 @@ static int picture_display_ext( mpeg2dec_t * mpeg2dec )
return
1
;
picture
->
display_offset
[
i
].
x
=
mpeg2dec
->
display_offset_x
=
x
>>
1
;
picture
->
display_offset
[
i
].
y
=
mpeg2dec
->
display_offset_y
=
y
>>
1
;
}
}
for
(
;
i
<
3
;
i
++
)
{
...
...
modules/codec/xvmc/mpeg2.h
View file @
5c0e385a
...
...
@@ -58,7 +58,7 @@ typedef struct mpeg2_sequence_s
uint8_t
colour_primaries
;
uint8_t
transfer_characteristics
;
uint8_t
matrix_coefficients
;
int
aspect_ratio_information
;
int
aspect_ratio_information
;
}
mpeg2_sequence_t
;
#define GOP_FLAG_DROP_FRAME 1
...
...
modules/codec/xvmc/slice_xvmc_vld.c
View file @
5c0e385a
...
...
@@ -16,7 +16,7 @@
*
*
*/
#include <vlc/vlc.h>
#include <vlc_vout.h>
#include <vlc_codec.h>
...
...
@@ -47,17 +47,15 @@ static uint8_t alternate_scan [64] ATTR_ALIGN(16) =
53
,
61
,
22
,
30
,
7
,
15
,
23
,
31
,
38
,
46
,
54
,
62
,
39
,
47
,
55
,
63
};
void
mpeg2_xxmc_choose_coding
(
decoder_t
*
p_dec
,
mpeg2_decoder_t
*
const
decoder
,
picture_t
*
picture
,
double
aspect_ratio
,
int
flags
)
void
mpeg2_xxmc_choose_coding
(
decoder_t
*
p_dec
,
mpeg2_decoder_t
*
const
decoder
,
picture_t
*
picture
,
double
aspect_ratio
,
int
flags
)
{
if
(
picture
)
{
//vlc_fourcc_t decoder_format = picture->format.i_chroma;
//if (decoder_format == VLC_FOURCC('X','x','M','C')) {
vlc_xxmc_t
*
xxmc
=
(
vlc_xxmc_t
*
)
picture
->
p_
accel_
data
;
vlc_xxmc_t
*
xxmc
=
(
vlc_xxmc_t
*
)
picture
->
p_data
;
/*
* Make a request for acceleration type and mpeg coding from
...
...
@@ -88,12 +86,12 @@ void mpeg2_xxmc_choose_coding(decoder_t *p_dec, mpeg2_decoder_t * const decoder,
}
}
void
mpeg2_xxmc_slice
(
mpeg2dec_t
*
mpeg2dec
,
picture_t
*
picture
,
int
code
,
uint8_t
*
buffer
,
int
size
)
void
mpeg2_xxmc_slice
(
mpeg2dec_t
*
mpeg2dec
,
picture_t
*
picture
,
int
code
,
uint8_t
*
buffer
,
int
size
)
{
mpeg2_decoder_t
*
const
decoder
=
&
(
mpeg2dec
->
decoder
);
picture
=
(
picture_t
*
)
mpeg2dec
->
fbuf
[
0
]
->
id
;
vlc_xxmc_t
*
xxmc
=
(
vlc_xxmc_t
*
)
picture
->
p_
accel_
data
;
vlc_xxmc_t
*
xxmc
=
(
vlc_xxmc_t
*
)
picture
->
p_data
;
vlc_vld_frame_t
*
vft
=
&
xxmc
->
vld_frame
;
unsigned
mb_frame_height
;
int
i
;
...
...
@@ -187,24 +185,24 @@ void mpeg2_xxmc_slice( mpeg2dec_t *mpeg2dec, picture_t *picture, int code,
printf("\nSLICE DATA !!!! size=%d", size-4);
int i=0;
if ( vft->forward_reference_picture != NULL && ((vlc_xxmc_t *)
vft->forward_reference_picture->p_
accel_
data)->slice_data_size > 10)
vft->forward_reference_picture->p_data)->slice_data_size > 10)
{
printf("\nFORWARD SLICE DATA !!!! size=%d\n", ((vlc_xxmc_t *)
vft->forward_reference_picture->p_
accel_
data)->slice_data_size);
vft->forward_reference_picture->p_data)->slice_data_size);
for (i=0;i<10;i++)
{
printf("%d ", *(((vlc_xxmc_t *) vft->forward_reference_picture->p_
accel_
data)->slice_data+i));
printf("%d ", *(((vlc_xxmc_t *) vft->forward_reference_picture->p_data)->slice_data+i));
}
printf("\nFORWARD SLICE DATA END!!!!\n");
}
if ( vft->backward_reference_picture != NULL && ((vlc_xxmc_t *)
vft->backward_reference_picture->p_
accel_
data)->slice_data_size > 10)
vft->backward_reference_picture->p_data)->slice_data_size > 10)
{
printf("\nBACKWARD SLICE DATA !!!! size=%d\n", ((vlc_xxmc_t *)
vft->backward_reference_picture->p_
accel_
data)->slice_data_size);
vft->backward_reference_picture->p_data)->slice_data_size);
for (i=0;i<10;i++)
{
printf("%d ", *(((vlc_xxmc_t *) vft->backward_reference_picture->p_
accel_
data)->slice_data+i));
printf("%d ", *(((vlc_xxmc_t *) vft->backward_reference_picture->p_data)->slice_data+i));
}
printf("\nBACKWARD SLICE DATA END!!!!\n");
}
...
...
@@ -280,7 +278,7 @@ void mpeg2_xxmc_slice( mpeg2dec_t *mpeg2dec, picture_t *picture, int code,
void
mpeg2_xxmc_vld_frame_complete
(
mpeg2dec_t
*
mpeg2dec
,
picture_t
*
picture
,
int
code
)
{
vlc_xxmc_t
*
xxmc
=
(
vlc_xxmc_t
*
)
picture
->
p_
accel_
data
;
vlc_xxmc_t
*
xxmc
=
(
vlc_xxmc_t
*
)
picture
->
p_data
;
vlc_vld_frame_t
*
vft
=
&
xxmc
->
vld_frame
;
if
(
xxmc
->
decoded
)
...
...
modules/codec/xvmc/xxmc.c
View file @
5c0e385a
...
...
@@ -28,7 +28,10 @@
#include <vlc/vlc.h>
#include <vlc_vout.h>
#include <vlc_codec.h>
#include <vlc_vout_synchro.h>
#include <stdio.h>
#include <unistd.h>
#include <mcheck.h>
#include "mpeg2.h"
...
...
@@ -36,15 +39,12 @@
#include "mpeg2_internal.h"
#include "xvmc_vld.h"
#include "vout_synchro.h"
/* Aspect ratio (ISO/IEC 13818-2 section 6.3.3, table 6-3) */
#define AR_SQUARE_PICTURE 1
/* square pixels */
#define AR_3_4_PICTURE 2
/* 3:4 picture (TV) */
#define AR_16_9_PICTURE 3
/* 16:9 picture (wide screen) */
#define AR_221_1_PICTURE 4
/* 2.21:1 picture (movie) */
#include <unistd.h>
/*****************************************************************************
* decoder_sys_t : libmpeg2 decoder descriptor
*****************************************************************************/
...
...
@@ -60,12 +60,11 @@ struct decoder_sys_t
/*
* Input properties
*/
pes_packet_t
*
p_pes
;
/* current PES we are decoding */
mtime_t
i_pts
;
mtime_t
i_previous_pts
;
mtime_t
i_current_pts
;
mtime_t
i_previous_dts
;
mtime_t
i_current_dts
;
mtime_t
i_current_dts
;
int
i_current_rate
;
picture_t
*
p_picture_to_destroy
;
vlc_bool_t
b_garbage_pic
;
...
...
@@ -77,8 +76,8 @@ struct decoder_sys_t
* Output properties
*/
vout_synchro_t
*
p_synchro
;
int
i_aspect
;
mtime_t
i_last_frame_pts
;
int
i_aspect
;
mtime_t
i_last_frame_pts
;
};
...
...
@@ -110,7 +109,7 @@ static int OpenDecoder( vlc_object_t *p_this )
{
decoder_t
*
p_dec
=
(
decoder_t
*
)
p_this
;
decoder_sys_t
*
p_sys
;
decoder_sys_t
*
p_sys
=
NULL
;
uint32_t
i_accel
=
0
;
FILE
*
f_wd_dec
;
...
...
@@ -130,8 +129,8 @@ static int OpenDecoder( vlc_object_t *p_this )
}
/* Allocate the memory needed to store the decoder's structure */
if
(
(
p_dec
->
p_sys
=
p_sys
=
(
decoder_sys_t
*
)
malloc
(
sizeof
(
decoder_sys_t
))
)
==
NULL
)
p_dec
->
p_sys
=
p_sys
=
(
decoder_sys_t
*
)
malloc
(
sizeof
(
decoder_sys_t
));
if
(
!
p_sys
)
{
msg_Err
(
p_dec
,
"out of memory"
);
return
VLC_EGENERIC
;
...
...
@@ -139,7 +138,6 @@ static int OpenDecoder( vlc_object_t *p_this )
/* Initialize the thread properties */
memset
(
p_sys
,
0
,
sizeof
(
decoder_sys_t
)
);
p_sys
->
p_pes
=
NULL
;
p_sys
->
p_mpeg2dec
=
NULL
;
p_sys
->
p_synchro
=
NULL
;
p_sys
->
p_info
=
NULL
;
...
...
@@ -154,23 +152,23 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys
->
b_skip
=
0
;
#if defined( __i386__ )
if
(
p_dec
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_MMX
)
if
(
p_dec
->
p_libvlc
_global
->
i_cpu
&
CPU_CAPABILITY_MMX
)
{
i_accel
|=
MPEG2_ACCEL_X86_MMX
;
}
if
(
p_dec
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_3DNOW
)
if
(
p_dec
->
p_libvlc
_global
->
i_cpu
&
CPU_CAPABILITY_3DNOW
)
{
i_accel
|=
MPEG2_ACCEL_X86_3DNOW
;
}
if
(
p_dec
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
if
(
p_dec
->
p_libvlc
_global
->
i_cpu
&
CPU_CAPABILITY_MMXEXT
)
{
i_accel
|=
MPEG2_ACCEL_X86_MMXEXT
;
}
#elif defined( __powerpc__ ) || defined( SYS_DARWIN )
if
(
p_dec
->
p_libvlc
->
i_cpu
&
CPU_CAPABILITY_ALTIVEC
)
if
(
p_dec
->
p_libvlc
_global
->
i_cpu
&
CPU_CAPABILITY_ALTIVEC
)
{
i_accel
|=
MPEG2_ACCEL_PPC_ALTIVEC
;
}
...
...
@@ -274,7 +272,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if
(
p_sys
->
b_slice_i
)
{
vout_SynchroNewPicture
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
2
,
0
,
0
,
p_sys
->
i_current_rate
);
I_CODING_TYPE
,
2
,
0
,
0
,
p_sys
->
i_current_rate
,
p_sys
->
p_info
->
sequence
->
flags
&
SEQ_FLAG_LOW_DELAY
);
vout_SynchroDecode
(
p_sys
->
p_synchro
);
vout_SynchroEnd
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
0
);
}
...
...
@@ -392,7 +391,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
vout_SynchroNewPicture
(
p_sys
->
p_synchro
,
p_sys
->
p_info
->
current_picture
->
flags
&
PIC_MASK_CODING_TYPE
,
p_sys
->
p_info
->
current_picture
->
nb_fields
,
0
,
0
,
p_sys
->
i_current_rate
);
0
,
0
,
p_sys
->
i_current_rate
,
p_sys
->
p_info
->
sequence
->
flags
&
SEQ_FLAG_LOW_DELAY
);
if
(
p_sys
->
b_skip
)
{
...
...
@@ -417,7 +417,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
/* Intra-slice refresh. Simulate a blank I picture. */
msg_Dbg
(
p_dec
,
"intra-slice refresh stream"
);
vout_SynchroNewPicture
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
2
,
0
,
0
,
p_sys
->
i_current_rate
);
I_CODING_TYPE
,
2
,
0
,
0
,
p_sys
->
i_current_rate
,
p_sys
->
p_info
->
sequence
->
flags
&
SEQ_FLAG_LOW_DELAY
);
vout_SynchroDecode
(
p_sys
->
p_synchro
);
vout_SynchroEnd
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
0
);
p_sys
->
b_slice_i
=
1
;
...
...
@@ -451,7 +452,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
vout_SynchroNewPicture
(
p_sys
->
p_synchro
,
p_sys
->
p_info
->
current_picture
->
flags
&
PIC_MASK_CODING_TYPE
,
p_sys
->
p_info
->
current_picture
->
nb_fields
,
i_pts
,
0
,
p_sys
->
i_current_rate
);
0
,
p_sys
->
i_current_rate
,
p_sys
->
p_info
->
sequence
->
flags
&
SEQ_FLAG_LOW_DELAY
);
if
(
!
(
p_sys
->
b_slice_i
&&
((
p_sys
->
p_info
->
current_picture
->
flags
...
...
@@ -459,7 +461,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
&&
!
vout_SynchroChoose
(
p_sys
->
p_synchro
,
p_sys
->
p_info
->
current_picture
->
flags
&
PIC_MASK_CODING_TYPE
,
/*FindVout(p_dec)->render_time*/
0
/*FIXME*/
)
)
/*FindVout(p_dec)->render_time*/
0
/*FIXME*/
,
p_sys
->
p_info
->
sequence
->
flags
&
SEQ_FLAG_LOW_DELAY
)
)
{
mpeg2_skip
(
p_sys
->
p_mpeg2dec
,
1
);
p_sys
->
b_skip
=
1
;
...
...
@@ -587,7 +590,8 @@ static picture_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if
(
p_sys
->
b_slice_i
)
{
vout_SynchroNewPicture
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
2
,
0
,
0
,
p_sys
->
i_current_rate
);
I_CODING_TYPE
,
2
,
0
,
0
,
p_sys
->
i_current_rate
,
p_sys
->
p_info
->
sequence
->
flags
&
SEQ_FLAG_LOW_DELAY
);
vout_SynchroDecode
(
p_sys
->
p_synchro
);
vout_SynchroEnd
(
p_sys
->
p_synchro
,
I_CODING_TYPE
,
0
);
}
...
...
@@ -668,7 +672,6 @@ static picture_t *GetNewPicture( decoder_t *p_dec, uint8_t **pp_buf )
//msg_Dbg(p_dec, "GetNewPicture Entering");
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
picture_t
*
p_pic
;
static
int
nbpic
=
0
;
p_dec
->
fmt_out
.
video
.
i_width
=
p_sys
->
p_info
->
sequence
->
width
;
p_dec
->
fmt_out
.
video
.
i_height
=
p_sys
->
p_info
->
sequence
->
height
;
...
...
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