There is something that probably I am doing wrong but I am asking not to have doubts.
There is this SD source that is 1280x692:
https://openload.co/f/wobfOwA6EQU/Fantozzi692vs704.mkv
When I drop it in DGIndexNV, the title tells 1280x692 and it's ok.
When I go to cropping filter and I disable it, the title tells 1280x704.
If I go again into cropping filter, every kind of auto crop gives me 1280x704.
Is there something wrong or is it wanted?
I can uderstand with 1088 to 1080 but this should not apply to SD and not give resolution increase more than native one.
[SOLVED] Resolution on SD MKV
Re: Resolution on SD MKV
The coded size is 704 and the stream specifies cropping to 692, so the cropping is set up that way upon open. If you go into the Cropping dialog and disable that then it is subsequently ignored. Autocropping works only by detecting black areas.
So what is the problem?
So what is the problem?
Re: Resolution on SD MKV
As far as I can see, coded size is 692. That is the problem.
Can you explain me where is 704 specified and how to find that value, apart from DGIndexNV?
I have tried to demux elementary video stream and still tells me 692.
Re: Resolution on SD MKV
Healthy skepticism, I love it. Time for your AVC syntax lesson.
Here is the parsing of the first SPS for the stream:
And here is how the coded height is derived:
So the coded height is (2 - 1) * (43 + 1) * 16 = 704. Note that 704 is a multiple of 16 while 692 is not.
There is additional syntax to define a cropping rectangle. See the next post.
![Laughing :lol:](./images/smilies/icon_lol.gif)
Here is the parsing of the first SPS for the stream:
And here is how the coded height is derived:
Code: Select all
PicHeightInMapUnits = sps->pic_height_in_map_units_minus1 + 1;
FrameHeightInMbs = (2 - sps->frame_mbs_only_flag) * PicHeightInMapUnits;
coded_height = FrameHeightInMbs * 16;
There is additional syntax to define a cropping rectangle. See the next post.
Re: Resolution on SD MKV
Here is the full algorithm to get the cropped size:
I hope it is clear. Nothing is simple anymore in video compression. ![Sad :(](./images/smilies/icon_e_sad.gif)
Code: Select all
int SubWidthC;
int SubHeightC;
if (sps->chroma_format_idc == 0 && sps->separate_colour_plane_flag == 0) { //monochrome
SubWidthC = SubHeightC = 0;
}
else if (sps->chroma_format_idc == 1 && sps->separate_colour_plane_flag == 0) { //4:2:0
SubWidthC = SubHeightC = 2;
}
else if (sps->chroma_format_idc == 2 && sps->separate_colour_plane_flag == 0) { //4:2:2
SubWidthC = 2;
SubHeightC = 1;
}
else if (sps->chroma_format_idc == 3) { //4:4:4
if (sps->separate_colour_plane_flag == 0) {
SubWidthC = SubHeightC = 1;
}
else if (sps->separate_colour_plane_flag == 1) {
SubWidthC = SubHeightC = 0;
}
}
int PicWidthInMbs = sps->pic_width_in_mbs_minus1 + 1;
int PicHeightInMapUnits = sps->pic_height_in_map_units_minus1 + 1;
int FrameHeightInMbs = (2 - sps->frame_mbs_only_flag) * PicHeightInMapUnits;
int crop_left = 0;
int crop_right = 0;
int crop_top = 0;
int crop_bottom = 0;
if (sps->frame_cropping_flag) {
crop_left = sps->frame_crop_left_offset;
crop_right = sps->frame_crop_right_offset;
crop_top = sps->frame_crop_top_offset;
crop_bottom = sps->frame_crop_bottom_offset;
}
int width = PicWidthInMbs * 16 - SubWidthC * (crop_left + crop_right);
int height = FrameHeightInMbs * 16 - SubHeightC * (2 - sps->frame_mbs_only_flag) * (crop_top + crop_bottom);
![Sad :(](./images/smilies/icon_e_sad.gif)
Re: Resolution on SD MKV
BTW, that parser application is ridiculously expensive ($60 per month
). I have a version from its freeware days. You can also run the debugger on the HM reference software in a pinch.
![Wow :wow:](./images/smilies/icon_eek2.gif)
Re: [SOLVED] Resolution on SD MKV
I am really really thankful for your explanation. ![grateful :salute:](./images/smilies/icon_salute.gif)
![grateful :salute:](./images/smilies/icon_salute.gif)
Re: [SOLVED] Resolution on SD MKV
Happy to be helpful!