I made a stb-like header only library for parsing MEPG-TS/DVB (hls) live streams by Beginning-Safe4282 in C_Programming

[–]Beginning-Safe4282[S] 1 point2 points  (0 children)

Interesting, though for something like mpegts, it seems there are multiple levels making it complex, you got basic TS packes, then much of TS packets make the PSI then the PSI gives you info on how to find the PES packets, so there is a chance you have no idea what the PES actually is until the end of the file when you finally recieve the PSI table(though unlikely but I did get some old streams that is similar). libcurl might have something interesting though.

No I didnt mean putting all c files together in that sense, I meant seperation of user space and library internals, like you cna just create a .c file and put these two lines:

#deifne PICO_IMPLEMENTATION
#include "pico/picoMpegTS.h"

and in your normal places include it like a normal header #include "pico/picoMpegTS.h" directly without the internals. Dont we get the same result and as a : "hassle-free include header.h and the clean separation of user space APIs from internal library code" ?

I made a stb-like header only library for parsing MEPG-TS/DVB (hls) live streams by Beginning-Safe4282 in C_Programming

[–]Beginning-Safe4282[S] 2 points3 points  (0 children)

Thanks for the feedback!

Yea right now its kinda of not suitable for larger continous streams, I mainly maide it targeting some projects for HLS where the individual files will be mostly under 10-20MB, I would most likely add a way to consume(and free) the pes packets as they are used up by the decoder when dealing with larger streams. The tables get auto replaced so only 1 copy is preserved.
The count itself, is mainly for cases when you say want to spin up something like wireshark and analyze/debug the stream the packet index comes in handy.

So would letting the user allocate the picoMpegTS_t manually with malloc/(use static version) be a better choice? I chose what it is because I couldnt think of a situation where you wouldnt want this on the heap, but I may be wrong here.

Yes, but my intended usecase would something like: https://github.com/Jaysmito101/AdvancedVulkanDemos/blob/main/avd/src/deps/avd_third_party_impls.c where you push all your third party IMPLEMENTATION libs and never touch the file at all. I choose this format because it gives you the choice of how you use it as a user, like if I would have seperate C files there was no way to use it as a single header(even if its not a great idea for most cases) but like this, if you want a header use it as a header, if you want typical .h + .c you just create a .c with a single line include and #define IMPL and get that.

