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
5bf3c0fa
Commit
5bf3c0fa
authored
Jan 28, 2015
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: drop the now unused per-slice H264Contexts
parent
51d8725a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
79 deletions
+10
-79
h264.c
libavcodec/h264.c
+0
-11
h264.h
libavcodec/h264.h
+0
-2
h264_parser.c
libavcodec/h264_parser.c
+0
-1
h264_slice.c
libavcodec/h264_slice.c
+10
-65
No files found.
libavcodec/h264.c
View file @
5bf3c0fa
...
@@ -344,7 +344,6 @@ static int decode_rbsp_trailing(H264Context *h, const uint8_t *src)
...
@@ -344,7 +344,6 @@ static int decode_rbsp_trailing(H264Context *h, const uint8_t *src)
void
ff_h264_free_tables
(
H264Context
*
h
,
int
free_rbsp
)
void
ff_h264_free_tables
(
H264Context
*
h
,
int
free_rbsp
)
{
{
int
i
;
int
i
;
H264Context
*
hx
;
av_freep
(
&
h
->
intra4x4_pred_mode
);
av_freep
(
&
h
->
intra4x4_pred_mode
);
av_freep
(
&
h
->
chroma_pred_mode_table
);
av_freep
(
&
h
->
chroma_pred_mode_table
);
...
@@ -376,15 +375,6 @@ void ff_h264_free_tables(H264Context *h, int free_rbsp)
...
@@ -376,15 +375,6 @@ void ff_h264_free_tables(H264Context *h, int free_rbsp)
h
->
cur_pic_ptr
=
NULL
;
h
->
cur_pic_ptr
=
NULL
;
for
(
i
=
0
;
i
<
H264_MAX_THREADS
;
i
++
)
{
hx
=
h
->
thread_context
[
i
];
if
(
!
hx
)
continue
;
if
(
i
)
av_freep
(
&
h
->
thread_context
[
i
]);
}
for
(
i
=
0
;
i
<
h
->
nb_slice_ctx
;
i
++
)
{
for
(
i
=
0
;
i
<
h
->
nb_slice_ctx
;
i
++
)
{
H264SliceContext
*
sl
=
&
h
->
slice_ctx
[
i
];
H264SliceContext
*
sl
=
&
h
->
slice_ctx
[
i
];
...
@@ -653,7 +643,6 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
...
@@ -653,7 +643,6 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
}
}
h
->
thread_context
[
0
]
=
h
;
for
(
i
=
0
;
i
<
h
->
nb_slice_ctx
;
i
++
)
for
(
i
=
0
;
i
<
h
->
nb_slice_ctx
;
i
++
)
h
->
slice_ctx
[
i
].
h264
=
h
;
h
->
slice_ctx
[
i
].
h264
=
h
;
...
...
libavcodec/h264.h
View file @
5bf3c0fa
...
@@ -608,8 +608,6 @@ typedef struct H264Context {
...
@@ -608,8 +608,6 @@ typedef struct H264Context {
* @name Members for slice based multithreading
* @name Members for slice based multithreading
* @{
* @{
*/
*/
struct
H264Context
*
thread_context
[
H264_MAX_THREADS
];
/**
/**
* current slice number, used to initalize slice_num of each thread/context
* current slice number, used to initalize slice_num of each thread/context
*/
*/
...
...
libavcodec/h264_parser.c
View file @
5bf3c0fa
...
@@ -552,7 +552,6 @@ static av_cold int init(AVCodecParserContext *s)
...
@@ -552,7 +552,6 @@ static av_cold int init(AVCodecParserContext *s)
return
0
;
return
0
;
h
->
nb_slice_ctx
=
1
;
h
->
nb_slice_ctx
=
1
;
h
->
thread_context
[
0
]
=
h
;
h
->
slice_context_count
=
1
;
h
->
slice_context_count
=
1
;
ff_h264dsp_init
(
&
h
->
h264dsp
,
8
,
1
);
ff_h264dsp_init
(
&
h
->
h264dsp
,
8
,
1
);
return
0
;
return
0
;
...
...
libavcodec/h264_slice.c
View file @
5bf3c0fa
...
@@ -371,31 +371,6 @@ void h264_init_dequant_tables(H264Context *h)
...
@@ -371,31 +371,6 @@ void h264_init_dequant_tables(H264Context *h)
}
}
}
}
/**
* Mimic alloc_tables(), but for every context thread.
*/
static
void
clone_tables
(
H264Context
*
dst
,
H264SliceContext
*
sl
,
H264Context
*
src
,
int
i
)
{
sl
->
intra4x4_pred_mode
=
src
->
intra4x4_pred_mode
+
i
*
8
*
2
*
src
->
mb_stride
;
sl
->
mvd_table
[
0
]
=
src
->
mvd_table
[
0
]
+
i
*
8
*
2
*
src
->
mb_stride
;
sl
->
mvd_table
[
1
]
=
src
->
mvd_table
[
1
]
+
i
*
8
*
2
*
src
->
mb_stride
;
dst
->
non_zero_count
=
src
->
non_zero_count
;
dst
->
slice_table
=
src
->
slice_table
;
dst
->
cbp_table
=
src
->
cbp_table
;
dst
->
mb2b_xy
=
src
->
mb2b_xy
;
dst
->
mb2br_xy
=
src
->
mb2br_xy
;
dst
->
chroma_pred_mode_table
=
src
->
chroma_pred_mode_table
;
dst
->
direct_table
=
src
->
direct_table
;
dst
->
list_counts
=
src
->
list_counts
;
dst
->
DPB
=
src
->
DPB
;
dst
->
cur_pic_ptr
=
src
->
cur_pic_ptr
;
dst
->
cur_pic
=
src
->
cur_pic
;
ff_h264_pred_init
(
&
dst
->
hpc
,
src
->
avctx
->
codec_id
,
src
->
sps
.
bit_depth_luma
,
src
->
sps
.
chroma_format_idc
);
}
#define IN_RANGE(a, b, size) (((a) >= (b)) && ((a) < ((b) + (size))))
#define IN_RANGE(a, b, size) (((a) >= (b)) && ((a) < ((b) + (size))))
#define REBASE_PICTURE(pic, new_ctx, old_ctx) \
#define REBASE_PICTURE(pic, new_ctx, old_ctx) \
...
@@ -535,8 +510,6 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
...
@@ -535,8 +510,6 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
return
ret
;
return
ret
;
}
}
h
->
thread_context
[
0
]
=
h
;
h
->
context_initialized
=
1
;
h
->
context_initialized
=
1
;
}
}
...
@@ -602,7 +575,7 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
...
@@ -602,7 +575,7 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
copy_fields
(
h
,
h1
,
poc_lsb
,
default_ref_list
);
copy_fields
(
h
,
h1
,
poc_lsb
,
default_ref_list
);
// reference lists
// reference lists
copy_fields
(
h
,
h1
,
short_ref
,
thread_context
);
copy_fields
(
h
,
h1
,
short_ref
,
current_slice
);
copy_picture_range
(
h
->
short_ref
,
h1
->
short_ref
,
32
,
h
,
h1
);
copy_picture_range
(
h
->
short_ref
,
h1
->
short_ref
,
32
,
h
,
h1
);
copy_picture_range
(
h
->
long_ref
,
h1
->
long_ref
,
32
,
h
,
h1
);
copy_picture_range
(
h
->
long_ref
,
h1
->
long_ref
,
32
,
h
,
h1
);
...
@@ -1073,48 +1046,20 @@ static int h264_slice_header_init(H264Context *h, int reinit)
...
@@ -1073,48 +1046,20 @@ static int h264_slice_header_init(H264Context *h, int reinit)
return
ret
;
return
ret
;
}
}
}
else
{
}
else
{
for
(
i
=
1
;
i
<
h
->
slice_context_count
;
i
++
)
{
for
(
i
=
0
;
i
<
h
->
slice_context_count
;
i
++
)
{
H264Context
*
c
;
H264SliceContext
*
sl
=
&
h
->
slice_ctx
[
i
];
c
=
h
->
thread_context
[
i
]
=
av_mallocz
(
sizeof
(
H264Context
));
if
(
!
c
)
sl
->
h264
=
h
;
return
AVERROR
(
ENOMEM
);
sl
->
intra4x4_pred_mode
=
h
->
intra4x4_pred_mode
+
i
*
8
*
2
*
h
->
mb_stride
;
c
->
avctx
=
h
->
avctx
;
sl
->
mvd_table
[
0
]
=
h
->
mvd_table
[
0
]
+
i
*
8
*
2
*
h
->
mb_stride
;
c
->
vdsp
=
h
->
vdsp
;
sl
->
mvd_table
[
1
]
=
h
->
mvd_table
[
1
]
+
i
*
8
*
2
*
h
->
mb_stride
;
c
->
h264dsp
=
h
->
h264dsp
;
c
->
h264qpel
=
h
->
h264qpel
;
if
((
ret
=
ff_h264_slice_context_init
(
h
,
sl
))
<
0
)
{
c
->
h264chroma
=
h
->
h264chroma
;
c
->
sps
=
h
->
sps
;
c
->
pps
=
h
->
pps
;
c
->
pixel_shift
=
h
->
pixel_shift
;
c
->
width
=
h
->
width
;
c
->
height
=
h
->
height
;
c
->
linesize
=
h
->
linesize
;
c
->
uvlinesize
=
h
->
uvlinesize
;
c
->
chroma_x_shift
=
h
->
chroma_x_shift
;
c
->
chroma_y_shift
=
h
->
chroma_y_shift
;
c
->
droppable
=
h
->
droppable
;
c
->
low_delay
=
h
->
low_delay
;
c
->
mb_width
=
h
->
mb_width
;
c
->
mb_height
=
h
->
mb_height
;
c
->
mb_stride
=
h
->
mb_stride
;
c
->
mb_num
=
h
->
mb_num
;
c
->
flags
=
h
->
flags
;
c
->
workaround_bugs
=
h
->
workaround_bugs
;
c
->
pict_type
=
h
->
pict_type
;
h
->
slice_ctx
[
i
].
h264
=
c
;
init_scan_tables
(
c
);
clone_tables
(
c
,
&
h
->
slice_ctx
[
i
],
h
,
i
);
c
->
context_initialized
=
1
;
}
for
(
i
=
0
;
i
<
h
->
slice_context_count
;
i
++
)
if
((
ret
=
ff_h264_slice_context_init
(
h
,
&
h
->
slice_ctx
[
i
]))
<
0
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"context_init() failed.
\n
"
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"context_init() failed.
\n
"
);
return
ret
;
return
ret
;
}
}
}
}
}
h
->
context_initialized
=
1
;
h
->
context_initialized
=
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