Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libdvbpsi
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
libdvbpsi
Commits
6a75b337
Commit
6a75b337
authored
May 09, 2002
by
Arnaud de Bossoreille de Ribou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* misc/dr.dtd, misc/dr.xml, misc/dr.xsl, misc/test_dr.h, misc/test_dr.c: more improvement.
parent
9d4d880d
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
109 deletions
+68
-109
misc/dr.dtd
misc/dr.dtd
+0
-3
misc/dr.xml
misc/dr.xml
+5
-6
misc/dr.xsl
misc/dr.xsl
+8
-3
misc/test_dr.c
misc/test_dr.c
+48
-54
misc/test_dr.h
misc/test_dr.h
+7
-43
No files found.
misc/dr.dtd
View file @
6a75b337
...
...
@@ -20,9 +20,6 @@
<!ATTLIST integer name CDATA #IMPLIED>
<!ATTLIST integer bitcount CDATA #IMPLIED>
<!ATTLIST integer default CDATA #IMPLIED>
<!ATTLIST integer min CDATA #IMPLIED>
<!ATTLIST integer max CDATA #IMPLIED>
<!ATTLIST integer step CDATA #IMPLIED>
<!ATTLIST boolean name CDATA #IMPLIED>
<!ATTLIST boolean default CDATA #IMPLIED>
misc/dr.xml
View file @
6a75b337
...
...
@@ -22,7 +22,7 @@
</insert>
<boolean
name=
"b_constrained_parameter"
default=
"0"
/>
<boolean
name=
"b_still_picture"
default=
"0"
/>
<integer
name=
"i_profile_level_indication"
bitcount=
"8"
default=
"0"
max=
"0xff - 1"
/>
<integer
name=
"i_profile_level_indication"
bitcount=
"8"
default=
"0"
/>
<integer
name=
"i_chroma_format"
bitcount=
"2"
default=
"0"
/>
<boolean
name=
"b_frame_rate_extension"
default=
"0"
/>
</descriptor>
...
...
@@ -45,12 +45,11 @@
<begin>
s_decoded.i_additional_length = 0;
</begin>
</insert>
<integer
name=
"i_format_identifier"
bitcount=
"32"
default=
"0"
max=
"0xffff"
/>
<integer
name=
"i_format_identifier"
bitcount=
"32"
default=
"0"
max=
"0xffff0000"
step=
"0x10000"
/>
<integer
name=
"i_format_identifier"
bitcount=
"32"
default=
"0"
/>
</descriptor>
<descriptor
name=
"data stream alignment"
sname=
"ds_alignment"
fname=
"DSAlignment"
>
<integer
name=
"i_alignment_type"
bitcount=
"8"
default=
"0"
max=
"0xff - 1"
/>
<integer
name=
"i_alignment_type"
bitcount=
"8"
default=
"0"
/>
</descriptor>
<descriptor
name=
"target background grid"
sname=
"target_bg_grid"
fname=
"TargetBgGrid"
>
...
...
@@ -70,7 +69,7 @@
<begin>
s_decoded.i_private_length = 0;
</begin>
</insert>
<integer
name=
"i_ca_system_id"
bitcount=
"16"
default=
"0"
max=
"0xffff - 1"
/>
<integer
name=
"i_ca_system_id"
bitcount=
"16"
default=
"0"
/>
<integer
name=
"i_ca_pid"
bitcount=
"13"
default=
"0"
/>
</descriptor>
...
...
@@ -79,7 +78,7 @@
<begin>
s_decoded.i_code_count = 0;
</begin>
</insert>
<integer
name=
"i_audio_type"
bitcount=
"8"
default=
"0"
max=
"0xff - 1"
/>
<integer
name=
"i_audio_type"
bitcount=
"8"
default=
"0"
/>
</descriptor>
</dr>
misc/dr.xsl
View file @
6a75b337
...
...
@@ -36,6 +36,11 @@ int main()
int i_err = 0;
<xsl:apply-templates
mode=
"main"
/>
if(i_err)
fprintf(stderr, "At least one test has FAILED !!!\n");
else
fprintf(stdout, "All tests succeeded.\n");
return i_err;
}
...
...
@@ -86,11 +91,11 @@ int main_<xsl:value-of select="@sname" />_<xsl:value-of select="@msuffix" />()
<xsl:template
match=
"integer"
mode=
"check"
>
/* check
<xsl:value-of
select=
"@name"
/>
*/
<xsl:apply-templates
select=
".."
mode=
"init"
/>
BOZO_begin_integer(
<xsl:value-of
select=
"@name"
/>
,
<xsl:value-of
select=
"@bitcount"
/>
,
<xsl:choose><xsl:when
test=
"@min != ''"
><xsl:value-of
select=
"@min"
/></xsl:when><xsl:otherwise>
0
</xsl:otherwise></xsl:choose>
)
BOZO_begin_integer(
<xsl:value-of
select=
"@name"
/>
,
<xsl:value-of
select=
"@bitcount"
/>
)
BOZO_DOJOB(
<xsl:value-of
select=
"../@fname"
/>
);
BOZO_check_integer
<xsl:if
test=
"@bitcount='32' or @bitcount='64'"
><xsl:value-of
select=
"@bitcount"
/></xsl:if>
(
<xsl:value-of
select=
"@name"
/>
,
<xsl:value-of
select=
"@bitcount"
/>
)
BOZO_check_integer(
<xsl:value-of
select=
"@name"
/>
,
<xsl:value-of
select=
"@bitcount"
/>
)
BOZO_CLEAN();
BOZO_end_integer(
<xsl:value-of
select=
"@name"
/>
,
<xsl:value-of
select=
"@bitcount"
/>
,
<xsl:choose><xsl:when
test=
"@max != ''"
><xsl:value-of
select=
"@max"
/></xsl:when><xsl:otherwise>
(1
<<
<xsl:value-of
select=
"@bitcount"
/>
) - 1
</xsl:otherwise></xsl:choose>
,
<xsl:choose><xsl:when
test=
"@step != ''"
><xsl:value-of
select=
"@step"
/></xsl:when><xsl:otherwise>
1
</xsl:otherwise></xsl:choose>
)
BOZO_end_integer(
<xsl:value-of
select=
"@name"
/>
,
<xsl:value-of
select=
"@bitcount"
/>
)
</xsl:template>
<xsl:template
match=
"boolean"
mode=
"check"
>
...
...
misc/test_dr.c
View file @
6a75b337
This diff is collapsed.
Click to expand it.
misc/test_dr.h
View file @
6a75b337
/*****************************************************************************
* test_dr.h
* (c)2001-2002 VideoLAN
* $Id: test_dr.h,v 1.
2 2002/05/09 19:59:20
bozo Exp $
* $Id: test_dr.h,v 1.
3 2002/05/09 20:39:02
bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
...
...
@@ -52,20 +52,21 @@
#define BOZO_init_integer(name, default) \
s_decoded.name = default;
#define BOZO_begin_integer(name, bitcount
, min)
\
#define BOZO_begin_integer(name, bitcount
)
\
if(!i_err) \
{ \
unsigned int i = 0; \
fprintf(stdout, " \"%s\" %u bit(s) integer check\n", \
#name, bitcount); \
i_loop_count = 0; \
s_decoded.name =
min;
\
s_decoded.name =
1;
\
do \
{
#define BOZO_end_integer(name, bitcount
, max, step)
\
s_decoded.name
+= step;
\
#define BOZO_end_integer(name, bitcount
)
\
s_decoded.name
<<= 1;
\
} while(!i_err \
&& (
s_decoded.name != max + step));
\
&& (
++i < bitcount));
\
fprintf(stdout, "\r iteration count: %22llu", i_loop_count); \
if(i_err) \
fprintf(stdout, " FAILED !!!\n"); \
...
...
@@ -79,43 +80,6 @@
fprintf(stderr, "\nError: integer %s %llu -> %llu\n", #name, \
(uint64_t)s_decoded.name, (uint64_t)p_new_decoded->name); \
i_err = 1; \
} \
if(!i_err && (p_new_decoded->name & ~(((uint64_t)1 << bitcount) - 1))) \
{ \
fprintf(stderr, \
"\nError: integer %s has more than %d bits (%llx)\n", \
#name, bitcount, (uint64_t)p_new_decoded->name); \
i_err = 1; \
}
#define BOZO_check_integer32(name, bitcount) \
if(!i_err && (s_decoded.name != p_new_decoded->name)) \
{ \
fprintf(stderr, "\nError: integer %s %llu -> %llu\n", #name, \
(uint64_t)s_decoded.name, (uint64_t)p_new_decoded->name); \
i_err = 1; \
} \
if(!i_err && (p_new_decoded->name & ~0xffffffff)) \
{ \
fprintf(stderr, \
"\nError: integer %s has more than %d bits (%llx)\n", \
#name, bitcount, (uint64_t)p_new_decoded->name); \
i_err = 1; \
}
#define BOZO_check_integer64(name, bitcount) \
if(!i_err && (s_decoded.name != p_new_decoded->name)) \
{ \
fprintf(stderr, "\nError: integer %s %llu -> %llu\n", #name, \
(uint64_t)s_decoded.name, (uint64_t)p_new_decoded->name); \
i_err = 1; \
} \
if(!i_err && (p_new_decoded->name & ~0xffffffffffffffff)) \
{ \
fprintf(stderr, \
"\nError: integer %s has more than %d bits (%llx)\n", \
#name, bitcount, (uint64_t)p_new_decoded->name); \
i_err = 1; \
}
...
...
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