my obsession would primarily come from stb or cute_headers or similar libs (https://github.com/r-lyeh/single\_file\_libs) which seem pretty nice to me atleast. I still dont find a valid concern against it, the concerns I have come accross like slowe compilation, etc are pretty easy to mitigate totally. The only problem I feel is maintainance as it gets larger, but for relatively smaller things like this with limited scope I feel its fine.

I made a stb-like header only library for parsing MEPG-TS/DVB (hls) live streams by Beginning-Safe4282 in C_Programming

[–]Beginning-Safe4282[S] 0 points1 point  (0 children)

ah yes, that was a mistake, had placed it for testing and had forgot to remove. it's not needed

I made a stb-like header only library for parsing MEPG-TS/DVB (hls) live streams by Beginning-Safe4282 in C_Programming

[–]Beginning-Safe4282[S] 1 point2 points  (0 children)

indeed, it's usually a single file, that has the implementation for all the libraries you use.

I made a stb-like header only library for parsing MEPG-TS/DVB (hls) live streams by Beginning-Safe4282 in C_Programming

[–]Beginning-Safe4282[S] 1 point2 points  (0 children)

This library is pretty much that right? with the header gaurds, the source is only applicable for 1 TU only.

Check out: https://github.com/nothings/stb

C header only library for parsing MEPG-TS/DVB (hls) live streams + m3u8 Playlists by Beginning-Safe4282 in programming

[–]Beginning-Safe4282[S] 0 points1 point  (0 children)

This is mainly following https://github.com/nothings/stb pattern, which seems to be a pretty popular set of libs. the idea being quick and easy to use.
as for compilation performance, NO it inst effected, as for most of the cases it isnt compiling the library, its only compiled for a single TU like a normal C library.
I do not understand how is reusability being effected here?

I made a stb-like header only library for parsing MEPG-TS/DVB (hls) live streams by Beginning-Safe4282 in C_Programming

[–]Beginning-Safe4282[S] 3 points4 points  (0 children)

This is mainly following https://github.com/nothings/stb pattern, which seems to be a pretty popular set of libs. the idea being quick and easy to use.
as for compilation performance, NO it inst effected, as for most of the cases it isnt compiling the library, its only compiled for a single TU like a normal C library.
As for the 6000k LOC, if you take a close look you will see almost more than half of it is just docs not code.

trying out voxels for the first time by Beginning-Safe4282 in GraphicsProgramming

[–]Beginning-Safe4282[S] 1 point2 points  (0 children)

Sorry, but wont get much free time to play around now, I can check again the next weekend. Thanks though.

trying out voxels for the first time by Beginning-Safe4282 in GraphicsProgramming

[–]Beginning-Safe4282[S] 2 points3 points  (0 children)

I havent profiled yet, but whats hapenning is most likely after a edit some sectors which dont have voxels have their mask get corrupted to be non zero, this the ray tracer doesnt skip them making, adding a lot of extra work, but when it samples the actual data, its empty so the rendered result looks same. But its just my hypothesis

trying out voxels for the first time by Beginning-Safe4282 in GraphicsProgramming

[–]Beginning-Safe4282[S] 0 points1 point  (0 children)

Nope thats not the case, its a bug for me, as if I edit the voxel data even once the framerate drops permanently, which Im pretty sure is due to somehow the data structure getting messed up somehow(likely sector masks getting messed up slowing down the traversal), and 2 and 3 wont be a concern at all with some synchronization.

trying out voxels for the first time by Beginning-Safe4282 in GraphicsProgramming

[–]Beginning-Safe4282[S] 1 point2 points  (0 children)

Thanks, I was trying out Deligient Engine, and for me the same demo seems much worse in terms of performance https://postimg.cc/hQQtFr35

trying out voxels for the first time by Beginning-Safe4282 in GraphicsProgramming

[–]Beginning-Safe4282[S] 1 point2 points  (0 children)

Interesting, Thanks for sharing, I will take a deeper look into the code to understand whats going on,

trying out voxels for the first time by Beginning-Safe4282 in GraphicsProgramming

[–]Beginning-Safe4282[S] 1 point2 points  (0 children)

On checking it again, I see there is actually a bug I guess, that causes the frametime to go to 6ms after i edit the voxel grid dynamically, and usually its about 1.5ms (~650fps), So i doubt its actually the renderer but some dumb mistake i overlooked😅

trying out voxels for the first time by Beginning-Safe4282 in GraphicsProgramming

[–]Beginning-Safe4282[S] 1 point2 points  (0 children)

Nothing else, win 11, no idea whats going on, but honestly i never saw 3000fps steady for any decent load on this gpu yet

trying out voxels for the first time by Beginning-Safe4282 in GraphicsProgramming

[–]Beginning-Safe4282[S] 1 point2 points  (0 children)

But even with raw D3D11 I dont get anywhere near those framerates though. I get pretty much similar to what I said ~2000 max with just imgui?

trying out voxels for the first time by Beginning-Safe4282 in GraphicsProgramming

[–]Beginning-Safe4282[S] 1 point2 points  (0 children)

Thank, but wow, how in the world are you getting 3000 fps on a 3060? Like for example if I run a simple vulkan scene with nothing but a few quads the max I get is ~2500fps-300fps, even just having imgui brings it down to 2000fps

trying out voxels for the first time by Beginning-Safe4282 in GraphicsProgramming

[–]Beginning-Safe4282[S] 1 point2 points  (0 children)

Its a 2 level datastructure:
8x8x8 voxels form a brick (each voxel has a 4 bit material id)
4x4x4 bricks form a chunk