Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
b73e868b
Commit
b73e868b
authored
Jun 02, 2008
by
Baptiste Coudurier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cosmetics, remove table_ prefix
Originally committed as revision 13617 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
591569b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
28 deletions
+28
-28
dnxhdenc.c
libavcodec/dnxhdenc.c
+28
-28
No files found.
libavcodec/dnxhdenc.c
View file @
b73e868b
...
...
@@ -67,10 +67,10 @@ typedef struct DNXHDEncContext {
unsigned
frame_bits
;
uint8_t
*
src
[
3
];
uint32_t
*
table_
vlc_codes
;
uint8_t
*
table_
vlc_bits
;
uint16_t
*
table_
run_codes
;
uint8_t
*
table_
run_bits
;
uint32_t
*
vlc_codes
;
uint8_t
*
vlc_bits
;
uint16_t
*
run_codes
;
uint8_t
*
run_bits
;
/** Rate control */
unsigned
slice_bits
;
...
...
@@ -93,13 +93,13 @@ static int dnxhd_init_vlc(DNXHDEncContext *ctx)
int
i
,
j
,
level
,
run
;
int
max_level
=
1
<<
(
ctx
->
cid_table
->
bit_depth
+
2
);
CHECKED_ALLOCZ
(
ctx
->
table_vlc_codes
,
max_level
*
4
*
sizeof
(
*
ctx
->
table_
vlc_codes
));
CHECKED_ALLOCZ
(
ctx
->
table_vlc_bits
,
max_level
*
4
*
sizeof
(
*
ctx
->
table_
vlc_bits
));
CHECKED_ALLOCZ
(
ctx
->
table_
run_codes
,
63
*
2
);
CHECKED_ALLOCZ
(
ctx
->
table_
run_bits
,
63
);
CHECKED_ALLOCZ
(
ctx
->
vlc_codes
,
max_level
*
4
*
sizeof
(
*
ctx
->
vlc_codes
));
CHECKED_ALLOCZ
(
ctx
->
vlc_bits
,
max_level
*
4
*
sizeof
(
*
ctx
->
vlc_bits
));
CHECKED_ALLOCZ
(
ctx
->
run_codes
,
63
*
2
);
CHECKED_ALLOCZ
(
ctx
->
run_bits
,
63
);
ctx
->
table_
vlc_codes
+=
max_level
*
2
;
ctx
->
table_
vlc_bits
+=
max_level
*
2
;
ctx
->
vlc_codes
+=
max_level
*
2
;
ctx
->
vlc_bits
+=
max_level
*
2
;
for
(
level
=
-
max_level
;
level
<
max_level
;
level
++
)
{
for
(
run
=
0
;
run
<
2
;
run
++
)
{
int
index
=
(
level
<<
1
)
|
run
;
...
...
@@ -114,29 +114,29 @@ static int dnxhd_init_vlc(DNXHDEncContext *ctx)
if
(
ctx
->
cid_table
->
ac_level
[
j
]
==
alevel
&&
(
!
offset
||
(
ctx
->
cid_table
->
ac_index_flag
[
j
]
&&
offset
))
&&
(
!
run
||
(
ctx
->
cid_table
->
ac_run_flag
[
j
]
&&
run
)))
{
assert
(
!
ctx
->
table_
vlc_codes
[
index
]);
assert
(
!
ctx
->
vlc_codes
[
index
]);
if
(
alevel
)
{
ctx
->
table_
vlc_codes
[
index
]
=
(
ctx
->
cid_table
->
ac_codes
[
j
]
<<
1
)
|
(
sign
&
1
);
ctx
->
table_
vlc_bits
[
index
]
=
ctx
->
cid_table
->
ac_bits
[
j
]
+
1
;
ctx
->
vlc_codes
[
index
]
=
(
ctx
->
cid_table
->
ac_codes
[
j
]
<<
1
)
|
(
sign
&
1
);
ctx
->
vlc_bits
[
index
]
=
ctx
->
cid_table
->
ac_bits
[
j
]
+
1
;
}
else
{
ctx
->
table_
vlc_codes
[
index
]
=
ctx
->
cid_table
->
ac_codes
[
j
];
ctx
->
table_
vlc_bits
[
index
]
=
ctx
->
cid_table
->
ac_bits
[
j
];
ctx
->
vlc_codes
[
index
]
=
ctx
->
cid_table
->
ac_codes
[
j
];
ctx
->
vlc_bits
[
index
]
=
ctx
->
cid_table
->
ac_bits
[
j
];
}
break
;
}
}
assert
(
!
alevel
||
j
<
257
);
if
(
offset
)
{
ctx
->
table_vlc_codes
[
index
]
=
(
ctx
->
table_
vlc_codes
[
index
]
<<
ctx
->
cid_table
->
index_bits
)
|
offset
;
ctx
->
table_
vlc_bits
[
index
]
+=
ctx
->
cid_table
->
index_bits
;
ctx
->
vlc_codes
[
index
]
=
(
ctx
->
vlc_codes
[
index
]
<<
ctx
->
cid_table
->
index_bits
)
|
offset
;
ctx
->
vlc_bits
[
index
]
+=
ctx
->
cid_table
->
index_bits
;
}
}
}
for
(
i
=
0
;
i
<
62
;
i
++
)
{
int
run
=
ctx
->
cid_table
->
run
[
i
];
assert
(
run
<
63
);
ctx
->
table_
run_codes
[
run
]
=
ctx
->
cid_table
->
run_codes
[
i
];
ctx
->
table_
run_bits
[
run
]
=
ctx
->
cid_table
->
run_bits
[
i
];
ctx
->
run_codes
[
run
]
=
ctx
->
cid_table
->
run_codes
[
i
];
ctx
->
run_bits
[
run
]
=
ctx
->
cid_table
->
run_bits
[
i
];
}
return
0
;
fail:
...
...
@@ -321,13 +321,13 @@ static av_always_inline void dnxhd_encode_block(DNXHDEncContext *ctx, DCTELEM *b
if
(
slevel
)
{
int
run_level
=
i
-
last_non_zero
-
1
;
int
rlevel
=
(
slevel
<<
1
)
|!!
run_level
;
put_bits
(
&
ctx
->
m
.
pb
,
ctx
->
table_vlc_bits
[
rlevel
],
ctx
->
table_
vlc_codes
[
rlevel
]);
put_bits
(
&
ctx
->
m
.
pb
,
ctx
->
vlc_bits
[
rlevel
],
ctx
->
vlc_codes
[
rlevel
]);
if
(
run_level
)
put_bits
(
&
ctx
->
m
.
pb
,
ctx
->
table_run_bits
[
run_level
],
ctx
->
table_
run_codes
[
run_level
]);
put_bits
(
&
ctx
->
m
.
pb
,
ctx
->
run_bits
[
run_level
],
ctx
->
run_codes
[
run_level
]);
last_non_zero
=
i
;
}
}
put_bits
(
&
ctx
->
m
.
pb
,
ctx
->
table_vlc_bits
[
0
],
ctx
->
table_
vlc_codes
[
0
]);
// EOB
put_bits
(
&
ctx
->
m
.
pb
,
ctx
->
vlc_bits
[
0
],
ctx
->
vlc_codes
[
0
]);
// EOB
}
static
av_always_inline
void
dnxhd_unquantize_c
(
DNXHDEncContext
*
ctx
,
DCTELEM
*
block
,
int
n
,
int
qscale
,
int
last_index
)
...
...
@@ -378,7 +378,7 @@ static av_always_inline int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, DCTELEM *bl
level
=
block
[
j
];
if
(
level
)
{
int
run_level
=
i
-
last_non_zero
-
1
;
bits
+=
ctx
->
table_vlc_bits
[(
level
<<
1
)
|!!
run_level
]
+
ctx
->
table_
run_bits
[
run_level
];
bits
+=
ctx
->
vlc_bits
[(
level
<<
1
)
|!!
run_level
]
+
ctx
->
run_bits
[
run_level
];
last_non_zero
=
i
;
}
}
...
...
@@ -491,7 +491,7 @@ static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg)
}
}
ctx
->
mb_rc
[
qscale
][
mb
].
ssd
=
ssd
;
ctx
->
mb_rc
[
qscale
][
mb
].
bits
=
ac_bits
+
dc_bits
+
12
+
8
*
ctx
->
table_
vlc_bits
[
0
];
ctx
->
mb_rc
[
qscale
][
mb
].
bits
=
ac_bits
+
dc_bits
+
12
+
8
*
ctx
->
vlc_bits
[
0
];
}
}
return
0
;
...
...
@@ -826,10 +826,10 @@ static int dnxhd_encode_end(AVCodecContext *avctx)
int
max_level
=
1
<<
(
ctx
->
cid_table
->
bit_depth
+
2
);
int
i
;
av_free
(
ctx
->
table_
vlc_codes
-
max_level
*
2
);
av_free
(
ctx
->
table_
vlc_bits
-
max_level
*
2
);
av_freep
(
&
ctx
->
table_
run_codes
);
av_freep
(
&
ctx
->
table_
run_bits
);
av_free
(
ctx
->
vlc_codes
-
max_level
*
2
);
av_free
(
ctx
->
vlc_bits
-
max_level
*
2
);
av_freep
(
&
ctx
->
run_codes
);
av_freep
(
&
ctx
->
run_bits
);
av_freep
(
&
ctx
->
mb_bits
);
av_freep
(
&
ctx
->
mb_qscale
);
...
...
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