G12 Release - available from the autobuild server - page 7 - CHDK Releases - CHDK Forum

G12 Release - available from the autobuild server

  • 136 Replies
  • 88902 Views
Re: G12 beta release
« Reply #60 on: 20 / February / 2011, 05:19:04 »
Advertisements

Zebra works correctly for me in all of the shooting modes on the G12.
Have you included the zebra code updates in gui_osd.c that use the new functions in lib.c?

Regards,
Phil.


I dont understand what you mean, i use the 1050 build, is this not in ?
I test also your aspect settings in camera.h.but this settings always work wrong on my Camera with 16:9 TFT display

IX1000 use the values that are add from the SX210 port.below you see sx 30 values

Code: [Select]

  #undef ASPECT_XCORRECTION
   #define ASPECT_XCORRECTION(x)  (((x)<<1))   //correction x*screen_buffer_width/screen_width = x*960/480 = x*2/1

   #undef ASPECT_GRID_XCORRECTION
   #define ASPECT_GRID_XCORRECTION(x)  ( ((x)<<3)/8  )  //grids are designed on a 360x240 basis and screen is 320x240, we need x*320/360=x*8/9  ,  8 is the right value for sx210
   #undef ASPECT_GRID_YCORRECTION
   #define ASPECT_GRID_YCORRECTION(y)  ( (y) )       //y correction for grids  made on a 360x240 As the buffer is 720x240 we have no correction here.


   #undef ASPECT_VIEWPORT_XCORRECTION
   #define ASPECT_VIEWPORT_XCORRECTION(x) ASPECT_GRID_XCORRECTION(x) //viewport is 360x240 and screen 320x240, we need x*320/360=x*8/9, equal than grids, used by edgeoverlay
   #undef ASPECT_VIEWPORT_YCORRECTION
    #define ASPECT_VIEWPORT_YCORRECTION(y) ( (y) )



    /* from sx30 do not work on 16:9 Camera display, so its deactive.
    #undef ASPECT_XCORRECTION
    #define ASPECT_XCORRECTION(x)  ( ( ((x)<<3) + (x) )  >>2 )   //correction x*screen_buffer_width/screen_width = x*720/320 = x*9/4 = (x<<3 + x)>>2

    //grids
    #undef ASPECT_GRID_XCORRECTION
    #define ASPECT_GRID_XCORRECTION(x)  ( ((x)<<3)/9  )  //grids are designed on a 360x240 basis and screen is 320x240, we need x*320/360=x*8/9
    #undef ASPECT_GRID_YCORRECTION
    #define ASPECT_GRID_YCORRECTION(y)  ( (y) )       //y correction for grids  made on a 360x240 As the buffer is 720x240 we have no correction here.

    //viewport
    #undef ASPECT_VIEWPORT_XCORRECTION
    #define ASPECT_VIEWPORT_XCORRECTION(x) ASPECT_GRID_XCORRECTION(x) //viewport is 360x240 and screen 320x240, we need x*320/360=x*8/9, equal than grids, used by edgeoverlay
    #undef ASPECT_VIEWPORT_YCORRECTION
    #define ASPECT_VIEWPORT_YCORRECTION(y) ( (y) )
    */
« Last Edit: 20 / February / 2011, 05:21:47 by Bernd R »
Ixus 1000 HS

Re: G12 beta release
« Reply #61 on: 20 / February / 2011, 06:21:38 »
I mean with sources this from here.

http://tools.assembla.com/chdk/timeline

are this sources in release 1050 should be ok to get zebra working on Camera with 16:9 TFT display  ?
Ixus 1000 HS

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: G12 beta release
« Reply #62 on: 20 / February / 2011, 17:37:32 »
I mean with sources this from here.

http://tools.assembla.com/chdk/timeline

are this sources in release 1050 should be ok to get zebra working on Camera with 16:9 TFT display  ?
Yes all of the necessary code changes should be in 1050 (and later).

