9/26/2023 0 Comments Purebasic image memory allocationSo never assume that the mempointer point to a real memory position. Which is why 64bit is the way to go if you got GFX cards with losts of mem, or and more than 2GB system mem, or plan to use SLI GFX cards etc. so with a 1GB GFX card + 4GB system mem you'll only be able to use like 2GB of that system mem. Things are a bit more complex with shared memory though.Īlso remember that on a 32bit OS a GFX card with 1GB "uses" 1GB of the system's adress space. You program will still use the same mempointers though and think nothing has changed. Then lots of other programs are ended, the OS might defragment memory by copying your program's memory to the middle of the first chip and then remap the memory there. Vista do this or not.īut as an example, if the physical memory is almost full on the system and you run your program and it gets memory at the end of the last memchip. This is just a theoretical example as I've never checked if i.e. Basically what I want to do is get the address of two images and compare their MD5 fingerprint to see if they're the same. (even with the same amount of ram as a 32bit os) The pointer returned could in the theory be any number, like 10 but actually point physically to the middle of the 2nd memchip. Location: Norway Getting memory address of image SOLVED <- haha by Joakim Christiansen Sun 9:26 pm Hi, I was wondering about how I can get the memory address to a purebasic image. I went into the code of AVSredirect and modified it a bit so it could be more handy to appl.And for a 64bit things are way different again, you'll more likely see even higher numbers there than currently. Returns the length of the Errorstring which will be stored at the *str stringpointer Scripts at given string pointers also can be handled.ĮrrorLength = avs_getlasterror(char *str, int len)) It will be accessed via stdcall and got some addons.Īvs Scripts now can be easely handled in VB, Delphi, Purebasic etc. Opens an avs file, passes the VideoInfo to *vi and returns the clipnumberĬlip = avs_script(*env, char *script, AVSDLLVideoInfo *vi, "RGB24") The linebreaks of the string do come as chr(10)+chr(13) istead of a single chr(10)Ĭlip = avs_open(*env, char *fname, AVSDLLVideoInfo *vi) Returns a string pointer where the last Error is stored. Takes a string (an avs script) strored at *script, passes the VideoInfo to *vi and returns the clipnumber. Int _stdcall avs_getvframe(IScriptEnvironment* env, int clip_num, BYTE *buf, int frm ) I added to the the avs_getvframe() function the BitBlt() so the problem about the smartpointer issue should be solved: Releases the clip and the scriptenvironment Reads the audiodata from the sample start to the sample end and stores it at the given *buffer adress Returns the adress where the Bitmap is stored.Īvs_getaframe(*env, clip, *buffer, _int64 start, _int64 count) Note, you can force the output to a given Colorpace. I used as destPitch in the BitBlt the sourcePitch as I do "assume" that it should be the same!? PVideoFrame f = clip->GetFrame(frm, env) Įnv->BitBlt(buf,f->GetPitch(), f->GetReadPtr(), f->GetPitch(), architectures is to avoid loss of information and memory management. You did made a separate _patchScript() function, which makes sense, but in case of avs_open() you do force an YV12 output! I tested the playback and it works fine on a RGB24 previewing output.ĭimzon, I had a closer look at the mod's you did on AVSRedirect. We experimented with two CNN architectures model 1, i.e., pure/basic CNN and model. Int aspectd // ->Not provided viy Avisynth Int aspectn // ->Not provided viy Avisynth I have been even thinking about getting rid of the YV12 and YUY2 output option as it makes imho no sense in case of a wrapper which gots its purpose to provide Videoframes mainly for later displaying in previewing apps. So all you need you can get from the AviFil32 API (this is just BTW) ) Int64_t num_audio_samples // Calculate from above Int num_audio_frames // From AviStreamInfo/StreamTypeAudio Int nchannels // From AviStreamInfo/StreamTypeAudio->WaveFormatEx Int sample_type // From AviStreamInfo/StreamTypeAudio->WaveFormatEx Int audio_samples_per_second // From AviStreamInfo/StreamTypeAudio->WaveFormatEx Int top_field_first // really needed? and if. So You choose 1-st variant (CPU & Memory consuming) Memory consuming? The *buf adress is fixed (in Purebasic its generated by 'pointer = AllocateMemory(size)' )where all frames will be stored at that adress and it consumpts (width*height*3) bytes. The *buf generation is done before the getting frames loop.Īnd the avs BitBlt function seems to be verrry fast related to dev reports in here. I did understand that the framedata in the memory at the "smart pointer" could get lost? And not the Adress itself!?įunction GetAVIDisplaySize(Filename:string):TPoint Means I just pass the adress to a pointer *frame ? Thats all? the approch included in Triticals Brief explanation some threads below.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |