Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
7th November 2016, 13:01 | #2581 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,309
|
Quote:
When using my latest Avisynth.h, this Is444 call is mapped silently to IsYV24 if the relevant avisynth host has no Is444() implemented. |
|
7th November 2016, 15:04 | #2584 | Link |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,664
|
Feature request
Can we add a straightforward way to get the chroma width and height? Right now we have to do something like UToY8().Width(). Maybe something like Width(chroma=true) or uv=true. Thoughts?
|
7th November 2016, 19:42 | #2585 | Link |
Registered User
Join Date: Jan 2014
Posts: 2,309
|
Avisynth arrays status report:
Implemented empty arrays and [] syntax for array creation Code:
clip=ffms2(film).ConvertBits(16) empty_array = [] empty_array_2 = empty_array #n3 = empty_array_2.ArrayGet(0) # array index out of range error! black_yuv_16 = [0,32768,32768] # or black_yuv_16 = Array( 0,32768,32768) grey_yuv_16 = [32768,32768,32768] white_yuv_16 = [65535,32768,32768] # getting deeper: nested arrays aSelectColors = [\ ["black", black_yuv_16],\ ["grey", grey_yuv_16],\ ["white", white_yuv_16],\ ["empty", empty_array]\ ] test_array = [99, 1.0, "this is a string"] # mixed types test_array2 = [199, 2.0, "This is a string"] n = ArraySize(test_array) # 3 n2 = ArraySize(empty_array_2) # 0 clip = clip.SubTitle("Array size = " + String(n) +\ " Empty array size = " + String(n2) +\ " [0]=" + String(ArrayGet(test_array,0)) + \ " [1]=" + String(ArrayGet(test_array,1)) + \ " [2]=" + ArrayGet(test_array,2)) black=blankClip(clip, length=1, colors = ArrayGet(aSelectColors,"black")) # value lookup by name white=blankClip(clip, length=1, colors = aSelectColors.ArrayGet("white")) # value lookup by name grey=blankClip(clip, length=1, colors = [32768,32768,32768]) # or direct array blackwhite = black+grey+white+black+grey+white n=3 clip = clip.Trim(0,n) + blackwhite + clip.Trim(n+1,499) clip |
8th November 2016, 09:52 | #2586 | Link |
Registered User
Join Date: Nov 2010
Posts: 123
|
3> limiter.cpp
3>C:\AviSynthPlus\avs_core\filters\limiter.cpp(107): error C3861: '_mm_max_epu16': identifier not found 3>C:\AviSynthPlus\avs_core\filters\limiter.cpp(108): error C3861: '_mm_min_epu16': identifier not found ... //min and max values are 16-bit unsigned integers inline void limit_plane_uint16_sse4(BYTE *ptr, unsigned int min_value, unsigned int max_value, int pitch, int height) { __m128i min_vector = _mm_set1_epi16(min_value); __m128i max_vector = _mm_set1_epi16(max_value); BYTE* end_point = ptr + pitch * height; while(ptr < end_point) { __m128i src = _mm_load_si128(reinterpret_cast<const __m128i*>(ptr)); src = _mm_max_epu16(src, min_vector); src = _mm_min_epu16(src, max_vector); _mm_store_si128(reinterpret_cast<__m128i*>(ptr), src); ptr += 16; } } ... This break compilation process ?! Help? |
8th November 2016, 10:21 | #2587 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,309
|
Quote:
#include <smmintrin.h> // for sse41 at the top of limiter.cpp |
|
8th November 2016, 13:12 | #2589 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
I would do this by changing the parser's ParseOOP() function - in the two places it currently calls ParseFunction(), it would instead call a new function ParseIndex(), which would look like this:
Code:
PExpression ScriptParser::Parseindex(PExpression context) { PExpression result = ParseFunction(context); while (tokenizer.IsOperator('[') { tokenizer.NextToken(); result = new ExpIndex(result, ParseConditional()); Expect(']'); } return result; } - x.f(2)[3], where f is a function returning an array (no need to put brackets round x.f(2)) - a[1]["white"], where a is a multi-dimensional array - a[1].f(2), equivalent to f(a[1], 2) ExpIndex is a new Expression subtype whose Evaluate() function calls the built-in ArrayIndex function. Last edited by Gavino; 8th November 2016 at 13:25. |
8th November 2016, 13:55 | #2590 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,309
|
Quote:
All other things are done, now I'm doing compound index formats e.g. a[1,2,3]; a[1][2][3] is working already |
|
8th November 2016, 15:28 | #2591 | Link |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,308
|
I've looked on post #2484, but don't find an answer.
If i have a planar YUV mode with alpha channel, and i'm doing the following : Code:
vu = env->Invoke("UtoY8",v).AsClip(); vv = env->Invoke("VtoY8",v).AsClip(); v = env->Invoke("ConvertToY8",v).AsClip(); Is it still on v ? If still on Y, is doing the following, putting everything back : Code:
AVSValue ytouvargs[3] = {vu,vv,v}; v=env->Invoke("YtoUV",AVSValue(ytouvargs,3)).AsClip(); |
8th November 2016, 17:50 | #2592 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,309
|
Quote:
Then there became too much color formats after having Planar RGB and A channel. Instead of making AtoY8, RtoY8, GtoY8, BtoY8, there is a PlaneToY(plane_string) in Avisynth+ that creates a greyscale clip from the relevant channel. E.g. PlaneToY("A), PlaneToY("R") PlaneToY accepts any plane identifier (Y,U,V,A,R,G,B) PlaneToY("U") is equivalent to UToY8 PlaneToY("V") is equivalent to VToY8 PlaneToY("Y") is equivalent to ConvertToY (ConvertToY8) All the above functions keep the current bitdepth, the Y8 ending is just because UToY and VToY was already existing functions. Regarding the back conversion, YtoUV only has U,V and an optional Y clip parameter. To answer on your question, it seems, there is no function for putting A channel back to a YUVA clip. I always wanted to make a general way mixing together arbitrary planes, something like ShufflePlanes in VapourSynth. Albeit there is MergeRGB and MergeARGB for packed and planar RGB, it seems that making the same for YUV is missing. On more reason for implementing a general MergePlanes or something like that. Now I'm considering that. |
|
9th November 2016, 12:58 | #2595 | Link |
Registered User
Join Date: Oct 2002
Location: France
Posts: 2,308
|
Because there is shift to make on chroma only for other modes than 4:4:4, and use of turnleft/right, so need to separate planes in 4:2:2 to have things done properly.
But, this is only for nnedi3_rpow indeed, not nnedi3. Last edited by jpsdr; 9th November 2016 at 13:02. |
10th November 2016, 21:35 | #2599 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,309
|
Quote:
Driven by the popular demand I prepared some new stuffs for those who are mixing planes as a daily routine. Since it is still not released, you can comment it freely and make wish-list. 20161110 Avisynth plus additions New functions
The functions convert to greyscale, keeping the original bit-depth, not only 8 bits! Y8 naming was kept, because UToY and VToY already existed. Extended function syntax old: YToUV(clip clipU, clip clipV [, clip clipY ] ) new: YToUV(clip clipU, clip clipV [, clip clipY [, clip clipA] ] ) YToUV accepts optional alpha clip after Y clip Example Code:
U = source.UToY8() V = source.VToY8() Y = source.ConvertToY() A = source.AddAlphaPlane(128).AToY8() # swaps V, U and A, Y YToUV(V,U,A,Y).Histogram("levels").Info().RemoveAlphaPlane() CombinePlanes(clip1 [,clip2, clip3, clip4], string planes [, string source_planes, string pixel_type, string sample_clip]) Combines planes of source clip(s) into a target clip. Similar to ShufflePlanes in Vapoursynth. clip sample_clip (optional) If sample_clip is given, target clip properties are copied from that clip If no sample_clip is provided, then clip1 provides the template for target clip string pixel_type (optional) An optional pixel_type string (e.g."YV24", "YUV420PS", "RGBP8") can override the base video format. clip clip1, ... clip4 If the source clip count is less than the given planes defined, then the last available clip is used as a source for all later planes string planes the target plane order (e.g. "YVU", "YYY", "RGB") missing target planes will be undefined in the target string source_planes (optional) the source plane order, defaulting to "YUVA" or "RGBA" depending on the video format Source clips can even be mixed from greyscale, YUV, YUVA, planar RGB(A), the only rule that the relevant source plane character should match with the clip format, respectively. Example#1 Code:
#combine greyscale clips into YUVA clip source=source.AddAlphaPlane(128) U8 = source.UToY8() V8 = source.VToY8() Y8 = source.ConvertToY() A8 = source.AToY8() CombinePlanes(Y8, U8, V8, A8, planes="YUVA", source_planes="YYYY", sample_clip=source) #pixel_type="YUVA420P8" Code:
# Copy planes between planar RGB(A) and YUV(A) without any conversion # useful if you have a filter that accepts only YUV input # yuv 4:4:4 <-> planar rgb source = last.ConvertBits(32) # 4:4:4 cast_to_planarrgb = CombinePlanes(source, planes="RGB", source_planes="YUV", pixel_type="RGBPS") # get back a clip identical with "source" cast_to_yuv = CombinePlanes(cast_to_planarrgb, planes="YUV", source_planes="RGB", pixel_type="YUV444PS") Code:
#create a black and white planar RGB clip using Y channel #source is a YUV clip grey = CombinePlanes(source, planes="RGB", source_planes="YYY", pixel_type="RGBP8") Code:
#copy luma from one clip, U and V from another #source is the template #sourceY is a Y or YUV clip #sourceUV is a YUV clip clip = CombinePlanes(sourceY, sourceUV, planes="YUV", source_planes="YUV", sample_clip = source) |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|