Do you have CAM_ZEBRA_ASPECT_ADJUST defined?

There are two different versions of gui_osd_draw_zebra in gui_osd.c based on whether CAM_ZEBRA_ASPECT_ADJUST is defined or not. My changes are only in the version where CAM_ZEBRA_ASPECT_ADJUST is defined. I don't have a camera that doesn't have this so I could not test any changes to the other version.

If the Ixus1000 doesn't define CAM_ZEBRA_ASPECT_ADJUST then you will need to modify the second version of gui_osd_draw_zebra to use the offset functions.

Regards,
Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: G12 beta release
« Reply #63 on: 21 / February / 2011, 06:04:31 »
I mean with sources this from here.

http://tools.assembla.com/chdk/timeline

are this sources in release 1050 should be ok to get zebra working on Camera with 16:9 TFT display  ?
Yes all of the necessary code changes should be in 1050 (and later).

Do you have CAM_ZEBRA_ASPECT_ADJUST defined?

There are two different versions of gui_osd_draw_zebra in gui_osd.c based on whether CAM_ZEBRA_ASPECT_ADJUST is defined or not. My changes are only in the version where CAM_ZEBRA_ASPECT_ADJUST is defined. I don't have a camera that doesn't have this so I could not test any changes to the other version.

If the Ixus1000 doesn't define CAM_ZEBRA_ASPECT_ADJUST then you will need to modify the second version of gui_osd_draw_zebra to use the offset functions.

Regards,
Phil.


I have in camera.h this in

#define CAM_ZEBRA_ASPECT_ADJUST 1

But i use for test a 3to2 grid.this draw on top and button only 2 lines

on a 16:9 shooting mode, it draw the lines not large enough.on a 4:3 shooting mode, it draw the lines at X 0, but should begin to draw at X60.

4:3 shoot mode on 16:9 display is simular in code as a 1:1 shoot mode on 4:3 display.
maybe i should first look wy grid not work, because code is not so complex as zebra
Ixus 1000 HS

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: G12 beta release
« Reply #64 on: 21 / February / 2011, 15:51:16 »
I have in camera.h this in

#define CAM_ZEBRA_ASPECT_ADJUST 1

I'll take another look at the code for the zebra offsets. If you have another camera it would help to see a photo of exactly what the zebra looks like when you choose 4:3 shooting mode.

Quote
But i use for test a 3to2 grid.this draw on top and button only 2 lines

on a 16:9 shooting mode, it draw the lines not large enough.on a 4:3 shooting mode, it draw the lines at X 0, but should begin to draw at X60.

4:3 shoot mode on 16:9 display is simular in code as a 1:1 shoot mode on 4:3 display.
maybe i should first look wy grid not work, because code is not so complex as zebra

The offset functions I added only affect zebra, histogram, motion detect and edge overlay. They don't do anything for grids.

As I understand it grids assume a 4:3 display and are hard wired for this - so the 3to2 grid defines two horizontal lines (at the top and bottom). These mark the area on the 4:3 LCD that a 3:2 image occupies. The grid is not altered by the shooting mode. if I select the 3:2 shooting mode then the grid and the image align on the G12, if I select 1:1 the grid still extends the full width of the LCD. In other words the grid is relative to the physical LCD regardless of the size and aspect ratio of the image within it.

On a 16:9 display you would need a different grid definition for a 3to2 grid - it should show as 2 vertical lines to mark the area a 3:2 image would occupy on the 16:9 LCD.

Regards,
Phil.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: G12 beta release
« Reply #65 on: 22 / February / 2011, 07:01:53 »
Quote
I'll take another look at the code for the zebra offsets. If you have another camera it would help to see a photo of exactly what the zebra looks like when you choose 4:3 shooting mode.

I have add value output of zebra.see that code

