Commit a5e59fec authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

avcodec/ffv1: Move ffv1_template.c inclusion to dec/enc templates

Both the FFV1 decoder and encoder use a template of their own
to generate code multiple times. They also use a common template,
used by both decoder and encoder templates which is currently
instantiated in ffv1.h (and therefore also in ffv1.c, which
doesn't need it at all).

All these templates have the prerequisite that two macros
are defined, namely RENAME() and TYPE. The codec-specific
templates call the functions generated via the common template
via the RENAME() macro and therefore the macros used for
the common template must coincide with the macros used for
the codec-specific templates. But then it is better to not
instantiate the common template in ffv1.h, but in the codec
specific templates.
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
parent f63c6c81
......@@ -182,16 +182,4 @@ static inline void update_vlc_state(VlcState *const state, const int v)
state->count = count;
}
#define TYPE int16_t
#define RENAME(name) name
#include "ffv1_template.c"
#undef TYPE
#undef RENAME
#define TYPE int32_t
#define RENAME(name) name ## 32
#include "ffv1_template.c"
#undef TYPE
#undef RENAME
#endif /* AVCODEC_FFV1_H */
......@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "ffv1_template.c"
static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w,
TYPE *sample[2],
int plane_index, int bits)
......
......@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "ffv1_template.c"
static av_always_inline int RENAME(encode_line)(FFV1Context *s, int w,
TYPE *sample[3],
int plane_index, int bits)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment