Giter Site home page Giter Site logo

lieff / minih264 Goto Github PK

View Code? Open in Web Editor NEW
527.0 28.0 51.0 30.25 MB

Minimalistic H264/SVC encoder single header library

License: Creative Commons Zero v1.0 Universal

C 77.21% Shell 0.93% Assembly 21.86%
h264 svc h264-svc video codec encoder single-header encoding mini minimal

minih264's People

Contributors

erjanmx avatar lieff avatar oferze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minih264's Issues

Filesize

Hey Lieff, thanks for this library and minimp4, I'm compiling them to WASM for the web here using Emscripten and it's working well.

Something that came up is a filesize concern. I did a quick test with 30 1920x1080 frames of Big Buck Bunny and the resulting MP4 is 11MB (gop=20, speed=0, qp_min=10, qp_max=10). But, using that output MP4, running default ffmpeg -i vid.mp4 vid2.mp4 produces a 181KB file. Is there something I might be doing wrong in minih264 that would produce such high file sizes compared to ffmpeg's default encoders?

About decoder.

Hi,bro. Thx for your awesome work. Do you have plan to create a decoder which is headed only. And can you recommend another single decoder lib which can decode your minih264. Thx :D.

How to compile

I dont't know how to compile this file,tell me the steps please.

Multithreading support

I couldn't find any info about the state of multithreading in this library. Can you please explain more?

how to set temporal layer size to 3?

// Number of SVC layers: // 1 = AVC // 2 = SVC with 2-layers of spatial scalability int num_layers;
if I want to encode 3 temporal layers, 1 spatial layer, what should I do?

About Cross-platform

Hello, I want to run minih264 on a Mac system. Does it support cross-platform use?

apple silicon support

  1. asm version seems to have undefined types
./asm/minih264e_asm.h:33:59: error: unknown type name 'pix_t'
H264E_API(int,  h264e_transform_sub_quant_dequant, (const pix_t *inp, const pix_t *pred, int inp_stride, int mode, quant_t *q, const uint16_t *qdat))
  1. intrinsic version has errors related to incompatible type 'uint8x8_t'
In file included from ./encoder.go:3:
In file included from ./encoder.h:7:
./minih264e.h:5604:62: error: call to undeclared function 'vtbl2q_u8'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                vst1_s16(q->qv + 0, d4 = vreinterpret_s16_u8(vtbl2q_u8(vlut, vget_low_u8(q8))));
                                                             ^
./minih264e.h:5604:62: error: passing 'int' to parameter of incompatible type 'uint8x8_t' (vector of 8 'uint8_t' values)
                vst1_s16(q->qv + 0, d4 = vreinterpret_s16_u8(vtbl2q_u8(vlut, vget_low_u8(q8))));
                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:27007:20: note: expanded from macro 'vst1_s16'
  int16x4_t __s1 = __p1; \
                   ^~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:59122:46: note: passing argument to parameter '__p0' here
__ai int16x4_t vreinterpret_s16_u8(uint8x8_t __p0) {
                                             ^
In file included from ./encoder.go:3:
In file included from ./encoder.h:7:
./minih264e.h:5605:62: error: call to undeclared function 'vtbl2q_u8'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                vst1_s16(q->qv + 4, d5 = vreinterpret_s16_u8(vtbl2q_u8(vlut, vget_high_u8(q8))));
                                                             ^
./minih264e.h:5605:62: error: passing 'int' to parameter of incompatible type 'uint8x8_t' (vector of 8 'uint8_t' values)
                vst1_s16(q->qv + 4, d5 = vreinterpret_s16_u8(vtbl2q_u8(vlut, vget_high_u8(q8))));
                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:27007:20: note: expanded from macro 'vst1_s16'
  int16x4_t __s1 = __p1; \
                   ^~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:59122:46: note: passing argument to parameter '__p0' here
__ai int16x4_t vreinterpret_s16_u8(uint8x8_t __p0) {
                                             ^
In file included from ./encoder.go:3:
In file included from ./encoder.h:7:
./minih264e.h:5606:62: error: call to undeclared function 'vtbl2q_u8'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                vst1_s16(q->qv + 8, d6 = vreinterpret_s16_u8(vtbl2q_u8(vlut, vget_low_u8(q9))));
                                                             ^
./minih264e.h:5606:62: error: passing 'int' to parameter of incompatible type 'uint8x8_t' (vector of 8 'uint8_t' values)
                vst1_s16(q->qv + 8, d6 = vreinterpret_s16_u8(vtbl2q_u8(vlut, vget_low_u8(q9))));
                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:27007:20: note: expanded from macro 'vst1_s16'
  int16x4_t __s1 = __p1; \
                   ^~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:59122:46: note: passing argument to parameter '__p0' here
__ai int16x4_t vreinterpret_s16_u8(uint8x8_t __p0) {
                                             ^
In file included from ./encoder.go:3:
In file included from ./encoder.h:7:
./minih264e.h:5607:62: error: call to undeclared function 'vtbl2q_u8'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                vst1_s16(q->qv +12, d7 = vreinterpret_s16_u8(vtbl2q_u8(vlut, vget_high_u8(q9))));
                                                             ^
./minih264e.h:5607:62: error: passing 'int' to parameter of incompatible type 'uint8x8_t' (vector of 8 'uint8_t' values)
                vst1_s16(q->qv +12, d7 = vreinterpret_s16_u8(vtbl2q_u8(vlut, vget_high_u8(q9))));
                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:27007:20: note: expanded from macro 'vst1_s16'
  int16x4_t __s1 = __p1; \
                   ^~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:59122:46: note: passing argument to parameter '__p0' here
__ai int16x4_t vreinterpret_s16_u8(uint8x8_t __p0) {

Inputs other than CIF?

Hi! This is a very impressive project, kudos for pulling it off. :-)

Since the only example given uses CIF input with all of the restrictions that implies (352x288 resolution, 30000/1001 framerate, YCbCr color representation, etc.), I'm wondering to what extent those restrictions are currently hard coded into the encoder. I'd love to use minih264 in a project I'm writing as a backup option for cases when ffmpeg is not available, but that requires dealing with arbitrary resolution frames of RGBA images (which I can, of course, transform on the fly, but the resolution part isn't flexible). Is that something that would be doable with reasonable effort, or am I pushing too far beyond the scope of your intentions for this project?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.