Code: [Select]
int gui_osd_draw_zebra(int show)
....
   viewport_height = vid_get_viewport_height();
    viewport_width = vid_get_viewport_width();
    viewport_buffer_width = vid_get_viewport_buffer_width();
viewport_xoffset = vid_get_viewport_xoffset();
viewport_yoffset = vid_get_viewport_yoffset();
// debug output begin
static char osd_buf[64];
       sprintf(osd_buf, "viewport_width :%8d  ", viewport_width);
        draw_txt_string(28, 3, osd_buf, conf.osd_color);

        sprintf(osd_buf, "viewport_buffer_width %8d ", viewport_buffer_width);
        draw_txt_string(28, 4, osd_buf, conf.osd_color);

        sprintf(osd_buf, "viewport_xoffset :%8d  ", viewport_xoffset);
        draw_txt_string(28, 5, osd_buf, conf.osd_color);
// debug output end

when zebra is ok then
viewport_width  480
viewport_buffer_width  480
viewport_xoffset  0

when a 4:3 shooting mode is select, i get that values
viewport_width  360
viewport_buffer_width  480
viewport_xoffset  60

problem is that the left pos of the zebra draw is not shift by 60 pixels to right.
as you can see, on debug output, the code in lib look correct and return the x position

Canon Firmware draw the preview from X 60.on left side there is a black gap.so zebra need shift 60 Pixels to right.

i think when G12 is in 1:1 shoot mode

you should get simular values

viewport_width 240
viewport_buffer_width  360
viewport_xoffset  60

zebra buffer G12 use, i cannot use, maybe your code work only with zebra buffer now ?

EDIT:

I add code and shift grid 60 pixel to right work ok.In 4:3 shoot mode all is ok then.
But in 16:9 shoot mode, grid size is still too small.

I try to scale the values, but it seem float seem not work or my code is wrong.
when i calc the float value size vid_get_viewport_width  /360  = 480 / 360.mean 1.33 in float

so the line that is draw, should be longer.because X 360* 1.33 = 478.8

