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
a88e1d1c
Commit
a88e1d1c
authored
Apr 23, 2014
by
Janne Grunau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavu: add CHK_OFFS as AV_CHECK_OFFSET to check struct member offsets
parent
152b797c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
13 deletions
+15
-13
asm-offsets.h
libavcodec/arm/asm-offsets.h
+0
-7
mpegvideo_arm.c
libavcodec/arm/mpegvideo_arm.c
+8
-6
internal.h
libavutil/internal.h
+7
-0
No files found.
libavcodec/arm/asm-offsets.h
View file @
a88e1d1c
...
@@ -21,13 +21,6 @@
...
@@ -21,13 +21,6 @@
#ifndef AVCODEC_ARM_ASM_OFFSETS_H
#ifndef AVCODEC_ARM_ASM_OFFSETS_H
#define AVCODEC_ARM_ASM_OFFSETS_H
#define AVCODEC_ARM_ASM_OFFSETS_H
#ifndef __ASSEMBLER__
#include <stddef.h>
#define CHK_OFFS(s, m, o) struct check_##o { \
int x_##o[offsetof(s, m) == o? 1: -1]; \
}
#endif
/* MpegEncContext */
/* MpegEncContext */
#define Y_DC_SCALE 0xa8
#define Y_DC_SCALE 0xa8
#define C_DC_SCALE 0xac
#define C_DC_SCALE 0xac
...
...
libavcodec/arm/mpegvideo_arm.c
View file @
a88e1d1c
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
#include "libavutil/internal.h"
#include "libavutil/arm/cpu.h"
#include "libavutil/arm/cpu.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/mpegvideo.h"
#include "libavcodec/mpegvideo.h"
...
@@ -25,12 +26,13 @@
...
@@ -25,12 +26,13 @@
#include "asm-offsets.h"
#include "asm-offsets.h"
#if HAVE_NEON
#if HAVE_NEON
CHK_OFFS
(
MpegEncContext
,
y_dc_scale
,
Y_DC_SCALE
);
AV_CHECK_OFFSET
(
MpegEncContext
,
y_dc_scale
,
Y_DC_SCALE
);
CHK_OFFS
(
MpegEncContext
,
c_dc_scale
,
C_DC_SCALE
);
AV_CHECK_OFFSET
(
MpegEncContext
,
c_dc_scale
,
C_DC_SCALE
);
CHK_OFFS
(
MpegEncContext
,
ac_pred
,
AC_PRED
);
AV_CHECK_OFFSET
(
MpegEncContext
,
ac_pred
,
AC_PRED
);
CHK_OFFS
(
MpegEncContext
,
block_last_index
,
BLOCK_LAST_INDEX
);
AV_CHECK_OFFSET
(
MpegEncContext
,
block_last_index
,
BLOCK_LAST_INDEX
);
CHK_OFFS
(
MpegEncContext
,
inter_scantable
.
raster_end
,
INTER_SCANTAB_RASTER_END
);
AV_CHECK_OFFSET
(
MpegEncContext
,
inter_scantable
.
raster_end
,
CHK_OFFS
(
MpegEncContext
,
h263_aic
,
H263_AIC
);
INTER_SCANTAB_RASTER_END
);
AV_CHECK_OFFSET
(
MpegEncContext
,
h263_aic
,
H263_AIC
);
#endif
#endif
void
ff_dct_unquantize_h263_inter_neon
(
MpegEncContext
*
s
,
int16_t
*
block
,
void
ff_dct_unquantize_h263_inter_neon
(
MpegEncContext
*
s
,
int16_t
*
block
,
...
...
libavutil/internal.h
View file @
a88e1d1c
...
@@ -84,6 +84,13 @@
...
@@ -84,6 +84,13 @@
// to be forced to tokenize __VA_ARGS__
// to be forced to tokenize __VA_ARGS__
#define E1(x) x
#define E1(x) x
/* Check if the hard coded offset of a struct member still matches reality.
* Induce a compilation failure if not.
*/
#define AV_CHECK_OFFSET(s, m, o) struct check_##o { \
int x_##o[offsetof(s, m) == o? 1: -1]; \
}
#define LOCAL_ALIGNED_A(a, t, v, s, o, ...) \
#define LOCAL_ALIGNED_A(a, t, v, s, o, ...) \
uint8_t la_##v[sizeof(t s o) + (a)]; \
uint8_t la_##v[sizeof(t s o) + (a)]; \
t (*v) o = (void *)FFALIGN((uintptr_t)la_##v, a)
t (*v) o = (void *)FFALIGN((uintptr_t)la_##v, a)
...
...
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