Code: [Select]
void gui_grid_draw_osd(int force) {
    struct gline  *ptr;
+    int   xoffs = vid_get_viewport_xoffset();
+    float size = vid_get_viewport_width() /360 ;
    if (force || --interval==0) {
        for (ptr=head; ptr; ptr=ptr->next) {
+             float x0 = ptr->x0*size+xoffs;
+             float x1 = ptr->x1*size+xoffs;
            switch (ptr->type) {
                case GRID_ELEM_LINE:
-                      draw_line(ptr->x0, ptr->y0, ptr->x1, ptr->y1, (conf.grid_force_color)?conf.grid_color:ptr->clf);
+                    draw_line(x0, ptr->y0,x1, ptr->y1, (conf.grid_force_color)?conf.grid_color:ptr->clf);
 ......

change in other too

« Last Edit: 22 / February / 2011, 07:40:27 by Bernd R »
Ixus 1000 HS

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: G12 beta release
« Reply #66 on: 22 / February / 2011, 20:45:40 »

I have add value output of zebra.see that code

when zebra is ok then
viewport_width  480
viewport_buffer_width  480
viewport_xoffset  0

when a 4:3 shooting mode is select, i get that values
viewport_width  360
viewport_buffer_width  480
viewport_xoffset  60

problem is that the left pos of the zebra draw is not shift by 60 pixels to right.
as you can see, on debug output, the code in lib look correct and return the x position

Canon Firmware draw the preview from X 60.on left side there is a black gap.so zebra need shift 60 Pixels to right.

i think when G12 is in 1:1 shoot mode

you should get simular values

viewport_width 240
viewport_buffer_width  360
viewport_xoffset  60

zebra buffer G12 use, i cannot use, maybe your code work only with zebra buffer now ?

I can't see anything wrong so I'm stumped - as I said earlier it would help me a lot to see a photograph of what the 4:3 zebra looks like on the LCD.

Also does the edge-overlay work correctly or does it have a problem?

Quote
EDIT:

I add code and shift grid 60 pixel to right work ok.In 4:3 shoot mode all is ok then.
But in 16:9 shoot mode, grid size is still too small.

I try to scale the values, but it seem float seem not work or my code is wrong.
when i calc the float value size vid_get_viewport_width  /360  = 480 / 360.mean 1.33 in float

so the line that is draw, should be longer.because X 360* 1.33 = 478.8


I haven't looked at the grid system closely so I don't know what the correct approach here would be. Are there any other cameras with 16:9 LCD's that have solved this?

Regards,
Phil.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: G12 beta release
« Reply #67 on: 23 / February / 2011, 06:37:25 »

I can't see anything wrong so I'm stumped - as I said earlier it would help me a lot to see a photograph of what the 4:3 zebra looks like on the LCD.

Also does the edge-overlay work correctly or does it have a problem?


here i have upload 3 images.you can see the zebra of the window is draw too far left and you can see the
debug output of the values.

http://www.zshare.net/download/869753874752dec8/

Edge overlay too not work in shooting mode(same problem, is draw too much left).
but edge overlay work in play mode on 4:3 display.

maybe you have a idea how can fix this and it work with other Cams too ?

or is it possible that the buffer addresses are wrong.but i dont think so, because i see only problem, in 4:3 shoot mode.

Code: [Select]
// Live picture buffer (shoot not pressed) //ASM1989  keept like sx210
void *vid_get_viewport_live_fb()
{


    return 0x0;
/*
  //sx210 code left
    void **fb=(void **)0x2180;                               // 0x2150 or 0x2180 (old SX200) ???? What for SX210
    unsigned char buff = *((unsigned char*)0x2058);          // found at FF84FA18 (guess work)
    if (buff == 0) buff = 2;  else buff--;
    return fb[buff];*/


}



// OSD buffer  //ASM1989 ixsu1000
void *vid_get_bitmap_fb()
{
return (void*)0x40471000;                              // found at FFA97414
}



// Live picture buffer (shoot half-pressed) //ASM1989 ixus1000
void *vid_get_viewport_fb()
{
return (void*)0x40587700;                              // found by search for VRAM Address @FFB4CB2C
}



// Histo etc. when in play mode maybe ?
void *vid_get_viewport_fb_d()
{

return (void*)(*(int*)(0x3230+0x58));                  // found at FF877D10  (0x58 atFF877D48)
}



Ixus 1000 HS

Re: G12 beta release
« Reply #68 on: 23 / February / 2011, 07:25:47 »
Hi ! Thanks for your development!   ::)
Will in future works bracketing in continuous mode?? I miss it really in my g12.  :'(

Regards

Manuel!!

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: G12 beta release
« Reply #69 on: 23 / February / 2011, 16:24:09 »
here i have upload 3 images.you can see the zebra of the window is draw too far left and you can see the
debug output of the values.
Ah, now I understand - a picture really is worth a 1000 words :)
In your samples there is a zebra stripe down the right side of the image area - it looks like this was generated from the masked section of the image immediately to the right. This tells me that the xoffset is working for the bitmap buffer; but is looking at the wrong part of the viewport buffer to calculate the zebra.

I suspect that the sensor data is being stored left aligned in the viewport regardless of shooting mode and then displayed with an offset on the LCD. This is not how it works on the G12.

To test this try the change below and see what happens for zebra and edge overlay.
(Note this is not a good solution, ideally we need seperate xoffsets for the bitmap and viewport buffers; but that will take more work.)

Code: [Select]
void *vid_get_viewport_fb()
{
if ((mode_get()&MODE_MASK) == MODE_REC)
return (void*)(0x40587700-vid_get_viewport_xoffset()*3);
return (void*)0x40587700;                              // found by search for VRAM Address @FFB4CB2C
}

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

 

Related Topics


SimplePortal © 2008-2014, SimplePortal